diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000000..be2ed97014f --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,15 @@ + + +Operating system: ✍️ TODO +Last upstream commit (run `git log --author="Robert Lord" | head -n 1`): ✍️ TODO +Browser version(s): ✍️ TODO +Ruby version (run `ruby -v`): ✍️ TODO + +--- + +✍️ TODO write your issue here \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000000..eebe789aa08 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/.gitignore b/.gitignore index f6fc8c00b25..10501583560 100644 --- a/.gitignore +++ b/.gitignore @@ -14,9 +14,11 @@ tmp *.DS_STORE build/ .cache +.vagrant +.sass-cache # YARD artifacts .yardoc _yardoc doc/ -.idea/ \ No newline at end of file +.idea/ diff --git a/.travis.yml b/.travis.yml index 3280d947c9a..0d6d210d94a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,8 @@ sudo: false language: ruby rvm: - - 1.9.3 - - 2.0.0 + - 2.3.3 + - 2.4.0 cache: bundler +script: bundle exec middleman build diff --git a/CHANGELOG.md b/CHANGELOG.md index 59ee6a441e5..3b897a23b7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,76 @@ # Changelog +## Version 2.0.0 + +*July 17, 2017* + +- All-new statically generated table of contents + - Should be much faster loading and scrolling for large pages + - Smaller Javascript file sizes + - Avoids the problem with the last link in the ToC not ever highlighting if the section was shorter than the page + - Fixes control-click not opening in a new page + - Automatically updates the HTML title as you scroll +- Updated design + - New default colors! + - New spacings and sizes! + - System-default typefaces, just like GitHub +- Added search input delay on large corpuses to reduce lag +- We even bumped the major version cause hey, why not? +- Various small bug fixes + +Thanks to everyone who helped debug or wrote code for this version! It was a serious community effort, and I couldn't have done it alone. + +## Version 1.5.0 + +*February 23, 2017* + +- Add [multiple tabs per programming language](https://github.com/lord/slate/wiki/Multiple-language-tabs-per-programming-language) feature +- Upgrade Middleman to add Ruby 1.4.0 compatibility +- Switch default code highlighting color scheme to better highlight JSON +- Various small typo and bug fixes + +## Version 1.4.0 + +*November 24, 2016* + +- Upgrade Middleman and Rouge gems, should hopefully solve a number of bugs +- Update some links in README +- Fix broken Vagrant startup script +- Fix some problems with deploy.sh help message +- Fix bug with language tabs not hiding properly if no error +- Add `!default` to SASS variables +- Fix bug with logo margin +- Bump tested Ruby versions in .travis.yml + +## Version 1.3.3 + +*June 11, 2016* + +Documentation and example changes. + +## Version 1.3.2 + +*February 3, 2016* + +A small bugfix for slightly incorrect background colors on code samples in some cases. + +## Version 1.3.1 + +*January 31, 2016* + +A small bugfix for incorrect whitespace in code blocks. + +## Version 1.3 + +*January 27, 2016* + +We've upgraded Middleman and a number of other dependencies, which should fix quite a few bugs. + +Instead of `rake build` and `rake deploy`, you should now run `bundle exec middleman build --clean` to build your server, and `./deploy.sh` to deploy it to Github Pages. + ## Version 1.2 -*June 20, 2014* +*June 20, 2015* **Fixes:** @@ -21,7 +89,7 @@ ## Version 1.1 -*July 27th, 2014* +*July 27, 2014* **Fixes:** diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..cc17fd98d59 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hello@lord.io. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index b04fc955ca5..00000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,9 +0,0 @@ -# Contributing to Slate - -Thanks for contributing to Slate! A couple of quick guidelines for submitting PRs: - -- Please point your pull requests at the `dev` branch, and keep your commit messages clear and informative. -- Please make sure your contributions work in the most recent version of Chrome, Firefox, and IE. -- If you're implementing a new feature, even if it's relatively small, it's nice to open an issue before you start so that others know what you're working on and can help make sure you're on the right track. - -Thanks again! Happy coding. \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 8183c7a8b04..00000000000 --- a/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM ubuntu:trusty - -RUN apt-get update -RUN apt-get install -yq ruby ruby-dev build-essential git -RUN gem install --no-ri --no-rdoc bundler -ADD Gemfile /app/Gemfile -ADD Gemfile.lock /app/Gemfile.lock -RUN cd /app; bundle install -ADD . /app -EXPOSE 4567 -WORKDIR /app -CMD ["bundle", "exec", "middleman", "server"] diff --git a/Gemfile b/Gemfile index 3a2a2e01a82..be6b0ceb819 100644 --- a/Gemfile +++ b/Gemfile @@ -1,12 +1,15 @@ +gem 'execjs' +gem 'mini_racer', :platforms => :ruby + +ruby '>=2.3.1' source 'https://rubygems.org/' # Middleman -gem 'middleman', '~>3.3.10' -gem 'middleman-gh-pages', '~> 0.0.3' -gem 'middleman-syntax', '~> 2.0.0' -gem 'middleman-autoprefixer', '~> 2.4.4' -gem 'rouge', '~> 1.9.0' -gem 'redcarpet', '~> 3.3.1' - -gem 'rake', '~> 10.4.2' -gem 'therubyracer', '~> 0.12.1', platforms: :ruby +gem 'middleman', '~>4.2.1' +gem 'middleman-syntax', '~> 3.0.0' +gem 'middleman-autoprefixer', '~> 2.7.0' +gem "middleman-sprockets", "~> 4.1.0" +gem 'rouge', '~> 2.0.5' +gem 'redcarpet', '~> 3.4.0' +gem 'nokogiri', '~> 1.13.10' +gem 'erubis', '~> 2.7.0' diff --git a/Gemfile.lock b/Gemfile.lock index f9978492816..b6cbc9f293a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,140 +1,141 @@ GEM remote: https://rubygems.org/ specs: - activesupport (4.1.11) - i18n (~> 0.6, >= 0.6.9) - json (~> 1.7, >= 1.7.7) + activesupport (5.0.7.2) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.1) tzinfo (~> 1.1) - autoprefixer-rails (5.2.0.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + autoprefixer-rails (6.7.7.2) execjs - json - celluloid (0.16.0) - timers (~> 4.0.0) - chunky_png (1.3.4) + backports (3.25.1) coffee-script (2.4.1) coffee-script-source execjs - coffee-script-source (1.9.1.1) - compass (1.0.3) - chunky_png (~> 1.2) - compass-core (~> 1.0.2) - compass-import-once (~> 1.0.5) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) - sass (>= 3.3.13, < 3.5) - compass-core (1.0.3) - multi_json (~> 1.0) - sass (>= 3.3.0, < 3.5) + coffee-script-source (1.12.2) compass-import-once (1.0.5) sass (>= 3.2, < 3.5) + concurrent-ruby (1.3.5) + contracts (0.13.0) + dotenv (2.8.1) erubis (2.7.0) - execjs (2.5.2) - ffi (1.9.8) - haml (4.0.6) + execjs (2.10.0) + fast_blank (1.0.1) + fastimage (2.4.0) + ffi (1.17.2) + haml (6.3.0) + temple (>= 0.8.2) + thor tilt - hike (1.2.3) - hitimes (1.2.2) - hooks (0.4.0) - uber (~> 0.0.4) + hamster (3.0.0) + concurrent-ruby (~> 1.0) + hashie (3.6.0) i18n (0.7.0) - json (1.8.3) - kramdown (1.7.0) - libv8 (3.16.14.7) - listen (2.10.1) - celluloid (~> 0.16.0) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) - middleman (3.3.12) + kramdown (1.17.0) + libv8-node (16.19.0.1) + listen (3.0.8) + rb-fsevent (~> 0.9, >= 0.9.4) + rb-inotify (~> 0.9, >= 0.9.7) + logger (1.7.0) + memoist (0.16.2) + middleman (4.2.1) coffee-script (~> 2.2) - compass (>= 1.0.0, < 2.0.0) compass-import-once (= 1.0.5) - execjs (~> 2.0) haml (>= 4.0.5) kramdown (~> 1.2) - middleman-core (= 3.3.12) - middleman-sprockets (>= 3.1.2) + middleman-cli (= 4.2.1) + middleman-core (= 4.2.1) sass (>= 3.4.0, < 4.0) - uglifier (~> 2.5) - middleman-autoprefixer (2.4.4) - autoprefixer-rails (~> 5.2.0) + middleman-autoprefixer (2.7.1) + autoprefixer-rails (>= 6.5.2, < 7.0.0) middleman-core (>= 3.3.3) - middleman-core (3.3.12) - activesupport (~> 4.1.0) + middleman-cli (4.2.1) + thor (>= 0.17.0, < 2.0) + middleman-core (4.2.1) + activesupport (>= 4.2, < 5.1) + addressable (~> 2.3) + backports (~> 3.6) bundler (~> 1.1) + contracts (~> 0.13.0) + dotenv erubis - hooks (~> 0.3) + execjs (~> 2.0) + fast_blank + fastimage (~> 2.0) + hamster (~> 3.0) + hashie (~> 3.4) i18n (~> 0.7.0) - listen (>= 2.7.9, < 3.0) - padrino-helpers (~> 0.12.3) - rack (>= 1.4.5, < 2.0) - rack-test (~> 0.6.2) - thor (>= 0.15.2, < 2.0) - tilt (~> 1.4.1, < 2.0) - middleman-gh-pages (0.0.3) - rake (> 0.9.3) - middleman-sprockets (3.4.2) - middleman-core (>= 3.3) - sprockets (~> 2.12.1) - sprockets-helpers (~> 1.1.0) - sprockets-sass (~> 1.3.0) - middleman-syntax (2.0.0) - middleman-core (~> 3.2) - rouge (~> 1.0) - minitest (5.7.0) - multi_json (1.11.1) - padrino-helpers (0.12.5) + listen (~> 3.0.0) + memoist (~> 0.14) + padrino-helpers (~> 0.13.0) + parallel + rack (>= 1.4.5, < 3) + sass (>= 3.4) + servolux + tilt (~> 2.0) + uglifier (~> 3.0) + middleman-sprockets (4.1.1) + middleman-core (~> 4.0) + sprockets (>= 3.0) + middleman-syntax (3.0.0) + middleman-core (>= 3.2) + rouge (~> 2.0) + mini_portile2 (2.8.8) + mini_racer (0.6.4) + libv8-node (~> 16.19.0.0) + minitest (5.25.5) + nokogiri (1.13.10) + mini_portile2 (~> 2.8.0) + racc (~> 1.4) + padrino-helpers (0.13.3.4) i18n (~> 0.6, >= 0.6.7) - padrino-support (= 0.12.5) - tilt (~> 1.4.1) - padrino-support (0.12.5) + padrino-support (= 0.13.3.4) + tilt (>= 1.4.1, < 3) + padrino-support (0.13.3.4) activesupport (>= 3.1) - rack (1.6.4) - rack-test (0.6.3) - rack (>= 1.0) - rake (10.4.2) - rb-fsevent (0.9.5) - rb-inotify (0.9.5) - ffi (>= 0.5.0) - redcarpet (3.3.1) - ref (1.0.5) - rouge (1.9.0) - sass (3.4.14) - sprockets (2.12.3) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sprockets-helpers (1.1.0) - sprockets (~> 2.0) - sprockets-sass (1.3.1) - sprockets (~> 2.0) - tilt (~> 1.1) - therubyracer (0.12.2) - libv8 (~> 3.16.14.0) - ref - thor (0.19.1) - thread_safe (0.3.5) - tilt (1.4.1) - timers (4.0.1) - hitimes - tzinfo (1.2.2) + parallel (1.27.0) + public_suffix (5.1.1) + racc (1.8.1) + rack (2.2.13) + rb-fsevent (0.11.2) + rb-inotify (0.11.1) + ffi (~> 1.0) + redcarpet (3.4.0) + rouge (2.0.7) + sass (3.4.25) + servolux (0.13.0) + sprockets (4.2.2) + concurrent-ruby (~> 1.0) + logger + rack (>= 2.2.4, < 4) + temple (0.10.3) + thor (1.3.2) + thread_safe (0.3.6) + tilt (2.6.0) + tzinfo (1.2.11) thread_safe (~> 0.1) - uber (0.0.13) - uglifier (2.7.1) - execjs (>= 0.3.0) - json (>= 1.8.0) + uglifier (3.2.0) + execjs (>= 0.3.0, < 3) PLATFORMS ruby DEPENDENCIES - middleman (~> 3.3.10) - middleman-autoprefixer (~> 2.4.4) - middleman-gh-pages (~> 0.0.3) - middleman-syntax (~> 2.0.0) - rake (~> 10.4.2) - redcarpet (~> 3.3.1) - rouge (~> 1.9.0) - therubyracer (~> 0.12.1) + erubis (~> 2.7.0) + execjs + middleman (~> 4.2.1) + middleman-autoprefixer (~> 2.7.0) + middleman-sprockets (~> 4.1.0) + middleman-syntax (~> 3.0.0) + mini_racer + nokogiri (~> 1.13.10) + redcarpet (~> 3.4.0) + rouge (~> 2.0.5) + +RUBY VERSION + ruby 2.7.8p225 + +BUNDLED WITH + 1.17.3 diff --git a/README.md b/README.md index efb7e1eb8cd..565828df189 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,33 @@ -Slate -======== +

+ Slate: API Documentation Generator +
+ Build Status +

-[![Build Status](https://travis-ci.org/tripit/slate.svg?branch=master)](https://travis-ci.org/tripit/slate) [![Dependency Status](https://gemnasium.com/tripit/slate.png)](https://gemnasium.com/tripit/slate) +

Slate helps you create beautiful, intelligent, responsive API documentation.

-Slate helps you create beautiful API documentation. Think of it as an intelligent, responsive documentation template for your API. +

Screenshot of Example Documentation created with Slate

-Screenshot of Example Documentation created with Slate - -*The example above was created with Slate. Check it out at [tripit.github.io/slate](http://tripit.github.io/slate).* +

The example above was created with Slate. Check it out at lord.github.io/slate.

Features ------------ -* **Clean, intuitive design** — with Slate, the description of your API is on the left side of your documentation, and all the code examples are on the right side. Inspired by [Stripe's](https://stripe.com/docs/api) and [Paypal's](https://developer.paypal.com/webapps/developer/docs/api/) API docs. Slate is responsive, so it looks great on tablets, phones, and even print. +* **Clean, intuitive design** — With Slate, the description of your API is on the left side of your documentation, and all the code examples are on the right side. Inspired by [Stripe's](https://stripe.com/docs/api) and [Paypal's](https://developer.paypal.com/webapps/developer/docs/api/) API docs. Slate is responsive, so it looks great on tablets, phones, and even in print. -* **Everything on a single page** — gone are the days where your users had to search through a million pages to find what they wanted. Slate puts the entire documentation on a single page. We haven't sacrificed linkability, though. As you scroll, your browser's hash will update to the nearest header, so linking to a particular point in the documentation is still natural and easy. +* **Everything on a single page** — Gone are the days when your users had to search through a million pages to find what they wanted. Slate puts the entire documentation on a single page. We haven't sacrificed linkability, though. As you scroll, your browser's hash will update to the nearest header, so linking to a particular point in the documentation is still natural and easy. -* **Slate is just Markdown** — when you write docs with Slate, you're just writing Markdown, which makes it simple to edit and understand. Everything is written in Markdown — even the code samples are just Markdown code blocks! +* **Slate is just Markdown** — When you write docs with Slate, you're just writing Markdown, which makes it simple to edit and understand. Everything is written in Markdown — even the code samples are just Markdown code blocks. -* **Write code samples in multiple languages** — if your API has bindings in multiple programming languages, you easily put in tabs to switch between them. In your document, you'll distinguish different languages by specifying the language name at the top of each code block, just like with Github Flavored Markdown! +* **Write code samples in multiple languages** — If your API has bindings in multiple programming languages, you can easily put in tabs to switch between them. In your document, you'll distinguish different languages by specifying the language name at the top of each code block, just like with Github Flavored Markdown. -* **Out-of-the-box syntax highlighting** for [almost 60 languages](http://rouge.jayferd.us/demo), no configuration required. +* **Out-of-the-box syntax highlighting** for [over 100 languages](https://github.com/jneen/rouge/wiki/List-of-supported-languages-and-lexers), no configuration required. * **Automatic, smoothly scrolling table of contents** on the far left of the page. As you scroll, it displays your current position in the document. It's fast, too. We're using Slate at TripIt to build documentation for our new API, where our table of contents has over 180 entries. We've made sure that the performance remains excellent, even for larger documents. -* **Let your users update your documentation for you** — by default, your Slate-generated documentation is hosted in a public Github repository. Not only does this mean you get free hosting for your docs with Github Pages, but it also makes it's simple for other developers to make pull requests to your docs if they find typos or other problems. Of course, if you don't want to, you're welcome to not use Github and host your docs elsewhere! - -Getting starting with Slate is super easy! Simply fork this repository, and then follow the instructions below. Or, if you'd like to check out what Slate is capable of, take a look at the [sample docs](http://tripit.github.io/slate). +* **Let your users update your documentation for you** — By default, your Slate-generated documentation is hosted in a public Github repository. Not only does this mean you get free hosting for your docs with Github Pages, but it also makes it simple for other developers to make pull requests to your docs if they find typos or other problems. Of course, if you don't want to use GitHub, you're also welcome to host your docs elsewhere. - +Getting started with Slate is super easy! Simply fork this repository and follow the instructions below. Or, if you'd like to check out what Slate is capable of, take a look at the [sample docs](http://lord.github.io/slate). Getting Started with Slate ------------------------------ @@ -38,85 +37,78 @@ Getting Started with Slate You're going to need: - **Linux or OS X** — Windows may work, but is unsupported. - - **Ruby, version 1.9.3 or newer** + - **Ruby, version 2.3.1 or newer** - **Bundler** — If Ruby is already installed, but the `bundle` command doesn't work, just run `gem install bundler` in a terminal. ### Getting Set Up - 1. Fork this repository on Github. - 2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git` - 3. `cd slate` - 4. Install all dependencies: `bundle install` - 5. Start the test server: `bundle exec middleman server` - -Or use the included Dockerfile! (must install Docker first) +1. Fork this repository on Github. +2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git` +3. `cd slate` +4. Initialize and start Slate. You can either do this locally, or with Vagrant: ```shell -docker build -t slate . -docker run -d -p 4567:4567 slate +# either run this to run locally +bundle install +bundle exec middleman server + +# OR run this to run with vagrant +vagrant up ``` -You can now see the docs at . Whoa! That was fast! +You can now see the docs at http://localhost:4567. Whoa! That was fast! -*Note: if you're using the Docker setup on OSX, the docs will be -availalable at the output of `boot2docker ip` instead of `localhost:4567`.* +Now that Slate is all set up on your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/lord/slate/wiki/Markdown-Syntax), or [how to publish your docs](https://github.com/lord/slate/wiki/Deploying-Slate). -Now that Slate is all set up your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/tripit/slate/wiki/Markdown-Syntax), or [how to publish your docs](https://github.com/tripit/slate/wiki/Deploying-Slate). +If you'd prefer to use Docker, instructions are available [in the wiki](https://github.com/lord/slate/wiki/Docker). -Examples of Slate in the Wild +### Note on JavaScript Runtime + +For those who don't have JavaScript runtime or are experiencing JavaScript runtime issues with ExecJS, it is recommended to add the [rubyracer gem](https://github.com/cowboyd/therubyracer) to your gemfile and run `bundle` again. + +Companies Using Slate --------------------------------- -* [Travis-CI's API docs](http://docs.travis-ci.com/api/) -* [Mozilla's localForage docs](http://mozilla.github.io/localForage/) -* [Mozilla Recroom](http://mozilla.github.io/recroom/) -* [ChaiOne Gameplan API docs](http://chaione.github.io/gameplanb2b/#introduction) -* [Drcaban's Build a Quine tutorial](http://drcabana.github.io/build-a-quine/#introduction) -* [PricePlow API docs](https://www.priceplow.com/api/documentation) -* [Emerging Threats API docs](http://apidocs.emergingthreats.net/) -* [Appium docs](http://appium.io/slate/en/master) -* [Golazon Developer](http://developer.golazon.com) -* [Dwolla API docs](https://docs.dwolla.com/) -* [RozpisyZapasu API docs](http://www.rozpisyzapasu.cz/dev/api/) -* [Codestar Framework Docs](http://codestarframework.com/documentation/) -* [Buddycloud API](http://buddycloud.com/api) -* [Crafty Clicks API](https://craftyclicks.co.uk/api/) -* [Paracel API Reference](http://paracel.io/docs/api_reference.html) -* [Switch Payments Documentation](http://switchpayments.com/docs/) & [API](http://switchpayments.com/developers/) -* [Coinbase API Reference](https://developers.coinbase.com/api) -* [Whispir.io API](https://whispir.github.io/api) -* [NASA API](https://data.nasa.gov/developer/external/planetary/) -* [CardPay API](https://developers.cardpay.com/) -* [IBM Cloudant](https://docs-testb.cloudant.com/content-review/_design/couchapp/index.html) -* [Bitrix basis components](http://bbc.bitrix.expert/) -* [viagogo API Documentation](http://developer.viagogo.net/) -* [Fidor Bank API Documentation](http://docs.fidor.de/) -* [Market Prophit API Documentation](http://developer.marketprophit.com/) - -(Feel free to add your site to this list in a pull request!) +* [NASA](https://api.nasa.gov) +* [IBM](https://docs.cloudant.com/api.html) +* [Sony](http://developers.cimediacloud.com) +* [Best Buy](https://bestbuyapis.github.io/api-documentation/) +* [Travis-CI](https://docs.travis-ci.com/api/) +* [Greenhouse](https://developers.greenhouse.io/harvest.html) +* [Woocommerce](http://woocommerce.github.io/woocommerce-rest-api-docs/) +* [Appium](http://appium.io/slate/en/master) +* [Dwolla](https://docs.dwolla.com/) +* [Clearbit](https://clearbit.com/docs) +* [Coinbase](https://developers.coinbase.com/api) +* [Parrot Drones](http://developer.parrot.com/docs/bebop/) +* [Fidor Bank](http://docs.fidor.de/) +* [Scale](https://docs.scaleapi.com/) + +You can view more in [the list on the wiki](https://github.com/lord/slate/wiki/Slate-in-the-Wild). Need Help? Found a bug? -------------------- -Just [submit a issue](https://github.com/tripit/slate/issues) to the Slate Github if you need any help. And, of course, feel free to submit pull requests with bug fixes or changes. - +[Submit an issue](https://github.com/lord/slate/issues) to the Slate Github if you need any help. And, of course, feel free to submit pull requests with bug fixes or changes. Contributors -------------------- -Slate was built by [Robert Lord](https://lord.io) while at [TripIt](http://tripit.com). +Slate was built by [Robert Lord](https://lord.io) while interning at [TripIt](https://www.tripit.com/). Thanks to the following people who have submitted major pull requests: - [@chrissrogers](https://github.com/chrissrogers) - [@bootstraponline](https://github.com/bootstraponline) - [@realityking](https://github.com/realityking) +- [@cvkef](https://github.com/cvkef) -Also, thanks to [Sauce Labs](http://saucelabs.com) for helping sponsor the project. +Also, thanks to [Sauce Labs](http://saucelabs.com) for sponsoring the development of the responsive styles. Special Thanks -------------------- - [Middleman](https://github.com/middleman/middleman) - [jquery.tocify.js](https://github.com/gfranko/jquery.tocify.js) - [middleman-syntax](https://github.com/middleman/middleman-syntax) -- [middleman-gh-pages](https://github.com/neo/middleman-gh-pages) +- [middleman-gh-pages](https://github.com/edgecase/middleman-gh-pages) - [Font Awesome](http://fortawesome.github.io/Font-Awesome/) diff --git a/Rakefile b/Rakefile deleted file mode 100644 index 6a952e1e914..00000000000 --- a/Rakefile +++ /dev/null @@ -1,6 +0,0 @@ -require 'middleman-gh-pages' -require 'rake/clean' - -CLOBBER.include('build') - -task :default => [:build] diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 00000000000..2fccb7c4b9a --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,41 @@ +Vagrant.configure(2) do |config| + config.vm.box = "ubuntu/trusty64" + config.vm.network :forwarded_port, guest: 4567, host: 4567 + + config.vm.provision "bootstrap", + type: "shell", + inline: <<-SHELL + sudo apt-add-repository ppa:brightbox/ruby-ng + sudo apt-get update + sudo apt-get install -yq ruby2.4 ruby2.4-dev + sudo apt-get install -yq pkg-config build-essential nodejs git libxml2-dev libxslt-dev + sudo apt-get autoremove -yq + gem2.4 install --no-ri --no-rdoc bundler + SHELL + + # add the local user git config to the vm + config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig" + + config.vm.provision "install", + type: "shell", + privileged: false, + inline: <<-SHELL + echo "==============================================" + echo "Installing app dependencies" + cd /vagrant + bundle config build.nokogiri --use-system-libraries + bundle install + SHELL + + config.vm.provision "run", + type: "shell", + privileged: false, + run: "always", + inline: <<-SHELL + echo "==============================================" + echo "Starting up middleman at http://localhost:4567" + echo "If it does not come up, check the ~/middleman.log file for any error messages" + cd /vagrant + bundle exec middleman server --watcher-force-polling --watcher-latency=1 &> ~/middleman.log & + SHELL +end \ No newline at end of file diff --git a/config.rb b/config.rb index 43bceaa5a43..e0f2479edb4 100644 --- a/config.rb +++ b/config.rb @@ -1,3 +1,6 @@ +# Unique header generation +require './lib/unique_head.rb' + # Markdown set :markdown_engine, :redcarpet set :markdown, @@ -7,7 +10,8 @@ prettify: true, tables: true, with_toc_data: true, - no_intra_emphasis: true + no_intra_emphasis: true, + renderer: UniqueHeadCounter # Assets set :css_dir, 'stylesheets' @@ -17,6 +21,11 @@ # Activate the syntax highlighter activate :syntax +ready do + require './lib/multilang.rb' +end + +activate :sprockets activate :autoprefixer do |config| config.browsers = ['last 2 version', 'Firefox ESR'] @@ -30,9 +39,19 @@ # Build Configuration configure :build do + # If you're having trouble with Middleman hanging, commenting + # out the following two lines has been known to help activate :minify_css activate :minify_javascript # activate :relative_assets # activate :asset_hash # activate :gzip end + +# Deploy Configuration +# If you want Middleman to listen on a different port, you can set that below +set :port, 4567 + +helpers do + require './lib/toc_data.rb' +end diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 00000000000..3d4a5b6eda1 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,214 @@ +#!/usr/bin/env bash +set -o errexit #abort if any command fails +me=$(basename "$0") + +help_message="\ +Usage: $me [-c FILE] [] +Deploy generated files to a git branch. + +Options: + + -h, --help Show this help information. + -v, --verbose Increase verbosity. Useful for debugging. + -e, --allow-empty Allow deployment of an empty directory. + -m, --message MESSAGE Specify the message used when committing on the + deploy branch. + -n, --no-hash Don't append the source commit's hash to the deploy + commit's message. + -c, --current Specify Current version for index.html +" + +bundle exec middleman build --clean + +parse_args() { + # Set args from a local environment file. + if [ -e ".env" ]; then + source .env + fi + + # Parse arg flags + # If something is exposed as an environment variable, set/overwrite it + # here. Otherwise, set/overwrite the internal variable instead. + while : ; do + if [[ $1 = "-h" || $1 = "--help" ]]; then + echo "$help_message" + return 0 + elif [[ $1 = "-v" || $1 = "--verbose" ]]; then + verbose=true + shift + elif [[ $1 = "-e" || $1 = "--allow-empty" ]]; then + allow_empty=true + shift + elif [[ ( $1 = "-m" || $1 = "--message" ) && -n $2 ]]; then + commit_message=$2 + shift 2 + elif [[ $1 = "-n" || $1 = "--no-hash" ]]; then + GIT_DEPLOY_APPEND_HASH=false + shift + elif [[ ( $1 = "-c" || $1 = "--current" ) && -n $2 ]]; then + CURRENT_VERSION=$2 + shift 2 + else + break + fi + done + + # Set internal option vars from the environment and arg flags. All internal + # vars should be declared here, with sane defaults if applicable. + + # Source directory & target branch. + deploy_directory=build + deploy_branch=gh-pages + + #if no user identity is already set in the current git environment, use this: + default_username=${GIT_DEPLOY_USERNAME:-deploy.sh} + default_email=${GIT_DEPLOY_EMAIL:-} + + #repository to deploy to. must be readable and writable. + repo=origin + + #append commit hash to the end of message by default + append_hash=${GIT_DEPLOY_APPEND_HASH:-true} +} + +main() { + parse_args "$@" + + if [ -z "$CURRENT_VERSION" ]; then + echo 'Deploying a versioned html file only...' + else + echo 'Deploying a versioned html file and also updating the current index.html' + cp "$deploy_directory"/"$CURRENT_VERSION"/index.html "$deploy_directory"/index.html + fi + + enable_expanded_output + + if ! git diff --exit-code --quiet --cached; then + echo Aborting due to uncommitted changes in the index >&2 + return 1 + fi + + commit_title=`git log -n 1 --format="%s" HEAD` + commit_hash=` git log -n 1 --format="%H" HEAD` + + #default commit message uses last title if a custom one is not supplied + if [[ -z $commit_message ]]; then + commit_message="publish: $commit_title" + fi + + #append hash to commit message unless no hash flag was found + if [ $append_hash = true ]; then + commit_message="$commit_message"$'\n\n'"generated from commit $commit_hash" + fi + + previous_branch=`git rev-parse --abbrev-ref HEAD` + + if [ ! -d "$deploy_directory" ]; then + echo "Deploy directory '$deploy_directory' does not exist. Aborting." >&2 + return 1 + fi + + # must use short form of flag in ls for compatibility with OS X and BSD + if [[ -z `ls -A "$deploy_directory" 2> /dev/null` && -z $allow_empty ]]; then + echo "Deploy directory '$deploy_directory' is empty. Aborting. If you're sure you want to deploy an empty tree, use the --allow-empty / -e flag." >&2 + return 1 + fi + + if git ls-remote --exit-code $repo "refs/heads/$deploy_branch" ; then + # deploy_branch exists in $repo; make sure we have the latest version + + disable_expanded_output + git fetch --force $repo $deploy_branch:$deploy_branch + enable_expanded_output + fi + + # check if deploy_branch exists locally + if git show-ref --verify --quiet "refs/heads/$deploy_branch" + then incremental_deploy + else initial_deploy + fi + + restore_head +} + +initial_deploy() { + git --work-tree "$deploy_directory" checkout --orphan $deploy_branch + git --work-tree "$deploy_directory" add --all + commit+push +} + +incremental_deploy() { + #make deploy_branch the current branch + git symbolic-ref HEAD refs/heads/$deploy_branch + #put the previously committed contents of deploy_branch into the index + git --work-tree "$deploy_directory" reset --mixed --quiet + git --work-tree "$deploy_directory" add --all + + set +o errexit + diff=$(git --work-tree "$deploy_directory" diff --exit-code --quiet HEAD --)$? + set -o errexit + case $diff in + 0) echo No changes to files in $deploy_directory. Skipping commit.;; + 1) commit+push;; + *) + echo git diff exited with code $diff. Aborting. Staying on branch $deploy_branch so you can debug. To switch back to master, use: git symbolic-ref HEAD refs/heads/master && git reset --mixed >&2 + return $diff + ;; + esac +} + +commit+push() { + set_user_id + git --work-tree "$deploy_directory" commit -m "$commit_message" + + disable_expanded_output + #--quiet is important here to avoid outputting the repo URL, which may contain a secret token + git push --quiet $repo $deploy_branch + enable_expanded_output +} + +#echo expanded commands as they are executed (for debugging) +enable_expanded_output() { + if [ $verbose ]; then + set -o xtrace + set +o verbose + fi +} + +#this is used to avoid outputting the repo URL, which may contain a secret token +disable_expanded_output() { + if [ $verbose ]; then + set +o xtrace + set -o verbose + fi +} + +set_user_id() { + if [[ -z `git config user.name` ]]; then + git config user.name "$default_username" + fi + if [[ -z `git config user.email` ]]; then + git config user.email "$default_email" + fi +} + +restore_head() { + if [[ $previous_branch = "HEAD" ]]; then + #we weren't on any branch before, so just set HEAD back to the commit it was on + git update-ref --no-deref HEAD $commit_hash $deploy_branch + else + git symbolic-ref HEAD refs/heads/$previous_branch + fi + + git reset --mixed +} + +filter() { + sed -e "s|$repo|\$repo|g" +} + +sanitize() { + "$@" 2> >(filter 1>&2) | filter +} + +[[ $1 = --source-only ]] || main "$@" diff --git a/gb_deploy.sh b/gb_deploy.sh new file mode 100755 index 00000000000..87628d4b898 --- /dev/null +++ b/gb_deploy.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +VERSION=${1} +git pull +git add -A +git commit -m "Updating Documentation" +git push + + +#!/usr/bin/env bash +version=${1} +if [ -z "$version" ]; then + ./deploy.sh +else + ./deploy.sh --current $version +fi + + + diff --git a/lib/multilang.rb b/lib/multilang.rb new file mode 100644 index 00000000000..36fbe5b1f07 --- /dev/null +++ b/lib/multilang.rb @@ -0,0 +1,16 @@ +module Multilang + def block_code(code, full_lang_name) + if full_lang_name + parts = full_lang_name.split('--') + rouge_lang_name = (parts) ? parts[0] : "" # just parts[0] here causes null ref exception when no language specified + super(code, rouge_lang_name).sub("highlight #{rouge_lang_name}") do |match| + match + " tab-" + full_lang_name + end + else + super(code, full_lang_name) + end + end +end + +require 'middleman-core/renderers/redcarpet' +Middleman::Renderers::MiddlemanRedcarpetHTML.send :include, Multilang diff --git a/lib/toc_data.rb b/lib/toc_data.rb new file mode 100644 index 00000000000..f4663cd2655 --- /dev/null +++ b/lib/toc_data.rb @@ -0,0 +1,30 @@ +require 'nokogiri' + +def toc_data(page_content) + html_doc = Nokogiri::HTML::DocumentFragment.parse(page_content) + + # get a flat list of headers + headers = [] + html_doc.css('h1, h2, h3').each do |header| + headers.push({ + id: header.attribute('id').to_s, + content: header.children, + level: header.name[1].to_i, + children: [] + }) + end + + [3,2].each do |header_level| + header_to_nest = nil + headers = headers.reject do |header| + if header[:level] == header_level + header_to_nest[:children].push header if header_to_nest + true + else + header_to_nest = header if header[:level] < header_level + false + end + end + end + headers +end \ No newline at end of file diff --git a/lib/unique_head.rb b/lib/unique_head.rb new file mode 100644 index 00000000000..c5dc2790e0b --- /dev/null +++ b/lib/unique_head.rb @@ -0,0 +1,17 @@ +# Unique header generation +require 'middleman-core/renderers/redcarpet' +class UniqueHeadCounter < Middleman::Renderers::MiddlemanRedcarpetHTML + def initialize + super + @head_count = {} + end + def header(text, header_level) + friendly_text = text.parameterize + @head_count[friendly_text] ||= 0 + @head_count[friendly_text] += 1 + if @head_count[friendly_text] > 1 + friendly_text += "-#{@head_count[friendly_text]}" + end + return "#{text}" + end +end diff --git a/source/images/logo.png b/source/images/logo.png index fa1f13da819..19578ea11d0 100644 Binary files a/source/images/logo.png and b/source/images/logo.png differ diff --git a/source/includes/_errors.md b/source/includes/_errors.md deleted file mode 100644 index 56cffb34d22..00000000000 --- a/source/includes/_errors.md +++ /dev/null @@ -1,20 +0,0 @@ -# Errors - - - -The Kittn API uses the following error codes: - - -Error Code | Meaning ----------- | ------- -400 | Bad Request -- Your request sucks -401 | Unauthorized -- Your API key is wrong -403 | Forbidden -- The kitten requested is hidden for administrators only -404 | Not Found -- The specified kitten could not be found -405 | Method Not Allowed -- You tried to access a kitten with an invalid method -406 | Not Acceptable -- You requested a format that isn't json -410 | Gone -- The kitten requested has been removed from our servers -418 | I'm a teapot -429 | Too Many Requests -- You're requesting too many kittens! Slow down! -500 | Internal Server Error -- We had a problem with our server. Try again later. -503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later. diff --git a/source/index.md b/source/index.md deleted file mode 100644 index 4c1fa8c9f7d..00000000000 --- a/source/index.md +++ /dev/null @@ -1,168 +0,0 @@ ---- -title: API Reference - -language_tabs: - - shell - - ruby - - python - -toc_footers: - - Sign Up for a Developer Key - - Documentation Powered by Slate - -includes: - - errors - -search: true ---- - -# Introduction - -Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database. - -We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right. - -This example API documentation page was created with [Slate](http://github.com/tripit/slate). Feel free to edit it and use it as a base for your own API's documentation. - -# Authentication - -> To authorize, use this code: - -```ruby -require 'kittn' - -api = Kittn::APIClient.authorize!('meowmeowmeow') -``` - -```python -import kittn - -api = kittn.authorize('meowmeowmeow') -``` - -```shell -# With shell, you can just pass the correct header with each request -curl "api_endpoint_here" - -H "Authorization: meowmeowmeow" -``` - -> Make sure to replace `meowmeowmeow` with your API key. - -Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our [developer portal](http://example.com/developers). - -Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following: - -`Authorization: meowmeowmeow` - - - -# Kittens - -## Get All Kittens - -```ruby -require 'kittn' - -api = Kittn::APIClient.authorize!('meowmeowmeow') -api.kittens.get -``` - -```python -import kittn - -api = kittn.authorize('meowmeowmeow') -api.kittens.get() -``` - -```shell -curl "http://example.com/api/kittens" - -H "Authorization: meowmeowmeow" -``` - -> The above command returns JSON structured like this: - -```json -[ - { - "id": 1, - "name": "Fluffums", - "breed": "calico", - "fluffiness": 6, - "cuteness": 7 - }, - { - "id": 2, - "name": "Isis", - "breed": "unknown", - "fluffiness": 5, - "cuteness": 10 - } -] -``` - -This endpoint retrieves all kittens. - -### HTTP Request - -`GET http://example.com/api/kittens` - -### Query Parameters - -Parameter | Default | Description ---------- | ------- | ----------- -include_cats | false | If set to true, the result will also include cats. -available | true | If set to false, the result will include kittens that have already been adopted. - - - -## Get a Specific Kitten - -```ruby -require 'kittn' - -api = Kittn::APIClient.authorize!('meowmeowmeow') -api.kittens.get(2) -``` - -```python -import kittn - -api = kittn.authorize('meowmeowmeow') -api.kittens.get(2) -``` - -```shell -curl "http://example.com/api/kittens/2" - -H "Authorization: meowmeowmeow" -``` - -> The above command returns JSON structured like this: - -```json -{ - "id": 2, - "name": "Isis", - "breed": "unknown", - "fluffiness": 5, - "cuteness": 10 -} -``` - -This endpoint retrieves a specific kitten. - - - -### HTTP Request - -`GET http://example.com/kittens/` - -### URL Parameters - -Parameter | Description ---------- | ----------- -ID | The ID of the kitten to retrieve - diff --git a/source/javascripts/all.js b/source/javascripts/all.js index ffaa9b01307..5f5d4067ba6 100644 --- a/source/javascripts/all.js +++ b/source/javascripts/all.js @@ -1,4 +1,2 @@ -//= require ./lib/_energize -//= require ./app/_lang +//= require ./all_nosearch //= require ./app/_search -//= require ./app/_toc diff --git a/source/javascripts/all_nosearch.js b/source/javascripts/all_nosearch.js index 818bc4e5095..b18c1d833d4 100644 --- a/source/javascripts/all_nosearch.js +++ b/source/javascripts/all_nosearch.js @@ -1,3 +1,16 @@ //= require ./lib/_energize -//= require ./app/_lang //= require ./app/_toc +//= require ./app/_lang + +$(function() { + loadToc($('#toc'), '.toc-link', '.toc-list-h2', 10); + setupLanguages($('body').data('languages')); + $('.content').imagesLoaded( function() { + window.recacheHeights(); + window.refreshToc(); + }); +}); + +window.onpopstate = function() { + activateLanguage(getLanguageFromQueryString()); +}; diff --git a/source/javascripts/app/_lang.js b/source/javascripts/app/_lang.js index 1a124bb68ae..208f4e0521e 100644 --- a/source/javascripts/app/_lang.js +++ b/source/javascripts/app/_lang.js @@ -1,3 +1,5 @@ +//= require ../lib/_jquery + /* Copyright 2008-2013 Concur Technologies, Inc. @@ -13,13 +15,14 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -(function (global) { +;(function () { 'use strict'; var languages = []; - global.setupLanguages = setupLanguages; - global.activateLanguage = activateLanguage; + window.setupLanguages = setupLanguages; + window.activateLanguage = activateLanguage; + window.getLanguageFromQueryString = getLanguageFromQueryString; function activateLanguage(language) { if (!language) return; @@ -28,11 +31,13 @@ under the License. $(".lang-selector a").removeClass('active'); $(".lang-selector a[data-language-name='" + language + "']").addClass('active'); for (var i=0; i < languages.length; i++) { - $(".highlight." + languages[i]).hide(); + $(".highlight.tab-" + languages[i]).hide(); + $(".lang-specific." + languages[i]).hide(); } - $(".highlight." + language).show(); + $(".highlight.tab-" + language).show(); + $(".lang-specific." + language).show(); - global.toc.calculateHeights(); + window.recacheHeights(); // scroll to the new location of the position if ($(window.location.hash).get(0)) { @@ -155,8 +160,5 @@ under the License. activateLanguage(language); return false; }); - window.onpopstate = function() { - activateLanguage(getLanguageFromQueryString()); - }; }); -})(window); +})(); diff --git a/source/javascripts/app/_search.js b/source/javascripts/app/_search.js index 91f38a04edf..9ff4233c18a 100644 --- a/source/javascripts/app/_search.js +++ b/source/javascripts/app/_search.js @@ -1,10 +1,13 @@ //= require ../lib/_lunr +//= require ../lib/_jquery //= require ../lib/_jquery.highlight -(function () { +;(function () { 'use strict'; var content, searchResults; var highlightOpts = { element: 'span', className: 'search-highlight' }; + var searchDelay = 0; + var timeoutHandle = 0; var index = new lunr.Index(); @@ -26,24 +29,44 @@ body: body.text() }); }); + + determineSearchDelay(); + } + function determineSearchDelay() { + if(index.tokenStore.length>5000) { + searchDelay = 300; + } } function bind() { content = $('.content'); searchResults = $('.search-results'); - $('#input-search').on('keyup', search); + $('#input-search').on('keyup',function(e) { + var wait = function() { + return function(executingFunction, waitTime){ + clearTimeout(timeoutHandle); + timeoutHandle = setTimeout(executingFunction, waitTime); + }; + }(); + wait(function(){ + search(e); + }, searchDelay ); + }); } function search(event) { + + var searchInput = $('#input-search')[0]; + unhighlight(); searchResults.addClass('visible'); // ESC clears the field - if (event.keyCode === 27) this.value = ''; + if (event.keyCode === 27) searchInput.value = ''; - if (this.value) { - var results = index.search(this.value).filter(function(r) { + if (searchInput.value) { + var results = index.search(searchInput.value).filter(function(r) { return r.score > 0.0001; }); @@ -53,10 +76,10 @@ var elem = document.getElementById(result.ref); searchResults.append("
  • " + $(elem).text() + "
  • "); }); - highlight.call(this); + highlight.call(searchInput); } else { searchResults.html('
  • '); - $('.search-results li').text('No Results Found for "' + this.value + '"'); + $('.search-results li').text('No Results Found for "' + searchInput.value + '"'); } } else { unhighlight(); @@ -72,3 +95,4 @@ content.unhighlight(highlightOpts); } })(); + diff --git a/source/javascripts/app/_toc.js b/source/javascripts/app/_toc.js index d84bf8e197a..bb651b03f4d 100644 --- a/source/javascripts/app/_toc.js +++ b/source/javascripts/app/_toc.js @@ -1,50 +1,117 @@ -//= require ../lib/_jquery_ui -//= require ../lib/_jquery.tocify -(function (global) { +//= require ../lib/_jquery +//= require ../lib/_imagesloaded.min +;(function () { 'use strict'; + var loaded = false; + + var debounce = function(func, waitTime) { + var timeout = false; + return function() { + if (timeout === false) { + setTimeout(function() { + func(); + timeout = false; + }, waitTime); + timeout = true; + } + }; + }; + var closeToc = function() { - $(".tocify-wrapper").removeClass('open'); + $(".toc-wrapper").removeClass('open'); $("#nav-button").removeClass('open'); }; - var makeToc = function() { - global.toc = $("#toc").tocify({ - selectors: 'h1, h2', - extendPage: false, - theme: 'none', - smoothScroll: false, - showEffectSpeed: 0, - hideEffectSpeed: 180, - ignoreSelector: '.toc-ignore', - highlightOffset: 60, - scrollTo: -1, - scrollHistory: true, - hashGenerator: function (text, element) { - return element.prop('id'); + function loadToc($toc, tocLinkSelector, tocListSelector, scrollOffset) { + var headerHeights = {}; + var pageHeight = 0; + var windowHeight = 0; + var originalTitle = document.title; + + var recacheHeights = function() { + headerHeights = {}; + pageHeight = $(document).height(); + windowHeight = $(window).height(); + + $toc.find(tocLinkSelector).each(function() { + var targetId = $(this).attr('href'); + if (targetId[0] === "#") { + headerHeights[targetId] = $(targetId).offset().top; + } + }); + }; + + var refreshToc = function() { + var currentTop = $(document).scrollTop() + scrollOffset; + + if (currentTop + windowHeight >= pageHeight) { + // at bottom of page, so just select last header by making currentTop very large + // this fixes the problem where the last header won't ever show as active if its content + // is shorter than the window height + currentTop = pageHeight + 1000; + } + + var best = null; + for (var name in headerHeights) { + if ((headerHeights[name] < currentTop && headerHeights[name] > headerHeights[best]) || best === null) { + best = name; + } } - }).data('toc-tocify'); - $("#nav-button").click(function() { - $(".tocify-wrapper").toggleClass('open'); - $("#nav-button").toggleClass('open'); - return false; - }); + // Catch the initial load case + if (currentTop == scrollOffset && !loaded) { + best = window.location.hash; + loaded = true; + } - $(".page-wrapper").click(closeToc); - $(".tocify-item").click(closeToc); - }; + var $best = $toc.find("[href='" + best + "']").first(); + if (!$best.hasClass("active")) { + // .active is applied to the ToC link we're currently on, and its parent
      s selected by tocListSelector + // .active-expanded is applied to the ToC links that are parents of this one + $toc.find(".active").removeClass("active"); + $toc.find(".active-parent").removeClass("active-parent"); + $best.addClass("active"); + $best.parents(tocListSelector).addClass("active").siblings(tocLinkSelector).addClass('active-parent'); + $best.siblings(tocListSelector).addClass("active"); + $toc.find(tocListSelector).filter(":not(.active)").slideUp(150); + $toc.find(tocListSelector).filter(".active").slideDown(150); + if (window.history.pushState) { + window.history.pushState(null, "", best); + } + // TODO remove classnames + document.title = $best.data("title") + " – " + originalTitle; + } + }; - // Hack to make already open sections to start opened, - // instead of displaying an ugly animation - function animate () { - setTimeout(function() { - toc.setOption('showEffectSpeed', 180); - }, 50); - } + var makeToc = function() { + recacheHeights(); + refreshToc(); - $(makeToc); - $(animate); + $("#nav-button").click(function() { + $(".toc-wrapper").toggleClass('open'); + $("#nav-button").toggleClass('open'); + return false; + }); + $(".page-wrapper").click(closeToc); + $(".toc-link").click(closeToc); -})(window); + // reload immediately after scrolling on toc click + $toc.find(tocLinkSelector).click(function() { + setTimeout(function() { + refreshToc(); + }, 0); + }); + + $(window).scroll(debounce(refreshToc, 200)); + $(window).resize(debounce(recacheHeights, 200)); + }; + + makeToc(); + + window.recacheHeights = recacheHeights; + window.refreshToc = refreshToc; + } + window.loadToc = loadToc; +})(); diff --git a/source/javascripts/lib/_imagesloaded.min.js b/source/javascripts/lib/_imagesloaded.min.js new file mode 100644 index 00000000000..d66f658937d --- /dev/null +++ b/source/javascripts/lib/_imagesloaded.min.js @@ -0,0 +1,7 @@ +/*! + * imagesLoaded PACKAGED v3.1.8 + * JavaScript is all like "You images are done yet or what?" + * MIT License + */ + +(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);var i=n.nodeType;if(i&&(1===i||9===i||11===i))for(var r=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s}); \ No newline at end of file diff --git a/source/javascripts/lib/_jquery.js b/source/javascripts/lib/_jquery.js new file mode 100644 index 00000000000..b78120e6a1c --- /dev/null +++ b/source/javascripts/lib/_jquery.js @@ -0,0 +1,9831 @@ +/*! + * jQuery JavaScript Library v2.2.0 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2016-01-08T20:02Z + */ + +(function( global, factory ) { + + if ( typeof module === "object" && typeof module.exports === "object" ) { + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Support: Firefox 18+ +// Can't be in strict mode, several libs including ASP.NET trace +// the stack via arguments.caller.callee and Firefox dies if +// you try to trace through "use strict" call chains. (#13335) +//"use strict"; +var arr = []; + +var document = window.document; + +var slice = arr.slice; + +var concat = arr.concat; + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var support = {}; + + + +var + version = "2.2.0", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android<4.1 + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // Start with an empty selector + selector: "", + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num != null ? + + // Return just the one element from the set + ( num < 0 ? this[ num + this.length ] : this[ num ] ) : + + // Return all the elements in a clean array + slice.call( this ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + ret.context = this.context; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = jQuery.isArray( copy ) ) ) ) { + + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray( src ) ? src : []; + + } else { + clone = src && jQuery.isPlainObject( src ) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isFunction: function( obj ) { + return jQuery.type( obj ) === "function"; + }, + + isArray: Array.isArray, + + isWindow: function( obj ) { + return obj != null && obj === obj.window; + }, + + isNumeric: function( obj ) { + + // parseFloat NaNs numeric-cast false positives (null|true|false|"") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + // adding 1 corrects loss of precision from parseFloat (#15100) + var realStringObj = obj && obj.toString(); + return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; + }, + + isPlainObject: function( obj ) { + + // Not plain objects: + // - Any object or value whose internal [[Class]] property is not "[object Object]" + // - DOM nodes + // - window + if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + if ( obj.constructor && + !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { + return false; + } + + // If the function hasn't returned already, we're confident that + // |obj| is a plain object, created by {} or constructed with new Object + return true; + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android<4.0, iOS<6 (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + var script, + indirect = eval; + + code = jQuery.trim( code ); + + if ( code ) { + + // If the code includes a valid, prologue position + // strict mode pragma, execute code by injecting a + // script tag into the document. + if ( code.indexOf( "use strict" ) === 1 ) { + script = document.createElement( "script" ); + script.text = code; + document.head.appendChild( script ).parentNode.removeChild( script ); + } else { + + // Otherwise, avoid the DOM node creation, insertion + // and removal by using an indirect global eval + + indirect( code ); + } + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Support: IE9-11+ + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // Support: Android<4.1 + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: Date.now, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +// JSHint would error on this code due to the Symbol not being defined in ES5. +// Defining this global in .jshintrc would create a danger of using the global +// unguarded in another place, it seems safer to just disable JSHint for these +// three lines. +/* jshint ignore: start */ +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} +/* jshint ignore: end */ + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: iOS 8.2 (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.2.1 + * http://sizzlejs.com/ + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2015-10-17 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // General-purpose constants + MAX_NEGATIVE = 1 << 31, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // http://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + rescape = /'|\\/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }; + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, nidselect, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; + + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { + + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; + while ( i-- ) { + groups[i] = nidselect + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return !!fn( div ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + ( ~b.sourceIndex || MAX_NEGATIVE ) - + ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, parent, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( (parent = document.defaultView) && parent.top !== parent ) { + // Support: IE 11 + if ( parent.addEventListener ) { + parent.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( parent.attachEvent ) { + parent.attachEvent( "onunload", unloadHandler ); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( div ) { + div.className = "i"; + return !div.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( div ) { + div.appendChild( document.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( div ) { + docElem.appendChild( div ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + }); + + // ID find and filter + if ( support.getById ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var m = context.getElementById( id ); + return m ? [ m ] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + // Support: IE6/7 + // getElementById is not reliable as a find shortcut + delete Expr.find["ID"]; + + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See http://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + docElem.appendChild( div ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( div.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibing-combinator selector` fails + if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( div ) { + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement("input"); + input.setAttribute( "type", "hidden" ); + div.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( div.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === document ? -1 : + b === document ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( (oldCache = uniqueCache[ dir ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ dir ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context === document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context || document, xml) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + support.getById && context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( div1 ) { + // Should return 1, but returns 4 (following) + return div1.compareDocumentPosition( document.createElement("div") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( div ) { + div.innerHTML = ""; + return div.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( div ) { + div.innerHTML = ""; + div.firstChild.setAttribute( "value", "" ); + return div.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( div ) { + return div.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + +var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + /* jshint -W018 */ + return !!qualifier.call( elem, i, elem ) !== not; + } ); + + } + + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + + } + + if ( typeof qualifier === "string" ) { + if ( risSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + qualifier = jQuery.filter( qualifier, elements ); + } + + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 && elem.nodeType === 1 ? + jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : + jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, + len = this.length, + ret = [], + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); + ret.selector = this.selector ? this.selector + " " + selector : selector; + return ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + // Support: Blackberry 4.6 + // gEBID returns nodes no longer in the document (#6963) + if ( elem && elem.parentNode ) { + + // Inject the element directly into the jQuery object + this.length = 1; + this[ 0 ] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( pos ? + pos.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + return elem.contentDocument || jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnotwhite = ( /\S+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( jQuery.isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], + [ "notify", "progress", jQuery.Callbacks( "memory" ) ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this === promise ? newDefer.promise() : this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( function() { + + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || + ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. + // If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( values === progressValues ) { + deferred.notifyWith( contexts, values ); + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // Add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .progress( updateFunc( i, progressContexts, progressValues ) ) + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ); + } else { + --remaining; + } + } + } + + // If we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +} ); + + +// The deferred used on DOM ready +var readyList; + +jQuery.fn.ready = function( fn ) { + + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + jQuery( document ).off( "ready" ); + } + } +} ); + +/** + * The ready event handler and self cleanup method + */ +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called + // after the browser event has already occurred. + // Support: IE9-10 only + // Older IE sometimes signals "interactive" too soon + if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + + } else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); + } + } + return readyList.promise( obj ); +}; + +// Kick off the DOM ready check even if the user does not +jQuery.ready.promise(); + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + len ? fn( elems[ 0 ], key ) : emptyGet; +}; +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + /* jshint -W018 */ + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + register: function( owner, initial ) { + var value = initial || {}; + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable, non-writable property + // configurability must be true to allow the property to be + // deleted with the delete operator + } else { + Object.defineProperty( owner, this.expando, { + value: value, + writable: true, + configurable: true + } ); + } + return owner[ this.expando ]; + }, + cache: function( owner ) { + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( !acceptData( owner ) ) { + return {}; + } + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + if ( typeof data === "string" ) { + cache[ data ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ prop ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + owner[ this.expando ] && owner[ this.expando ][ key ]; + }, + access: function( owner, key, value ) { + var stored; + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + stored = this.get( owner, key ); + + return stored !== undefined ? + stored : this.get( owner, jQuery.camelCase( key ) ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, name, camel, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key === undefined ) { + this.register( owner ); + + } else { + + // Support array or space separated string of keys + if ( jQuery.isArray( key ) ) { + + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = key.concat( key.map( jQuery.camelCase ) ); + } else { + camel = jQuery.camelCase( key ); + + // Try the string as a key before any manipulation + if ( key in cache ) { + name = [ key, camel ]; + } else { + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + name = camel; + name = name in cache ? + [ name ] : ( name.match( rnotwhite ) || [] ); + } + } + + i = name.length; + + while ( i-- ) { + delete cache[ name[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <= 35-45+ + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://code.google.com/p/chromium/issues/detail?id=378607 + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE11+ + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data, camelKey; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // with the key as-is + data = dataUser.get( elem, key ) || + + // Try to find dashed key if it exists (gh-2779) + // This is for 2.2.x only + dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() ); + + if ( data !== undefined ) { + return data; + } + + camelKey = jQuery.camelCase( key ); + + // Attempt to get data from the cache + // with the key camelized + data = dataUser.get( elem, camelKey ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, camelKey, undefined ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + camelKey = jQuery.camelCase( key ); + this.each( function() { + + // First, attempt to store a copy or reference of any + // data that might've been store with a camelCased key. + var data = dataUser.get( this, camelKey ); + + // For HTML5 data-* attribute interop, we have to + // store property names with dashes in a camelCase form. + // This might not apply to all properties...* + dataUser.set( this, camelKey, value ); + + // *... In the case of properties that might _actually_ + // have dashes, we need to also store a copy of that + // unchanged property. + if ( key.indexOf( "-" ) > -1 && data !== undefined ) { + dataUser.set( this, key, value ); + } + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHidden = function( elem, el ) { + + // isHidden might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || + !jQuery.contains( elem.ownerDocument, elem ); + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, + scale = 1, + maxIterations = 20, + currentValue = tween ? + function() { return tween.cur(); } : + function() { return jQuery.css( elem, prop, "" ); }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + do { + + // If previous iteration zeroed out, double until we get *something*. + // Use string for doubling so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + initialInUnit = initialInUnit / scale; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // Break the loop if scale is unchanged or perfect, or if we've just had enough. + } while ( + scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations + ); + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([\w:-]+)/ ); + +var rscriptType = ( /^$|\/(?:java|ecma)script/i ); + + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // Support: IE9 + option: [ 1, "" ], + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
      " ], + col: [ 2, "", "
      " ], + tr: [ 2, "", "
      " ], + td: [ 3, "", "
      " ], + + _default: [ 0, "", "" ] +}; + +// Support: IE9 +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + + // Support: IE9-11+ + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret = typeof context.getElementsByTagName !== "undefined" ? + context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== "undefined" ? + context.querySelectorAll( tag || "*" ) : + []; + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], ret ) : + ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, contains, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( jQuery.type( elem ) === "object" ) { + + // Support: Android<4.1, PhantomJS<2 + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android<4.1, PhantomJS<2 + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0-4.3, Safari<=5.1 + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Safari<=5.1, Android<4.2 + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<=11+ + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; +} )(); + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE9 +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event ); + + var i, j, ret, matched, handleObj, + handlerQueue = [], + args = slice.call( arguments ), + handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, matches, sel, handleObj, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Support (at least): Chrome, IE9 + // Find delegate handlers + // Black-hole SVG instance trees (#13180) + // + // Support: Firefox<=42+ + // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) + if ( delegateCount && cur.nodeType && + ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push( { elem: cur, handlers: matches } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + + "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split( " " ), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: ( "button buttons clientX clientY offsetX offsetY pageX pageY " + + "screenX screenY toElement" ).split( " " ), + filter: function( event, original ) { + var eventDoc, doc, body, + button = original.button; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - + ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - + ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[ type ]; + + if ( !fixHook ) { + this.fixHooks[ type ] = fixHook = + rmouseEvent.test( type ) ? this.mouseHooks : + rkeyEvent.test( type ) ? this.keyHooks : + {}; + } + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new jQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: Cordova 2.5 (WebKit) (#13255) + // All events should have a target; Cordova deviceready doesn't + if ( !event.target ) { + event.target = document; + } + + // Support: Safari 6.0+, Chrome<28 + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + this.focus(); + return false; + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return jQuery.nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android<4.0 + src.returnValue === false ? + returnTrue : + returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://code.google.com/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, + + // Support: IE 10-11, Edge 10240+ + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +function manipulationTarget( elem, content ) { + if ( jQuery.nodeName( elem, "table" ) && + jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return elem.getElementsByTagName( "tbody" )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + + if ( match ) { + elem.type = match[ 1 ]; + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.access( src ); + pdataCur = dataPriv.set( dest, pdataOld ); + events = pdataOld.events; + + if ( events ) { + delete pdataCur.handle; + pdataCur.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( isFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android<4.1, PhantomJS<2 + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = jQuery.contains( elem.ownerDocument, elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <= 35-45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <= 35-45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + + // Keep domManip exposed until 3.0 (gh-2225) + domManip: domManip, + + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: QtWebKit + // .get() because push.apply(_, arraylike) throws + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); + + +var iframe, + elemdisplay = { + + // Support: Firefox + // We have to pre-define these values for FF (#10227) + HTML: "block", + BODY: "block" + }; + +/** + * Retrieve the actual display of a element + * @param {String} name nodeName of the element + * @param {Object} doc Document object + */ + +// Called only from within defaultDisplay +function actualDisplay( name, doc ) { + var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + + display = jQuery.css( elem[ 0 ], "display" ); + + // We don't have any data stored on the element, + // so use "detach" method as fast way to get rid of the element + elem.detach(); + + return display; +} + +/** + * Try to determine the default display value of an element + * @param {String} nodeName + */ +function defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + + // Use the already-created iframe if possible + iframe = ( iframe || jQuery( " diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/simple.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/simple.html.19 new file mode 100644 index 00000000000..0d926c5d32e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/simple.html.19 @@ -0,0 +1,60 @@ +
      +

      test

      +
      + +

      +para2 +

      + +
      +

      tes

      + +

      test +weiter +

      +
      + +

      para4

      + +
      +
      +
      +

      foo

      +
      +
      +
      +
      +

      bar 

      +
      +
      + +

      para5

      + +
      +

      id

      +
      +

      test

      + +
      +

      hallo

      +
      +
      +

      hallo

      +
      + +

      para6

      + +
      +
      +

      Another para.

      +
      + +

      Test

      + +

      Test

      + +

      Test + +

      + + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/simple.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/simple.options new file mode 100644 index 00000000000..a660da25c12 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/simple.options @@ -0,0 +1 @@ +:parse_block_html: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/simple.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/simple.text new file mode 100644 index 00000000000..a2ffe25ebd9 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/simple.text @@ -0,0 +1,55 @@ +
      +test +
      + +

      +para2 +

      + +
      +

      tes

      + +

      test +weiter +

      +
      + +para4 + +
      +
      +
      +foo +
      +
      +
      +
      bar  +
      +
      + +para5 + +
      id +
      test + +
      +hallo +
      +hallo +
      + +para6 + +
      +Another para. +
      + +Test + +

      Test

      + +

      Test + +

      + + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/textarea.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/textarea.html new file mode 100644 index 00000000000..6f5693edea0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/textarea.html @@ -0,0 +1,8 @@ +

      This is a

      + + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/textarea.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/textarea.text new file mode 100644 index 00000000000..a240f5c48c7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/textarea.text @@ -0,0 +1,8 @@ +This is a + + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/xml.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/xml.html new file mode 100644 index 00000000000..d941bc098f6 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/xml.html @@ -0,0 +1,8 @@ + + +doit + +doit + +doit</some> + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/xml.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/xml.text new file mode 100644 index 00000000000..6427fae321d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/09_html/xml.text @@ -0,0 +1,7 @@ + + +doit + +doit + +doit diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/10_ald/simple.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/10_ald/simple.html new file mode 100644 index 00000000000..74b03d58f4e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/10_ald/simple.html @@ -0,0 +1,2 @@ +

      Some paragraph

      + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/10_ald/simple.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/10_ald/simple.text new file mode 100644 index 00000000000..f58768a37f5 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/10_ald/simple.text @@ -0,0 +1,8 @@ +Some paragraph + +{:id: ref1} +{:id: .class1} + {:id: #id} + {:id: key="value"} + {:id: .class2 .class3 ref2 #id-with key="value" key='value' key='dfsd\}' } +{:test: k ey=value} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/auto_id_and_ial.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/auto_id_and_ial.html new file mode 100644 index 00000000000..9857a0380fd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/auto_id_and_ial.html @@ -0,0 +1 @@ +

      A header

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/auto_id_and_ial.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/auto_id_and_ial.options new file mode 100644 index 00000000000..8776b5524df --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/auto_id_and_ial.options @@ -0,0 +1 @@ +:auto_ids: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/auto_id_and_ial.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/auto_id_and_ial.text new file mode 100644 index 00000000000..f521fb0fc21 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/auto_id_and_ial.text @@ -0,0 +1,2 @@ +## A header +{:#myid .cls} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/nested.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/nested.html new file mode 100644 index 00000000000..84cc368d300 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/nested.html @@ -0,0 +1,11 @@ +
      +test +
      + +
      +

      test

      +
      + +
      +

      para

      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/nested.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/nested.text new file mode 100644 index 00000000000..827645cc925 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/nested.text @@ -0,0 +1,15 @@ +{:.cls} +
      +test +
      +{:#id} + +{:.cls} +
      +test +
      +{:#id} + +{:.cls} +> para +{:#id} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/simple.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/simple.html new file mode 100644 index 00000000000..1086f0cfc10 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/simple.html @@ -0,0 +1,29 @@ +

      Some paragraph.

      + +

      Some paragraph.

      + +
      +

      quote

      +
      + +
        +
      • list
      • +
      + +
      code block
      +
      + +
      other code block
      +
      + +

      A header

      + +

      Some paragraph here

      + +

      Some paragraph here

      + +

      Paragraph

      +

      Paragraph

      + +

      Another header

      + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/simple.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/simple.text new file mode 100644 index 00000000000..b97eef3fbd5 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/11_ial/simple.text @@ -0,0 +1,41 @@ +Some paragraph. +{:.class .-class id key="val"} + +Some paragraph. +{:.cls1#id.cls2} + +> quote +{: #id} + {: .class} + +* list +{: key="val"} + + code block +{: #other} + + other code block + +## A header +{:#myid} + +{:.cls} +Some paragraph here + +{:.cls1} +{:.cls2} +Some paragraph here + +Paragraph +{:.cls} +Paragraph + +Another header +============== +{: .class #other} + +{:id: #id key="valo"} +{:id: #other .myclass other} +{:other: key1="val\"" - ig.nored as_is#this key2='val\'' .other-class} + +{:.invalid} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/comment.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/comment.html new file mode 100644 index 00000000000..20b4c662c2b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/comment.html @@ -0,0 +1,8 @@ +

      This is a simple paragraph.

      + + + +

      And another paragraph

      + +

      {::comment} +Another paragraph

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/comment.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/comment.text new file mode 100644 index 00000000000..2dfc9197121 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/comment.text @@ -0,0 +1,12 @@ +This is a simple paragraph. + +{::comment} +This is a comment {:/}which is {:/comment} ignored. +{:/comment} + +And another paragraph + +{::comment this='is' .ignore /} + +{::comment} +Another paragraph diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/ignored.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/ignored.html new file mode 100644 index 00000000000..17aae5cd5ab --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/ignored.html @@ -0,0 +1,8 @@ +

      paragraph

      + +

      {::something} +anotherthing +{:/something}

      + +

      {::something/} +paragraph

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/ignored.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/ignored.text new file mode 100644 index 00000000000..ae94a8fe36b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/ignored.text @@ -0,0 +1,8 @@ +paragraph + +{::something} +anotherthing +{:/something} + +{::something/} +paragraph diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.html new file mode 100644 index 00000000000..7fe58d504a1 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.html @@ -0,0 +1,10 @@ +

      This is a simple paragraph.

      + +This *is* not processed + +

      And another paragraph

      + +bold + +

      {::nomarkdown} +Another paragraph

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.kramdown b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.kramdown new file mode 100644 index 00000000000..2cee5122600 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.kramdown @@ -0,0 +1,20 @@ +This is a simple paragraph. + +{::nomarkdown} +This *is* not processed +{:/} + +And another paragraph + +{::nomarkdown type="html"} +bold +{:/} + +{::nomarkdown type="latex"} +\begin{itemize} +\item[Yes] YESSSS! +\end{itemize} +{:/} + +\{::nomarkdown} Another paragraph + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.latex b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.latex new file mode 100644 index 00000000000..5af0263cdcf --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.latex @@ -0,0 +1,13 @@ +This is a simple paragraph. + +This *is* not processed + +And another paragraph + +\begin{itemize} +\item[Yes] YESSSS! +\end{itemize} + +\{::nomarkdown\} +Another paragraph + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.text new file mode 100644 index 00000000000..43d441dfce8 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/nomarkdown.text @@ -0,0 +1,21 @@ +This is a simple paragraph. + +{::nomarkdown} +This *is* not processed + {:/nomarkdown} + +And another paragraph + +{::nomarkdown this='is' .ignore /} + +{::nomarkdown type='html'} +bold +{:/} +{::nomarkdown type="latex"} +\begin{itemize} +\item[Yes] YESSSS! +\end{itemize} +{:/} + +{::nomarkdown} +Another paragraph diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options.html new file mode 100644 index 00000000000..d3567ecbe29 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options.html @@ -0,0 +1,21 @@ +

      No header id

      + +

      without header id

      + +
      +some *para* +
      + +
      +

      some para

      +
      + +

      Some text10.

      + +
      +
        +
      1. +

        Some text. 

        +
      2. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options.text new file mode 100644 index 00000000000..5991ab7b94f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options.text @@ -0,0 +1,21 @@ +# No header id + +{::options unusedvar="val" /} + +# without header id + +
      +some *para* +
      + +{::options parse_block_html="true" parse_span_html="true" /} + +
      +some *para* +
      + +{::options footnote_nr="10" /} + +Some text[^ab]. + +[^ab]: Some text. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options2.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options2.html new file mode 100644 index 00000000000..203d6eb00b7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options2.html @@ -0,0 +1,10 @@ + +

      Some text1.

      + +
      +
        +
      1. +

        Some text. 

        +
      2. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options2.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options2.text new file mode 100644 index 00000000000..78abfbeeaca --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options2.text @@ -0,0 +1,5 @@ +{::options footnote_nr="da10" /} + +Some text[^ab]. + +[^ab]: Some text. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options3.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options3.html new file mode 100644 index 00000000000..7434df6f06b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options3.html @@ -0,0 +1,7 @@ +
      x = Class.new + +
      + +
      x = Class.new + +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options3.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options3.text new file mode 100644 index 00000000000..e0ee87c5fd4 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/12_extension/options3.text @@ -0,0 +1,7 @@ + x = Class.new +{: .language-ruby} + +{::options coderay_wrap="span" coderay_line_numbers="" coderay_css="class" coderay_tab_width="4" /} + + x = Class.new +{: .language-ruby} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/auto_ids.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/auto_ids.html new file mode 100644 index 00000000000..398628ab606 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/auto_ids.html @@ -0,0 +1,15 @@ +
      +
      item
      +
      def
      +
      item2
      +
      def
      +
      + +
      +
      item
      +
      def
      +
      item2
      +
      def
      +
      item3
      +
      def
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/auto_ids.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/auto_ids.text new file mode 100644 index 00000000000..f1797a746fe --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/auto_ids.text @@ -0,0 +1,18 @@ +{:auto_ids} +item +: def + +item2 +: def + +^ + +{:auto_ids-prefix-} +item +: def + +item2 +: def + +{:#id} item3 +: def diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/definition_at_beginning.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/definition_at_beginning.html new file mode 100644 index 00000000000..7c5cc04831a --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/definition_at_beginning.html @@ -0,0 +1 @@ +

      : no definition

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/definition_at_beginning.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/definition_at_beginning.text new file mode 100644 index 00000000000..cd3671b9e4b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/definition_at_beginning.text @@ -0,0 +1 @@ +: no definition diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/deflist_ial.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/deflist_ial.html new file mode 100644 index 00000000000..3090b1ef137 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/deflist_ial.html @@ -0,0 +1,4 @@ +
      +
      item
      +
      definition
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/deflist_ial.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/deflist_ial.text new file mode 100644 index 00000000000..587c3b07bf3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/deflist_ial.text @@ -0,0 +1,4 @@ +{:.dl-horizontal} +item +: definition +{:.dl-other} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/item_ial.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/item_ial.html new file mode 100644 index 00000000000..0ed1197f8e6 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/item_ial.html @@ -0,0 +1,17 @@ +
      +
      item
      +
      definition +continued
      +
      another {:.cls}
      +
      +
      code
      +
      +
      +
      IAL at last + no code bc of text
      +
      term
      +
      definition
      +
      term1
      +
      term2
      +
      definition
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/item_ial.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/item_ial.text new file mode 100644 index 00000000000..2058d7497bc --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/item_ial.text @@ -0,0 +1,16 @@ +item +: {:.cls} definition + continued +: another {:.cls} +: {:.class} + code +: {:.cls} IAL at last + no code bc of text + + +{:.class} term +: definition + +{:.class1} term1 +{:.class2} term2 +: definition diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/multiple_terms.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/multiple_terms.html new file mode 100644 index 00000000000..e2e089b37de --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/multiple_terms.html @@ -0,0 +1,13 @@ +
      +
      kram
      +
      down
      +
      now
      +
      definition 1
      +
      definition 2
      +
      +

      definition 3

      +
      +
      +

      definition 4

      +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/multiple_terms.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/multiple_terms.text new file mode 100644 index 00000000000..b834258b7a0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/multiple_terms.text @@ -0,0 +1,10 @@ +kram +*down* +now +: definition 1 +: definition 2 + +: definition 3 + + +: definition 4 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/no_def_list.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/no_def_list.html new file mode 100644 index 00000000000..c16f9623810 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/no_def_list.html @@ -0,0 +1,2 @@ +

      This is a para +: and not a definition list

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/no_def_list.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/no_def_list.text new file mode 100644 index 00000000000..98b52b3744f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/no_def_list.text @@ -0,0 +1,2 @@ +This is a para +\: and not a definition list diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/para_wrapping.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/para_wrapping.html new file mode 100644 index 00000000000..5f28fdf8a2d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/para_wrapping.html @@ -0,0 +1,10 @@ +
      +
      term
      +
      +

      definition

      +
      +
      definition
      +
      +

      definition

      +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/para_wrapping.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/para_wrapping.text new file mode 100644 index 00000000000..280fa4746c2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/para_wrapping.text @@ -0,0 +1,6 @@ +term + +: definition +: definition + +: definition diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/separated_by_eob.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/separated_by_eob.html new file mode 100644 index 00000000000..0a1c4dc2b05 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/separated_by_eob.html @@ -0,0 +1,8 @@ +
      +
      kram
      +
      down
      +
      +
      +
      kram
      +
      down
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/separated_by_eob.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/separated_by_eob.text new file mode 100644 index 00000000000..56fedf16a6b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/separated_by_eob.text @@ -0,0 +1,5 @@ +kram +: down +^ +kram +: down diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/simple.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/simple.html new file mode 100644 index 00000000000..791f14515ac --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/simple.html @@ -0,0 +1,10 @@ +
      +
      kram
      +
      down
      +
      novalue
      +
      +
      kram
      +
      down +kram
      +
      down
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/simple.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/simple.text new file mode 100644 index 00000000000..e3bf730eb04 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/simple.text @@ -0,0 +1,10 @@ +kram +: down + +novalue +: + +kram +: down +kram +: down diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/styled_terms.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/styled_terms.html new file mode 100644 index 00000000000..cf7d7859a04 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/styled_terms.html @@ -0,0 +1,4 @@ +
      +
      kram
      +
      down
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/styled_terms.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/styled_terms.text new file mode 100644 index 00000000000..76eb3553f87 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/styled_terms.text @@ -0,0 +1,2 @@ +*kram* +: down diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/too_much_space.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/too_much_space.html new file mode 100644 index 00000000000..b4df8780770 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/too_much_space.html @@ -0,0 +1,3 @@ +

      para

      + +

      : no definition

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/too_much_space.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/too_much_space.text new file mode 100644 index 00000000000..30ab445c8a9 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/too_much_space.text @@ -0,0 +1,4 @@ +para + + +: no definition diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/with_blocks.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/with_blocks.html new file mode 100644 index 00000000000..45b58656ed4 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/with_blocks.html @@ -0,0 +1,38 @@ +
      +
      kram
      +
      this is some +text
      +
      +

      this is some +more text

      +
      +
      kram
      +
      +
      +

      blockquote

      +
      +
      +
      kram
      +
      +
      code
      +
      +
      +
      kram
      +
      +
      +
      kram
      +
      down
      +
      +
      +
      kram
      +
      +

      header

      +
      +
      kram
      +
      +
        +
      • list
      • +
      • items
      • +
      +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/with_blocks.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/with_blocks.text new file mode 100644 index 00000000000..15195ce3f39 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/13_definition_list/with_blocks.text @@ -0,0 +1,24 @@ +kram +: this is some + text + + : this is some + more text + +kram +: > blockquote + +kram +: + code + +kram +: kram + : down + +kram +: # header + +kram +: * list + * items diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/empty_tag_in_cell.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/empty_tag_in_cell.html new file mode 100644 index 00000000000..af9b3e5f5a1 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/empty_tag_in_cell.html @@ -0,0 +1,8 @@ + + + + + + + +
      first line of cell
      second line of cell
      another cell
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/empty_tag_in_cell.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/empty_tag_in_cell.options new file mode 100644 index 00000000000..63936b9955b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/empty_tag_in_cell.options @@ -0,0 +1 @@ +:html_to_native: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/empty_tag_in_cell.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/empty_tag_in_cell.text new file mode 100644 index 00000000000..60fec0b40a3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/empty_tag_in_cell.text @@ -0,0 +1 @@ +| first line of cell
      second line of cell | another cell | diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/errors.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/errors.html new file mode 100644 index 00000000000..302e97aedcd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/errors.html @@ -0,0 +1,12 @@ +

      No table body

      + +

      |-|-|-

      + +

      |no|table|here|

      + +

      |no|table|here| +paragraph

      + +

      |-|-| +|-|-|

      + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/errors.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/errors.text new file mode 100644 index 00000000000..3565d5b826b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/errors.text @@ -0,0 +1,13 @@ +No table body + +|-|-|- + +[5]: test +|no|table|here| + +|no|table|here| +paragraph + +|-|-| +|-|-| + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/escaping.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/escaping.html new file mode 100644 index 00000000000..b4528a17dc2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/escaping.html @@ -0,0 +1,52 @@ +

      cell 1 | cell 2

      + +

      cell 1 | cell 2

      + + + + + + + + +
      cell 1cell 2 | continued
      + + + + + + + + +
      cell 1cell 2
      + + + + + + + + +
      cell 1code | span
      + +

      cell 1 code | span

      + +

      cell 1 | code | span

      + + + + + + + + + + + + + + +
      cell 1cell `2cell 3
      cell 1`cell 2cell 3
      + +

      cell 1 | cell 2 | cell 3 +cell 1 | cell 2 | cell 3

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/escaping.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/escaping.text new file mode 100644 index 00000000000..a8a24d6a302 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/escaping.text @@ -0,0 +1,19 @@ +`cell 1 | cell 2` + +cell 1 \| cell 2 + +cell 1 | cell 2 \| continued + +cell 1 | cell `2` + +cell 1 | `code | span` + +cell 1 `code | span` + +cell 1 \| `code | span` + +cell 1 | cell `2 | cell 3 +cell 1` | cell 2 | cell 3 + +cell 1 \| cell `2 | cell 3 +cell 1` | cell 2 | cell 3 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/footer.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/footer.html new file mode 100644 index 00000000000..e6596ed5eb0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/footer.html @@ -0,0 +1,65 @@ +

      Simple footer

      + + + + + + + + + + + + + + +
      cell1cell2
      cell3cell4
      + +

      Full footer

      + + + + + + + + + + + + + + +
      cell1cell2
      cell3cell4
      + +

      Footer with separator lines

      + + + + + + + + + + + + + + + + + + +
      cell1cell2
      cell3cell4
      cell5cell6
      + +

      Empty footer

      + + + + + + + + +
      cell1cell2
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/footer.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/footer.text new file mode 100644 index 00000000000..faaed8d9fb5 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/footer.text @@ -0,0 +1,25 @@ +Simple footer + +| cell1 | cell2 +|= +| cell3 | cell4 + +Full footer + +| cell1 | cell2 +|=======|=======| +| cell3 | cell4 + +Footer with separator lines + +| cell1 | cell2 +|=======|=======| +| cell3 | cell4 +|--- +| cell5 | cell6 +|--- + +Empty footer + +| cell1 | cell2 +|= diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/header.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/header.html new file mode 100644 index 00000000000..647f2c48fb3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/header.html @@ -0,0 +1,117 @@ +

      Simple header

      + + + + + + + + + + + + + + +
      cell1cell2
      cell3cell4
      + +

      Full header

      + + + + + + + + + + + + + + +
      cell1cell2
      cell3cell4
      + +

      With alignment and superfluous alignment defs

      + + + + + + + + + + + + + + + + + + + + +
      defaultleftcenterrightdefault
      cell1cell2cell3cell4cell5
      + +

      With leading sep line

      + + + + + + + + + + + + + + +
      cell1cell2
      cell3cell4
      + +

      Multiple bodies

      + + + + + + + + + + + + + + + + + + + + +
      cell1cell2
      cell3cell4
      cell5cell6
      + +

      Sep line with tab

      + + + + + + + + + + + + + + + + + + +
      rightcenter
      cell1cell2
      cell3cell4
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/header.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/header.text new file mode 100644 index 00000000000..6961bfb9d9c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/header.text @@ -0,0 +1,39 @@ +Simple header + +| cell1 | cell2 +|----- +| cell3 | cell4 + +Full header + +| cell1 | cell2 +|-------|-------| +| cell3 | cell4 + +With alignment and superfluous alignment defs + +| default | left | center | right | default +|-| :- |:-: | -: | - | :-: | :- +| cell1 | cell2 | cell3 | cell4 | cell5 + +With leading sep line + +|:-:|-:| +| cell1 | cell2 +|-------|-------| +| cell3 | cell4 + +Multiple bodies + +| cell1 | cell2 ++ :-: | +| cell3 | cell4 +|----||| +| cell5 | cell6 + +Sep line with tab + +right | center +---: | :---: +cell1 | cell2 +cell3 | cell4 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/no_table.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/no_table.html new file mode 100644 index 00000000000..dce46b1d312 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/no_table.html @@ -0,0 +1,3 @@ +

      No table

      + +

      | Some | thing | here

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/no_table.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/no_table.text new file mode 100644 index 00000000000..90f90b3d9af --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/no_table.text @@ -0,0 +1,3 @@ +No table + +\| Some \| thing \| here diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/simple.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/simple.html new file mode 100644 index 00000000000..506b4421760 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/simple.html @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + +
      cell1cell2
      cell3cell4
      cell5cell6 |
      cell7cell8
      + +

      Missing cells at end

      + + + + + + + + + + + + + + + + + + + +
      cell1cell2cell3
      cell1  
       cell2cell3
      + +

      Escaped pipe characters

      + + + + + + + + + + + + + + + + +
      cell1 | cell1cell2
      cell1cell2 |
      cell1 | concell2
      + +

      Table with code elements

      + + + + + + + + + + + + + + + + +
      This is a span | with a pipe.   
      Some span</em> herea span | with apipe.
      + +

      Special cases regarding codespan syntax

      + + + + + + + + +
      ab
      + + + + + + + +
      a
      + + + + + + + + + +
      tablewithial
      + + + + + + + + + +
      tablewithial
      + +

      not starting with a bar

      + + + + + + + + +
      simpletable
      + + + + + + + + + + + + + + +
      head1head2
      cell1cell2
      + + + + + + + + + + + + + + +
      head1head2
       cell2
      + + + + + + + + + + + + + + + + +
      ab
      cd
      ef
      + + + + + + + + + + + + + + +
      KeyValue type
      Type"GROUP"|"UNKNOWN"
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/simple.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/simple.text new file mode 100644 index 00000000000..0f225a4ee18 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/simple.text @@ -0,0 +1,53 @@ +| cell1 | cell2 | +|cell3 | cell4| +|cell5|cell6 \| +| cell7|cell8 + +Missing cells at end + +| cell1 | cell2 | cell3 | +| cell1 || +|| cell2 | cell3 + +Escaped pipe characters + +| cell1 \| cell1 | cell2 | +| cell1 | cell2 \| +| cell1 `|` con | cell2 + +Table with code elements + +| This is a span | with a pipe. +| Some span | here | a span | with a | pipe. + +Special cases regarding codespan syntax + +|a|`b` + +|`a` + +{:.cls} +| table | with | ial + +| table | with | ial +{:.cls} + +not starting with a bar + +simple | table + +head1 | head2 +------|------ +cell1 | cell2 + + head1 | head2 +-------|------ + | cell2 + +| a | b | + c | d +| e | f | + +| Key | Value type | +|--------|------------------------| +| `Type` | `"GROUP"`\|`"UNKNOWN"` | diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/table_with_footnote.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/table_with_footnote.html new file mode 100644 index 00000000000..0bf6781760e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/table_with_footnote.html @@ -0,0 +1,25 @@ + + + + + + + + + + + +
      this is 1a table
      with afootnote
      + +
      +
        +
      1. +

        Something

        + +
        +

        special here

        +
        +

        +
      2. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/table_with_footnote.latex b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/table_with_footnote.latex new file mode 100644 index 00000000000..99b5312f333 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/table_with_footnote.latex @@ -0,0 +1,11 @@ +\begin{longtable}{|l|l|} +\hline +this is \footnote{Something + +\begin{quote} +special here +\end{quote}} & a table\\ +with a & footnote\\ +\hline +\end{longtable} + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/table_with_footnote.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/table_with_footnote.text new file mode 100644 index 00000000000..345fc5d3088 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/14_table/table_with_footnote.text @@ -0,0 +1,6 @@ +| this is [^1] | a table +| with a | footnote + +[^1]: Something + + > special here diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/gh_128.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/gh_128.html new file mode 100644 index 00000000000..ab27b4be13c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/gh_128.html @@ -0,0 +1,2 @@ + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/gh_128.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/gh_128.text new file mode 100644 index 00000000000..95252a76e4e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/gh_128.text @@ -0,0 +1 @@ +$$ $$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/itex2mml.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/itex2mml.html new file mode 100644 index 00000000000..214212a28e4 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/itex2mml.html @@ -0,0 +1 @@ +f(x)=ax 3+bx 2+cx+df(x) = a{x^3} + b{x^2} + cx + d diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/itex2mml.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/itex2mml.options new file mode 100644 index 00000000000..953bdae24be --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/itex2mml.options @@ -0,0 +1 @@ +:math_engine: itex2mml diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/itex2mml.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/itex2mml.text new file mode 100644 index 00000000000..23fe297bff8 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/itex2mml.text @@ -0,0 +1 @@ +$$f(x) = a{x^3} + b{x^2} + cx + d$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/katex.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/katex.html.19 new file mode 100644 index 00000000000..9e89673d7ad --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/katex.html.19 @@ -0,0 +1,2 @@ +Δ=12abcdefghi\Delta = \frac{1}{2} +\begin{vmatrix}a & b & c \\ d & e & f \\ g & h & i\end{vmatrix} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/katex.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/katex.options new file mode 100644 index 00000000000..108b2654a65 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/katex.options @@ -0,0 +1 @@ +:math_engine: :katex diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/katex.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/katex.text new file mode 100644 index 00000000000..2f184908e52 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/katex.text @@ -0,0 +1,2 @@ +$$\Delta = \frac{1}{2} +\begin{vmatrix}a & b & c \\ d & e & f \\ g & h & i\end{vmatrix}$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview.html new file mode 100644 index 00000000000..5ef3a830f21 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview.html @@ -0,0 +1,4 @@ +

      This is a 5 + 5 statement

      + +
      5 + 5
      + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview.options new file mode 100644 index 00000000000..75f702c41b9 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview.options @@ -0,0 +1,2 @@ +:math_engine_opts: + :preview: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview.text new file mode 100644 index 00000000000..7068767b08e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview.text @@ -0,0 +1,5 @@ +This is a $$5 + 5$$ statement + +$$ +5 + 5 +$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_as_code.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_as_code.html new file mode 100644 index 00000000000..1ee20d4f194 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_as_code.html @@ -0,0 +1,4 @@ +

      This is a 5 + 5 statement

      + +
      5 + 5
      + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_as_code.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_as_code.options new file mode 100644 index 00000000000..ab0bc547f71 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_as_code.options @@ -0,0 +1,3 @@ +:math_engine_opts: + :preview: true + :preview_as_code: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_as_code.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_as_code.text new file mode 100644 index 00000000000..7068767b08e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_as_code.text @@ -0,0 +1,5 @@ +This is a $$5 + 5$$ statement + +$$ +5 + 5 +$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_simple.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_simple.html new file mode 100644 index 00000000000..623d2862056 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_simple.html @@ -0,0 +1,4 @@ +

      This is a math statement

      + +
      math
      + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_simple.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_simple.options new file mode 100644 index 00000000000..28a68b50af2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_simple.options @@ -0,0 +1,2 @@ +:math_engine_opts: + :preview: 'math' diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_simple.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_simple.text new file mode 100644 index 00000000000..7068767b08e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjax_preview_simple.text @@ -0,0 +1,5 @@ +This is a $$5 + 5$$ statement + +$$ +5 + 5 +$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode.html.19 new file mode 100644 index 00000000000..713f9bcb5bb --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode.html.19 @@ -0,0 +1,27 @@ + + f + ( + x + ) + = + a + + + x + 3 + + + + + b + + + x + 2 + + + + + c + x + + + d + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode.options new file mode 100644 index 00000000000..adc27e8aa11 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode.options @@ -0,0 +1 @@ +:math_engine: mathjaxnode diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode.text new file mode 100644 index 00000000000..23fe297bff8 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode.text @@ -0,0 +1 @@ +$$f(x) = a{x^3} + b{x^2} + cx + d$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_notexhints.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_notexhints.html.19 new file mode 100644 index 00000000000..234f23ea15a --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_notexhints.html.19 @@ -0,0 +1,23 @@ + + f + ( + x + ) + = + a + + x + 3 + + + + b + + x + 2 + + + + c + x + + + d + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_notexhints.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_notexhints.options new file mode 100644 index 00000000000..827e4627953 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_notexhints.options @@ -0,0 +1,3 @@ +:math_engine: mathjaxnode +:math_engine_opts: + :texhints: false diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_notexhints.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_notexhints.text new file mode 100644 index 00000000000..23fe297bff8 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_notexhints.text @@ -0,0 +1 @@ +$$f(x) = a{x^3} + b{x^2} + cx + d$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_semantics.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_semantics.html.19 new file mode 100644 index 00000000000..d85fddf8c0c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_semantics.html.19 @@ -0,0 +1,32 @@ + + + + f + ( + x + ) + = + a + + + x + 3 + + + + + b + + + x + 2 + + + + + c + x + + + d + + f(x) = a{x^3} + b{x^2} + cx + d + + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_semantics.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_semantics.options new file mode 100644 index 00000000000..1f645b1629e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_semantics.options @@ -0,0 +1,3 @@ +:math_engine: mathjaxnode +:math_engine_opts: + :semantics: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_semantics.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_semantics.text new file mode 100644 index 00000000000..23fe297bff8 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/mathjaxnode_semantics.text @@ -0,0 +1 @@ +$$f(x) = a{x^3} + b{x^2} + cx + d$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/no_engine.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/no_engine.html new file mode 100644 index 00000000000..5d6b343e812 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/no_engine.html @@ -0,0 +1,3 @@ +
      $$ +5+5 +$$
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/no_engine.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/no_engine.options new file mode 100644 index 00000000000..06d559e5459 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/no_engine.options @@ -0,0 +1 @@ +:math_engine: ~ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/no_engine.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/no_engine.text new file mode 100644 index 00000000000..fdee5cfbea5 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/no_engine.text @@ -0,0 +1,2 @@ +{: #math-id} +$$5+5$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/normal.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/normal.html new file mode 100644 index 00000000000..3000a86b65e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/normal.html @@ -0,0 +1,29 @@ +

      This is a para. +

      + + + +

      +This is a para.

      + + + + + + + + + + + +
      $$5+5$$
      +
      + + + + + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/normal.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/normal.text new file mode 100644 index 00000000000..aa5984a2c92 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/normal.text @@ -0,0 +1,30 @@ +This is a para. +$$ \text{LaTeX} \lambda_5 $$ + +$$\lambda_5 = \alpha + 4$$ + +$$\lambda_\alpha > 5$$ +This is a para. + +$$\begin{align*} +&=5 \\ +&=6 \\ +\end{align*}$$ + +$$5+5$$ + + $$5+5$$ + + $$5+5$$ + + $$5+5$$ + + $$5+5$$ + +{:.cls} +$$5+5$$ +^ +$$5+5$$ +{:.cls} + +$$|x| = 5$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/ritex.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/ritex.html new file mode 100644 index 00000000000..e9d61b5388e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/ritex.html @@ -0,0 +1 @@ +f(x)=ax3+bx2+cx+d diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/ritex.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/ritex.options new file mode 100644 index 00000000000..0ef54eb92a5 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/ritex.options @@ -0,0 +1 @@ +:math_engine: ritex diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/ritex.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/ritex.text new file mode 100644 index 00000000000..23fe297bff8 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/ritex.text @@ -0,0 +1 @@ +$$f(x) = a{x^3} + b{x^2} + cx + d$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/sskatex.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/sskatex.html.19 new file mode 100644 index 00000000000..f1623a1f180 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/sskatex.html.19 @@ -0,0 +1,2 @@ +Δ=12abcdefghi\Delta = \frac{1}{2} +\begin{vmatrix}a & b & c \\ d & e & f \\ g & h & i\end{vmatrix} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/sskatex.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/sskatex.options new file mode 100644 index 00000000000..214a301b971 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/sskatex.options @@ -0,0 +1 @@ +:math_engine: sskatex diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/sskatex.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/sskatex.text new file mode 100644 index 00000000000..2f184908e52 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/15_math/sskatex.text @@ -0,0 +1,2 @@ +$$\Delta = \frac{1}{2} +\begin{vmatrix}a & b & c \\ d & e & f \\ g & h & i\end{vmatrix}$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/no_toc.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/no_toc.html new file mode 100644 index 00000000000..bbb831e93b6 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/no_toc.html @@ -0,0 +1,14 @@ + +

      Header level 1

      + +

      Header level 2

      + +

      Header level 3

      + +

      Header level 4

      + +

      Other header level 1

      + +

      Other header level 2

      + +

      Other header level 3

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/no_toc.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/no_toc.text new file mode 100644 index 00000000000..11ad82916c6 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/no_toc.text @@ -0,0 +1,16 @@ +* Here comes the table of content +{:toc} + +# Header level 1 + +## Header level 2 + +### Header level 3 + +#### Header level 4 + +# Other header level 1 + +## Other header level 2 + +### Other header level 3 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_exclude.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_exclude.html new file mode 100644 index 00000000000..d35268469d3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_exclude.html @@ -0,0 +1,35 @@ +

      Contents

      + + + +

      Header level 1

      + +

      Header level 2

      + +

      Header level 3

      + +

      Header level 4

      + +

      Other header level 1

      + +

      Other header level 2

      + +

      Other header level 3

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_exclude.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_exclude.options new file mode 100644 index 00000000000..8776b5524df --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_exclude.options @@ -0,0 +1 @@ +:auto_ids: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_exclude.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_exclude.text new file mode 100644 index 00000000000..d8f0b863fd3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_exclude.text @@ -0,0 +1,19 @@ +# Contents +{:.no_toc} + +* Here comes the table of content +{:toc} + +# Header level 1 + +## Header level 2 + +### Header level 3 + +#### Header level 4 + +# Other header level 1 + +## Other header level 2 + +### Other header level 3 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_levels.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_levels.html new file mode 100644 index 00000000000..e50a07c4d5b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_levels.html @@ -0,0 +1,24 @@ + + +

      Header level 1

      + +

      Header \` level 2

      + +

      Header level 3

      + +

      Header level 4

      + +

      Other header level 1

      + +

      Other header level 2

      + +

      Other header level 3

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_levels.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_levels.options new file mode 100644 index 00000000000..bdfbeba1ac2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_levels.options @@ -0,0 +1,2 @@ +:toc_levels: 2..3 +:auto_ids: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_levels.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_levels.text new file mode 100644 index 00000000000..1a62dea2f66 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_levels.text @@ -0,0 +1,16 @@ +* Here comes the table of content +{:toc} + +# Header level 1 + +## Header \\\` level 2 + +### Header level 3 + +#### Header level 4 + +# Other header level 1 + +## Other header level 2 + +### Other header level 3 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_footnotes.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_footnotes.html new file mode 100644 index 00000000000..a395a02ba2e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_footnotes.html @@ -0,0 +1,13 @@ + + +

      Header1 level 1

      + +
      +
        +
      1. +

        Some footnote content here 

        +
      2. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_footnotes.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_footnotes.options new file mode 100644 index 00000000000..8776b5524df --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_footnotes.options @@ -0,0 +1 @@ +:auto_ids: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_footnotes.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_footnotes.text new file mode 100644 index 00000000000..5879ed57613 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_footnotes.text @@ -0,0 +1,6 @@ +* Here comes the table of content +{:toc} + +# Header[^1] level 1 + +[^1]: Some footnote content here diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_links.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_links.html new file mode 100644 index 00000000000..ebde543b721 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_links.html @@ -0,0 +1,8 @@ +

      Header

      + +

      Header

      + + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_links.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_links.options new file mode 100644 index 00000000000..36c20f5ad28 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_links.options @@ -0,0 +1,2 @@ +:auto_ids: true +:auto_id_stripping: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_links.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_links.text new file mode 100644 index 00000000000..9b4ac0739bc --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/block/16_toc/toc_with_links.text @@ -0,0 +1,8 @@ +# [Header] + +# [Header] + +[header]: test.html + +* toc +{:toc} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/encoding.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/encoding.html new file mode 100644 index 00000000000..0339347f2f8 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/encoding.html @@ -0,0 +1,46 @@ +

      Das ist gewöhnlich ein Über-Problem mit manchen
      +Sälen http://example.org und anderen Dinge. Siehe +Über mich!

      + +
      +

      Vielleicht höre ich nicht richtig?

      +
      + +
        +
      • Sollten wir uns das überlegen? Verhöhne mich nicht!
      • +
      • Ho ho höher! Sind *wir* da?
      • +
      + +

      Titel sind urschön

      + +

      Manche mögens ärmer

      + +
      öha
      +was nun?
      +
      + +
      +
      Töne
      +
      Laute Geräusche
      +
      vielleicht noch was ähnliches
      +
      + + + + + + + + + + + + + + + + +
      hochhöheram höchsten
      überdrübermüde
      + +

      Das ist schön +gemacht

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/encoding.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/encoding.text new file mode 100644 index 00000000000..65edf4b02df --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/encoding.text @@ -0,0 +1,28 @@ +Das ist gewöhnlich *ein* [Über-Problem](http://example.org) mit manchen +Sälen und anderen Dinge. Siehe +![Über mich](http://example.org)! + +> Vielleicht *höre*{:.red} ich nicht richtig? +{:.test} + +* Sollten wir uns das überl*egen*? *Verhöhne* mich nicht! +* Ho ho höher! Sind \*wir\* da? + +Titel sind urschön +================== + +## Manche mögens *ärmer* {#hot} + + öha + was nun? + +Töne +: Laute Geräusche +: vielleicht noch was ä*hnliches* + +| hoch | höher | am höchsten | +|----------------------------| +| über | drüber | müde | + +

      Das ist schön +gemacht

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/example.man b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/example.man new file mode 100644 index 00000000000..b1afee78456 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/example.man @@ -0,0 +1,123 @@ +.\" generated by kramdown +.TH "NAME" "1" "November 2016" "Some extra data" +.SH NAME +name \- description +.SH "SYNOPSIS" +\fBname\fP [\fBOPTIONS\fP] \fIarguments\fP\.\.\. +.SH "DESCRIPTION" +This is a normal paragraph\. +.sp +.PD 0 +.IP \(bu 4 +A +.IP \(bu 4 +compact +.IP \(bu 4 +list +.IP \(bu 4 +with multiple +.RS +.IP \(bu 4 +items and +.RS +.IP \(bu 4 +nested +.RE +.RE +.IP \(bu 4 +as well +.PD +.RS +.P +blockquotes are fine +.IP 1. 4 +numbered lists +.IP 2. 4 +work too +.RS +.IP 1. 4 +and they +.IP 2. 4 +can be +.RS +.IP 1. 4 +nested +.RE +.RE +.IP 3. 4 +again +.RE +.sp +.RS 4 +.EX +Some fancy code + going + on + here +.EE +.RE +.TP +\fB\-o\fP +.TQ +\fB\-\-option\fP +Description lists +.sp +are useful as well +.P +And compact definition lists: +.sp +.PD 0 +.TP +\fBo\fP +Option +.TP +\fBk\fP +Key +.TP +\fBv\fP +Value +.PD +.TS +box center ; +l l l l . +tables can be centered +.TE +.sp +.TS +box ; +lb lb cb rb . +Default aligned Left aligned Center aligned Right aligned += +.T& +l l c r . +First body part Second cell Third cell fourth cell +Second \fIline\fP foo \fBstrong\fP baz +Third line \fBquux\fP baz bar +_ +.T& +l l c r . +Second body +2nd line += +Footer row one +Footer row two +.TE +.sp +.P +Inline formatting like \fIemphasis\fP, \fBstrong\fP and \fBcode span\fP work as ususal\. +.UR are_well\.html +Links +.UE +work, too! As do +.br +line breaks\. +.P +Abbreviations like MD can be used but the abbreviation title is ignored\. +.P +Math elements work \fB\el = 5\fP inline and in block form: +.sp +.RS 4 +.EX +\elambda_5 = \ealpha + 4 +.EE +.RE diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/example.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/example.text new file mode 100644 index 00000000000..12b011bb01d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/example.text @@ -0,0 +1,85 @@ +# name(1) - description +{: data-date="November 2016" data-extra="Some extra data"} + +## SYNOPSIS + +`name` \[`OPTIONS`\] *arguments*... + +## DESCRIPTION + +This is a normal paragraph. + +* A +* compact +* list +* with multiple + * items and + * nested +* as well +{:.compact} + +> blockquotes are fine +> +> 1. numbered lists +> +> 2. work too +> 1. and they +> 2. can be +> 1. nested +> +> 3. again + +~~~ +Some fancy code + going + on + here +~~~ + +`-o` +`--option` +: Description lists +: are useful as well + +And compact definition lists: + +`o` +: Option + +`k` +: Key + +`v` +: Value +{:.compact} + +| tables | can | be | centered | +{:.center} + +|-----------------+------------+-----------------+----------------| +| Default aligned |Left aligned| Center aligned | Right aligned | +|-----------------|:-----------|:---------------:|---------------:| +| First body part |Second cell | Third cell | fourth cell | +| Second *line* |foo | **strong** | baz | +| Third line |`quux` | baz | bar | +|-----------------+------------+-----------------+----------------| +| Second body | | | | +| 2nd line | | | | +|=================+============+=================+================| +| Footer row one | | | | +| Footer row two | | | | +|-----------------+------------+-----------------+----------------| + + +Inline formatting like *emphasis*, **strong** and `code span` work +as ususal. [Links](are_well.html) work, too! As do\\ +line breaks. + +Abbreviations like MD can be used but the abbreviation title is +ignored. + +*[MD]: Markdown + +Math elements work $$\l = 5$$ inline and in block form: + +$$\lambda_5 = \alpha + 4$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-dash-description.man b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-dash-description.man new file mode 100644 index 00000000000..8e47527e1b0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-dash-description.man @@ -0,0 +1,4 @@ +.\" generated by kramdown +.TH "NAME" "7" +.SH NAME +name \- description diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-dash-description.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-dash-description.text new file mode 100644 index 00000000000..832c92139d1 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-dash-description.text @@ -0,0 +1 @@ +# name -- description diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-description.man b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-description.man new file mode 100644 index 00000000000..e59dc5ecea7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-description.man @@ -0,0 +1,4 @@ +.\" generated by kramdown +.TH "NAME" "1" "November 2016" "Something extra" +.SH NAME +name \- description diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-description.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-description.text new file mode 100644 index 00000000000..941482c1173 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-description.text @@ -0,0 +1,2 @@ +# name description +{: data-section="1" data-date="November 2016" data-extra="Something extra"} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section-description.man b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section-description.man new file mode 100644 index 00000000000..8df4ff71162 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section-description.man @@ -0,0 +1,4 @@ +.\" generated by kramdown +.TH "NAME" "1" +.SH NAME +name \- description diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section-description.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section-description.text new file mode 100644 index 00000000000..5f3e765b145 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section-description.text @@ -0,0 +1 @@ +# name(1) -- description diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section.man b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section.man new file mode 100644 index 00000000000..7ca87574057 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section.man @@ -0,0 +1,2 @@ +.\" generated by kramdown +.TH "NAME" "1" diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section.text new file mode 100644 index 00000000000..da98dbdacb6 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name-section.text @@ -0,0 +1 @@ +# name(1) diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name.man b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name.man new file mode 100644 index 00000000000..8488496fd06 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name.man @@ -0,0 +1,2 @@ +.\" generated by kramdown +.TH "NAME" "7" diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name.text new file mode 100644 index 00000000000..5f4656ae181 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/heading-name.text @@ -0,0 +1 @@ +# name diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/sections.man b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/sections.man new file mode 100644 index 00000000000..14ab2336fb6 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/sections.man @@ -0,0 +1,4 @@ +.\" generated by kramdown +.SH "NAME" +works +.SS "Sub section" diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/sections.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/sections.text new file mode 100644 index 00000000000..d1f5f86426d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/sections.text @@ -0,0 +1,11 @@ +## NAME + +works + +### Sub section + +#### Ignored + +##### Ignored + +###### Ignored diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/text-escaping.man b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/text-escaping.man new file mode 100644 index 00000000000..710a4f14c18 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/text-escaping.man @@ -0,0 +1,8 @@ +.\" generated by kramdown +\&\. at the start of the line +.P +line with \efB backslash symbol +.P +some \. other \- escaped \' symbols +.P +\&\. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/text-escaping.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/text-escaping.text new file mode 100644 index 00000000000..052b94f5c66 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/man/text-escaping.text @@ -0,0 +1,7 @@ +. at the start of the line + +line with \fB backslash symbol + +some . other - escaped \' symbols + +. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty.html new file mode 100644 index 00000000000..a1102eadbb1 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty.html @@ -0,0 +1,5 @@ +

      This is [] empty.

      + +

      This is [][] empty.

      + +

      This is empty.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty.text new file mode 100644 index 00000000000..cca5de5f642 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty.text @@ -0,0 +1,5 @@ +This is [] empty. + +This is [][] empty. + +This is [](test.html) empty. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty_title.htmlinput b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty_title.htmlinput new file mode 100644 index 00000000000..b95b2cc7a00 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty_title.htmlinput @@ -0,0 +1,3 @@ +

      Image with empty title: alt text

      + +

      Link reference with empty title.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty_title.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty_title.text new file mode 100644 index 00000000000..baabe7da191 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/empty_title.text @@ -0,0 +1,7 @@ +Image with empty title: ![alt text](/images/other.png) + +Link [reference][1] with empty title. + + + +[1]: http://example.tld diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/image_in_a.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/image_in_a.html new file mode 100644 index 00000000000..e1f4ade52d1 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/image_in_a.html @@ -0,0 +1,5 @@ +

      Simple: Some alt text

      + +

      Nested: Some alt ![img](text.png) text

      + +

      Simple: Some text alt text text

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/image_in_a.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/image_in_a.text new file mode 100644 index 00000000000..bdbfb65ee15 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/image_in_a.text @@ -0,0 +1,5 @@ +Simple: [Some ![alt text](/images/other.png)](local.html) + +Nested: [Some ![alt ![img](text.png) text](/images/other.png)](local.html) + +Simple: [Some *text ![alt text](/images/other.png) text*](local.html) diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/imagelinks.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/imagelinks.html new file mode 100644 index 00000000000..565d36f70ab --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/imagelinks.html @@ -0,0 +1,15 @@ +

      Simple: alt text

      + +

      Simple with title: alt text

      + +

      Empty img link: alt text

      + +

      Reference style: alt text

      + +

      Reference style with title: alt text

      + +

      No alt text:

      + +

      No id: imgo

      + +

      With escaped pipe: an | pipe

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/imagelinks.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/imagelinks.text new file mode 100644 index 00000000000..05050a24be3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/imagelinks.text @@ -0,0 +1,18 @@ +Simple: ![alt text](/images/other.png) + +Simple with title: ![alt text](/images/other.png "title") + +Empty img link: ![alt text]() + +Reference style: ![alt text][img] + +Reference style with title: ![alt text][imgo] + +No alt text: ![](other.png) + +No id: ![imgo] + +[img]: other.png +[imgo]: other.png "Title" + +With escaped pipe: ![an \| pipe](other.png) diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/inline.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/inline.html new file mode 100644 index 00000000000..0810bc76fd3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/inline.html @@ -0,0 +1,46 @@ +

      simple URL

      + +

      simple URL

      + +

      simple URL with formatting

      + +

      simple URL with single quoted title

      + +

      simple URL with double quoted title

      + +

      simple URL [with ] escaped

      + +

      simple URL with ] escaped

      + +

      simple URL [with] nested

      + +

      simple URL with [no](link.html) inside

      + +

      simple URL with parens

      + +

      simple URL with parens

      + +

      simple URL broken +on line

      + +

      simple URL with spaces

      + +

      simple URL with spaces

      + +

      simple URL with spaces

      + +

      simple leading/trailing spaces

      + +

      simple leading/trailing spaces

      + +

      simple leading/trailing spaces

      + +

      bad [URL not

      + +

      bad [URL with parens](something(new.html)

      + +

      bad [URL with empty title](something.html ‘’)

      + +

      bad [URL](

      + +

      bad [URL](no

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/inline.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/inline.html.19 new file mode 100644 index 00000000000..8d00efa9efd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/inline.html.19 @@ -0,0 +1,46 @@ +

      simple URL

      + +

      simple URL

      + +

      simple URL with formatting

      + +

      simple URL with single quoted title

      + +

      simple URL with double quoted title

      + +

      simple URL [with ] escaped

      + +

      simple URL with ] escaped

      + +

      simple URL [with] nested

      + +

      simple URL with [no](link.html) inside

      + +

      simple URL with parens

      + +

      simple URL with parens

      + +

      simple URL broken +on line

      + +

      simple URL with spaces

      + +

      simple URL with spaces

      + +

      simple URL with spaces

      + +

      simple leading/trailing spaces

      + +

      simple leading/trailing spaces

      + +

      simple leading/trailing spaces

      + +

      bad [URL not

      + +

      bad [URL with parens](something(new.html)

      + +

      bad [URL with empty title](something.html ‘’)

      + +

      bad [URL](

      + +

      bad [URL](no

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/inline.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/inline.text new file mode 100644 index 00000000000..c70576466ec --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/inline.text @@ -0,0 +1,48 @@ +simple [URL]() + +simple [URL](something.html) + +simple [URL *with* formatting](something.html) + +simple [URL with single quoted title](something.html 'a t"itle') + +simple [URL with double quoted title](something.html "a t'itle") + +simple [URL \[with \] escaped](something.html) + +simple [URL with \] escaped](something.html) + +simple [URL [with] nested](something.html) + +simple [URL with [no](link.html) inside](something.html) + +simple [URL with parens](/something/to(do)) + +simple [URL with parens](/something/to(do "doit") + +simple [URL broken +on line](something.html +"title") + +simple [URL with spaces](with spaces.html) + +simple [URL with spaces](with spaces.html 'title') + +simple [URL with spaces](with (spaces).html) + +simple [leading/trailing spaces]( spaces.html) + +simple [leading/trailing spaces](spaces.html ) + +simple [leading/trailing spaces]( spaces.html ) + + +bad [URL [not](something.html) + +bad [URL with parens](something(new.html) + +bad [URL with empty title](something.html '') + +bad [URL]( + +bad [URL](no diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/latex_escaping.latex b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/latex_escaping.latex new file mode 100644 index 00000000000..63e58e74eef --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/latex_escaping.latex @@ -0,0 +1,6 @@ +\href{https://example.com/~tilde/}{https://example.com/\ensuremath{\sim}tilde/} + +\href{http://example.com/percent\%20percent}{http://example.com/percent\%20percent} + +\href{http://example.com/hash#hash}{http://example.com/hash\#hash} + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/latex_escaping.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/latex_escaping.text new file mode 100644 index 00000000000..9b27ae86b69 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/latex_escaping.text @@ -0,0 +1,5 @@ + + + + + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs.html new file mode 100644 index 00000000000..15e2ca71a31 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs.html @@ -0,0 +1,9 @@ +

      This is a para. +[id]: http://www.example.com/

      + +
      [4]: nourl
      +
      + +

      Points to 1 and 2 and 3 but not [4]

      + +

      Points to _.:,;!?- and otherid8

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs.text new file mode 100644 index 00000000000..16a25b5b9ac --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs.text @@ -0,0 +1,27 @@ +This is a para. +[id]: http://www.example.com/ + +[otherid1]: http://wwww.example.com/ "title 1" +[otherid2]: http://wwww.example.com/ 'title 2' +[otherid3]: +[otherid4]: 'title' +[otherid5]: some spaces.html +[otherid6]: some spaces.html 'title' +[otherid7]: some spaces + "title" +[otherid8]:test.html#'test' 'title' + +[break]: http://www.example.com/test/asdf.html + 'Another title' + +[1]: ignored.url + [1]: one.url + [2]: two.url + [3]: three.url + [4]: nourl + +Points to [1] and [2] and [3] but not [4] + +[_.:,;!?-]: http://example.com + +Points to [_.:,;!?-] and [otherid8] diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs_with_ial.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs_with_ial.html new file mode 100644 index 00000000000..f56d77ded6b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs_with_ial.html @@ -0,0 +1,4 @@ +

      Link def with attr and attr 2 and attr 3 and attr before

      + +

      test

      + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs_with_ial.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs_with_ial.text new file mode 100644 index 00000000000..59398a3ab74 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/link_defs_with_ial.text @@ -0,0 +1,16 @@ +Link def with [attr] and [attr 2] and [attr 3] and [attr before] + +[attr]: http://example.com 'title' +{: hreflang="en" .test} + +[attr 2]: http://example.com 'title' +{: hreflang="en"} +{: .test} + +[attr 3]: http://example.com +{: .test} +test + +{: hreflang="en"} +{: .test} +[attr before]: http://example.com diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/links_with_angle_brackets.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/links_with_angle_brackets.html new file mode 100644 index 00000000000..ecaa31e562b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/links_with_angle_brackets.html @@ -0,0 +1,3 @@ +

      This is a link.

      + +

      This is a link.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/links_with_angle_brackets.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/links_with_angle_brackets.text new file mode 100644 index 00000000000..2cf0ececeb9 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/links_with_angle_brackets.text @@ -0,0 +1,3 @@ +This is a [link](). + +This is a [link]( 'and title'). diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.html new file mode 100644 index 00000000000..49afd2eec78 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.html @@ -0,0 +1,37 @@ + +

      simple URL and URL

      + +

      simple URL and URL

      + +

      simple 1 and isurl

      + +

      simple 1 and isurl

      + +

      this is [a holy isurl]

      + +

      no [resolution][] here and [here]

      + +

      with a break in +the text

      + +

      this not [isurl] and not [isurl]

      + +

      a Link with_BIG letters

      + +

      bad [no URL] d isurl

      + +

      [no url] invalid.html +[no url]:

      + +

      “title”

      + +

      test url but no title +test [urldef]

      + +

      [urldef]: some.url ‘title”

      + +

      some with spaces

      + +

      this is a ‘special’ occasion for /all/ of us

      + +

      this is predefined for URI

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.html.19 new file mode 100644 index 00000000000..f6fed181eb7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.html.19 @@ -0,0 +1,37 @@ + +

      simple URL and URL

      + +

      simple URL and URL

      + +

      simple 1 and isurl

      + +

      simple 1 and isurl

      + +

      this is [a holy isurl]

      + +

      no [resolution][] here and [here]

      + +

      with a break in +the text

      + +

      this not [isurl] and not [isurl]

      + +

      a Link with_BIG letters

      + +

      bad [no URL] d isurl

      + +

      [no url] invalid.html +[no url]:

      + +

      “title”

      + +

      test url but no title +test [urldef]

      + +

      [urldef]: some.url ‘title”

      + +

      some with spaces

      + +

      this is a ‘special’ occasion for /all/ of us

      + +

      this is predefined for URI

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.options new file mode 100644 index 00000000000..efb4b0184ca --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.options @@ -0,0 +1,3 @@ +:link_defs: + predefined: [predefined.html] + URI: [uri.html, My URI] diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.text new file mode 100644 index 00000000000..9f39fa70ea4 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/01_link/reference.text @@ -0,0 +1,53 @@ +[isurl]: someurl.html + [1]: otherurl.html + +simple [URL][1] and [URL][isurl] + +simple [URL] [1] and [URL] +[isurl] + +simple [1][] and [isurl][] + +simple [1] and [isurl] + +this is [a holy [isurl]] + +no [resolution][] here and [here] + +with a [break in +the text] + + [break in the text]: url.html + +this not \[isurl] and not [isurl\] + +a [Link with_BIG] letters + + [link WITH_big]: letters.html + 'This is the title' + +bad [no URL] d [isurl] + +[no url] invalid.html +[no url]: + +[URL but no title]: invalid.html + + "title" + +test [url but no title] +test [urldef] + +[urldef]: some.url 'title" + + +some [with spaces] + +[with spaces]: with spaces.html "title" + +this [is a 'special' occasion for /all/ of us] + +[is a 'special' occasion for /all/ of us]: occasion.html + + +this is [predefined] for [URI] diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/empty.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/empty.html new file mode 100644 index 00000000000..127e69437a5 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/empty.html @@ -0,0 +1,3 @@ +

      This __is **empty.

      + +

      This **is empty.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/empty.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/empty.text new file mode 100644 index 00000000000..c99d053f42c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/empty.text @@ -0,0 +1,3 @@ +This __is **empty. + +This ****is empty. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/errors.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/errors.html new file mode 100644 index 00000000000..e62f03fd1c2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/errors.html @@ -0,0 +1,9 @@ +

      This is a *star.

      + +

      This is a **star.

      + +

      This is *a *star.

      + +

      This is *a star*.

      + +

      This** is** a star.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/errors.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/errors.text new file mode 100644 index 00000000000..e80e5eb477d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/errors.text @@ -0,0 +1,9 @@ +This is a *star. + +This is a **star. + +This is **a *star*. + +This is *a star\*. + +This** is** a star. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/nesting.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/nesting.html new file mode 100644 index 00000000000..3d34cee1680 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/nesting.html @@ -0,0 +1,41 @@ +
        +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      • test test
      • +
      +
        +
      • ab
      • +
      • ab
      • +
      • abc
      • +
      • ab
      • +
      • ab
      • +
      • abc
      • +
      +
        +
      • _a_b
      • +
      • a_b_
      • +
      • a_b_c
      • +
      • __a__b
      • +
      • a__b__
      • +
      • a__b__c
      • +
      • a__2__c
      • +
      • a__2__3
      • +
      • 1__2__3
      • +
      +
        +
      • a _b_ c
      • +
      • a __b__ c
      • +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/nesting.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/nesting.text new file mode 100644 index 00000000000..ba67e84b71b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/nesting.text @@ -0,0 +1,36 @@ +- ***test test*** +- ___test test___ +- *test **test*** +- **test *test*** +- ***test* test** +- ***test** test* +- ***test* test** +- **test *test*** +- *test **test*** +- _test __test___ +- __test _test___ +- ___test_ test__ +- ___test__ test_ +- ___test_ test__ +- __test _test___ +- _test __test___ +^ +- *a*b +- a*b* +- a*b*c +- **a**b +- a**b** +- a**b**c +^ +- _a_b +- a_b_ +- a_b_c +- __a__b +- a__b__ +- a__b__c +- a__2__c +- a__2__3 +- 1__2__3 +^ +- *a _b_ c* +- **a __b__ c** diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/normal.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/normal.html new file mode 100644 index 00000000000..ca53cfe0fef --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/normal.html @@ -0,0 +1,61 @@ +

      This is so hard.

      + +

      This is so hard too.

      + +

      At start +At start

      + +

      At end +At end

      + +

      At start +At start

      + +

      At end +At end

      + +

      And nested.

      + +

      And nest**ed.

      + +

      And *nested* like this.

      + +

      And not_nest_ed.

      + +

      And nested.

      + +

      And nested.

      + +

      And neste.

      + +

      And lonely * here*.

      + +

      And lonely ** here**.

      + +

      And lonely ** here.

      + +

      ** and here**.

      + +

      And compli*cated * here

      + +

      Some**what more * **here

      + +

      Do it *this* way +Or this *this* way +Or that *that* way +Or that *that* way

      + +

      http://blah.com/blah_%28

      + +

      A-_B

      + +
        +
      • test
      • +
      • test
      • +
      • test
      • +
      • (“test”)
      • +
      • (test)
      • +
      • test
      • +
      • `test
      • +
      • test
      • +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/normal.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/normal.options new file mode 100644 index 00000000000..2e6e0a12061 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/normal.options @@ -0,0 +1 @@ +:entity_output: :numeric diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/normal.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/normal.text new file mode 100644 index 00000000000..ab3091384ba --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/02_emphasis/normal.text @@ -0,0 +1,59 @@ +This *is* so **hard**. + +This _is_ so __hard__ too. + +*At* start +*At* start + +At *end* +At *end* + +_At_ start +_At_ start + +At _end_ +At _end_ + +And *nest**ed***. + +And *nest**ed*. + +And *nest**ed* like** this. + +And *not_nest_ed*. + +And ***nested***. + +And ___nested___. + +And **nest*e***. + +And lonely * here*. + +And lonely ** here**. + +And **lonely ** here**. + +** and here**. + +And **compli*cated \*** here + +Some***what* more * ***he*re + +Do it *\*this\** way +Or this \**this*\* way +Or that *\*that*\* way +Or that \**that\** way + +[http://blah.com/blah_%28](http://blah.com/blah_%28) + +[A-_B](A_-B) + +- _test_ +- '_test_' +- "_test_" +- ("_test_") +- (_test_) +- “_test_” +- \`_test_' +- „_test_“ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/empty.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/empty.html new file mode 100644 index 00000000000..20c50519506 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/empty.html @@ -0,0 +1,5 @@ +

      This is `` empty.

      + +

      This is ``empty.

      + +

      This is ````empty.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/empty.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/empty.text new file mode 100644 index 00000000000..cbb91529d49 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/empty.text @@ -0,0 +1,5 @@ +This is `` empty. + +This is ``empty. + +This is ````empty. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/errors.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/errors.html new file mode 100644 index 00000000000..1d341a8f41d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/errors.html @@ -0,0 +1 @@ +

      Not ended `span.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/errors.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/errors.text new file mode 100644 index 00000000000..7a948b41ea2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/errors.text @@ -0,0 +1 @@ +Not ended `span. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting-minted.latex b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting-minted.latex new file mode 100644 index 00000000000..a1f84d90cad --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting-minted.latex @@ -0,0 +1,2 @@ +You can say \mintinline{ruby}{x = Class.new}, for example. + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting-minted.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting-minted.options new file mode 100644 index 00000000000..c11ebb6a406 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting-minted.options @@ -0,0 +1 @@ +:syntax_highlighter: minted diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting-minted.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting-minted.text new file mode 100644 index 00000000000..73732909330 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting-minted.text @@ -0,0 +1 @@ +You can say `x = Class.new`{:.language-ruby}, for example. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting.html new file mode 100644 index 00000000000..c6860f62a6e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting.html @@ -0,0 +1 @@ +

      You can say x = Class.new, for example.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting.text new file mode 100644 index 00000000000..73732909330 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/highlighting.text @@ -0,0 +1 @@ +You can say `x = Class.new`{:.language-ruby}, for example. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/normal.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/normal.html new file mode 100644 index 00000000000..68eddbe8dbb --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/normal.html @@ -0,0 +1,16 @@ +

      This is a simple span.

      + +

      With some<ht>&ml in it.

      + +

      And ` backticks.

      + +

      And ``some`` more.

      + +

      With backslash in\ it.

      + +

      This is a ` literal backtick. +As `are` these!

      + +

      No literal backtick.

      + +

      something

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/normal.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/normal.text new file mode 100644 index 00000000000..10d06e2ff49 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/normal.text @@ -0,0 +1,16 @@ +This is `a` simple span. + +With `some&ml` in it. + +And `` ` `` backticks. + +And ``` ``some`` ``` more. + +With backslash `in\` it. + +This is a ` literal backtick. +As \`are\` these! + +No `` literal backtick``. + +`something` diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/disabled.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/disabled.html new file mode 100644 index 00000000000..7822f7884de --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/disabled.html @@ -0,0 +1 @@ +

      You can say Class.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/disabled.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/disabled.options new file mode 100644 index 00000000000..34094e96bbe --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/disabled.options @@ -0,0 +1,4 @@ +:syntax_highlighter: rouge +:syntax_highlighter_opts: + span: + disable: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/disabled.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/disabled.text new file mode 100644 index 00000000000..d958d9149aa --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/disabled.text @@ -0,0 +1 @@ +You can say `Class`{:.language-ruby}. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/simple.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/simple.html new file mode 100644 index 00000000000..4294542d80b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/simple.html @@ -0,0 +1 @@ +

      You can say x = Class.new, for example.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/simple.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/simple.options new file mode 100644 index 00000000000..9ac61e7e437 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/simple.options @@ -0,0 +1 @@ +:syntax_highlighter: rouge diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/simple.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/simple.text new file mode 100644 index 00000000000..73732909330 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/03_codespan/rouge/simple.text @@ -0,0 +1 @@ +You can say `x = Class.new`{:.language-ruby}, for example. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_inline.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_inline.html new file mode 100644 index 00000000000..b983b5a879f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_inline.html @@ -0,0 +1,79 @@ +

      This is 123456789

      + +
      +
        +
      1. + +

        A paragraph 

        +
      2. +
      3. + +

        A header 

        +
      4. +
      5. + +
        +

        blockquote

        + +

        paragraph 

        +
        +
      6. +
      7. + +
        codeblock
        +
        +

        +
      8. +
      9. + +
          +
        • item 1
        • +
        • item 2 +
            +
          • +

            sub item

            + +
            +

            blockquote

            + +

            header 

            +
            +
          • +
          +
        • +
        +
      10. +
      11. + + + + + + + + + + + + +
        ab
        cd
        +

        +
      12. +
      13. + +
        +

        +
      14. +
      15. + + +

        +
      16. +
      17. + +
        test +
        +

        +
      18. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_inline.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_inline.options new file mode 100644 index 00000000000..ac54fc0de6f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_inline.options @@ -0,0 +1 @@ +footnote_backlink_inline: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_inline.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_inline.text new file mode 100644 index 00000000000..55f94a34771 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_inline.text @@ -0,0 +1,38 @@ +This is [^paragraph][^header][^blockquote][^codeblock][^list][^table][^hrule][^mathblock][^html] + +[^paragraph]: + A paragraph + +[^header]: + # A header + +[^blockquote]: + > blockquote + > + > paragraph + +[^codeblock]: + codeblock + +[^list]: + * item 1 + * item 2 + * sub item + + > blockquote + > + > # header + +[^table]: + | a | b | + | c | d | + +[^hrule]: + *** + +[^mathblock]: + $$x + 2$$ + +[^html]: +
      test +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_text.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_text.html new file mode 100644 index 00000000000..dc66dc89b1c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_text.html @@ -0,0 +1,9 @@ +

      Some footnote here1

      + +
      +
        +
      1. +

        Some text here text &8617; <img />

        +
      2. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_text.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_text.options new file mode 100644 index 00000000000..4c677eff138 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_text.options @@ -0,0 +1 @@ +:footnote_backlink: 'text &8617; ' diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_text.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_text.text new file mode 100644 index 00000000000..41a6f984497 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/backlink_text.text @@ -0,0 +1,3 @@ +Some footnote here[^fn] + +[^fn]: Some text here diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/definitions.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/definitions.html new file mode 100644 index 00000000000..9012cc069ce --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/definitions.html @@ -0,0 +1,17 @@ +

      Some para.

      + +
      +

      blockquote

      +
      + +
        +
      • a list +with some text
      • +
      + +
        +
      • other list
      • +
      +
      code
      +
      + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/definitions.latex b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/definitions.latex new file mode 100644 index 00000000000..965653c8ee5 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/definitions.latex @@ -0,0 +1,17 @@ +Some para. + +\begin{quote} +blockquote +\end{quote} + +\begin{itemize} +\item{} a list +with some text +\end{itemize} + +\begin{itemize} +\item{} other list +\end{itemize} +\begin{verbatim}code +\end{verbatim} + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/definitions.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/definitions.text new file mode 100644 index 00000000000..44b52e00bf0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/definitions.text @@ -0,0 +1,24 @@ +Some para. + +[^footnote]: ignored definition +[^footnote]: Some footnote text + +> blockquote + +[^other]: some + foot + + note text + +* a list + with some text + +[^tnote]: foot note + +* other list +^ + code + +[^1]: + > a blockquote + and some para diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.html new file mode 100644 index 00000000000..bbd8eac7adc --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.html @@ -0,0 +1,12 @@ +

      This is a footnote35. And another36.

      + +
      +
        +
      1. +

        Some text. 

        +
      2. +
      3. +

        Some other text. 

        +
      4. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.latex b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.latex new file mode 100644 index 00000000000..8f07dde0a4d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.latex @@ -0,0 +1,2 @@ +This is a footnote\footnote{Some text.}. And another\footnote{Some other text.}. + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.options new file mode 100644 index 00000000000..f606ecfa7e7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.options @@ -0,0 +1 @@ +:footnote_nr: 35 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.text new file mode 100644 index 00000000000..cad29357b53 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/footnote_nr.text @@ -0,0 +1,4 @@ +This is a footnote[^ab]. And another[^bc]. + +[^ab]: Some text. +[^bc]: Some other text. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/inside_footnote.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/inside_footnote.html new file mode 100644 index 00000000000..26ce52eaacb --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/inside_footnote.html @@ -0,0 +1,17 @@ +

      Lorem ipsum1 dolor sit amet.

      + +

      Lorem ipsum2 dolor sit amet.

      + +
      +
        +
      1. +

        Consecutur adisping.3 

        +
      2. +
      3. +

        Sed ut perspiciatis unde omnis. 

        +
      4. +
      5. +

        Sed ut. 

        +
      6. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/inside_footnote.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/inside_footnote.text new file mode 100644 index 00000000000..f4f91e93989 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/inside_footnote.text @@ -0,0 +1,9 @@ +Lorem ipsum[^first] dolor sit amet. + +Lorem ipsum[^second] dolor sit amet. + +[^first]: Consecutur adisping.[^third] + +[^second]: Sed ut perspiciatis unde omnis. + +[^third]: Sed ut. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.html new file mode 100644 index 00000000000..d4c45d729f7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.html @@ -0,0 +1,46 @@ +

      This is some *ref.1

      + +
      +

      a blockquote 2

      +
      + +
        +
      • and a list item 3
      • +
      + +

      And a header4

      + +

      A marker without a definition [^without].

      + +

      A marker 5 used twice1 and thrice1.

      + +
      +
        +
      1. +

        Some foot note text  2 3

        +
      2. +
      3. +

        other text +with more lines

        + +
        +

        and a quote

        +
        +

        +
      4. +
      5. +

        some text 

        +
      6. +
      7. + +
        code block
        +continued here
        +
        +

        +
      8. +
      9. + +

        +
      10. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.latex b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.latex new file mode 100644 index 00000000000..8f406b8665d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.latex @@ -0,0 +1,23 @@ +This is some *ref.\footnote{Some foot note text} + +\begin{quote} +a blockquote \footnote{other text +with more lines + +\begin{quote} +and a quote +\end{quote}} +\end{quote} + +\begin{itemize} +\item{} and a list item \footnote{some \emph{text}} +\end{itemize} + +\section*{And a header\footnote{\begin{verbatim}code block +continued here +\end{verbatim}}} + +A marker without a definition {[}\^{}without{]}. + +A marker \footnote{} used twice\footnote{Some foot note text} and thrice\footnote{Some foot note text}. + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.options new file mode 100644 index 00000000000..5cfe2502a82 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.options @@ -0,0 +1,2 @@ +:auto_ids: false +:entity_output: :symbolic diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.text new file mode 100644 index 00000000000..42b77fb5443 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/markers.text @@ -0,0 +1,27 @@ +This is some *ref.[^fn] + +[^fn]: Some foot note text +{: .class} + +> a blockquote [^3] + +* and a list item [^1] + +# And a header[^now] + +[^1]:some *text* +[^3]: other text + with more lines + + > and a quote + +A marker without a definition [^without]. + +A marker [^empty] used twice[^fn] and thrice[^fn]. + +[^now]: + + code block + continued here + +[^empty]: diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/placement.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/placement.html new file mode 100644 index 00000000000..997ef26fb53 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/placement.html @@ -0,0 +1,11 @@ +
      +
        +
      1. +

        Footnote \` text 

        +
      2. +
      +
      + +

      Some para with a1 footnote.

      + +

      And another para.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/placement.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/placement.options new file mode 100644 index 00000000000..2e6e0a12061 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/placement.options @@ -0,0 +1 @@ +:entity_output: :numeric diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/placement.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/placement.text new file mode 100644 index 00000000000..97c0ab1a088 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/placement.text @@ -0,0 +1,8 @@ +* footnotes will be placed here +{:footnotes} + +Some para with a[^1] footnote. + +[^1]: Footnote \\\` text + +And another para. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/regexp_problem.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/regexp_problem.html new file mode 100644 index 00000000000..d246a372088 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/regexp_problem.html @@ -0,0 +1,14 @@ +

      Something

      +

      something1.

      + +

      Footnotes

      + +

      Test

      +
      +
        +
      1. + +

        A note 

        +
      2. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/regexp_problem.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/regexp_problem.options new file mode 100644 index 00000000000..5cfe2502a82 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/regexp_problem.options @@ -0,0 +1,2 @@ +:auto_ids: false +:entity_output: :symbolic diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/regexp_problem.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/regexp_problem.text new file mode 100644 index 00000000000..6a60c612649 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/regexp_problem.text @@ -0,0 +1,52 @@ +# Something +something[^note1]. + +# Footnotes +[^note1]: + A note + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# Test diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/without_backlink.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/without_backlink.html new file mode 100644 index 00000000000..df5e9173a32 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/without_backlink.html @@ -0,0 +1,9 @@ +

      Some footnote here1

      + +
      +
        +
      1. +

        Some text here

        +
      2. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/without_backlink.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/without_backlink.options new file mode 100644 index 00000000000..0512dd6da03 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/without_backlink.options @@ -0,0 +1 @@ +:footnote_backlink: '' diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/without_backlink.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/without_backlink.text new file mode 100644 index 00000000000..41a6f984497 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/04_footnote/without_backlink.text @@ -0,0 +1,3 @@ +Some footnote here[^fn] + +[^fn]: Some text here diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/across_lines.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/across_lines.html new file mode 100644 index 00000000000..e7cec40f808 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/across_lines.html @@ -0,0 +1 @@ +

      Link: test

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/across_lines.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/across_lines.text new file mode 100644 index 00000000000..8f39d9599eb --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/across_lines.text @@ -0,0 +1,2 @@ +Link: test diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/button.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/button.html new file mode 100644 index 00000000000..c49bb52f695 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/button.html @@ -0,0 +1,7 @@ +

      + +

      First some text and then a

      + +

      and then text.

      + +

      A it.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/button.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/button.text new file mode 100644 index 00000000000..e0a7783c808 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/button.text @@ -0,0 +1,7 @@ + + +First some text and then a + + and then text. + +A it. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/invalid.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/invalid.html new file mode 100644 index 00000000000..030552fc866 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/invalid.html @@ -0,0 +1 @@ +

      This is some text

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/invalid.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/invalid.text new file mode 100644 index 00000000000..383f0a83f6d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/invalid.text @@ -0,0 +1 @@ +This is some text diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/link_with_mailto.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/link_with_mailto.html new file mode 100644 index 00000000000..7d0d6ad6a44 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/link_with_mailto.html @@ -0,0 +1 @@ +

      Link: text

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/link_with_mailto.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/link_with_mailto.text new file mode 100644 index 00000000000..fb01619621e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/link_with_mailto.text @@ -0,0 +1 @@ +Link: text diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/mark_element.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/mark_element.html new file mode 100644 index 00000000000..b6989b7f281 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/mark_element.html @@ -0,0 +1,3 @@ +

      Lorem ipsum.

      + +

      Test

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/mark_element.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/mark_element.text new file mode 100644 index 00000000000..6ae30e039c9 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/mark_element.text @@ -0,0 +1,3 @@ +Lorem ipsum. + +Test diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/markdown_attr.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/markdown_attr.html new file mode 100644 index 00000000000..44158c3b9ee --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/markdown_attr.html @@ -0,0 +1,6 @@ +

      This is text +This is *text* +This is text +This is text +This is *nothing* to fear about. +This is <http://example.com>.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/markdown_attr.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/markdown_attr.text new file mode 100644 index 00000000000..dcc10ff8354 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/markdown_attr.text @@ -0,0 +1,6 @@ +This is *text* +This is *text* +This is *text* +This is *text* +This is *nothing* to *fear* about. +This is . diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/normal.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/normal.html new file mode 100644 index 00000000000..0da5f26a3e7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/normal.html @@ -0,0 +1,43 @@ +

      Empty !

      + +

      title is a title.

      + +

      This is .

      + +

      This is comment.

      + +

      This is multiline comment.

      + +

      This is tag +now .

      + +

      This is tag + now.

      + +

      This is an empty tag.

      + +

      This is something strange.

      + +

      Auto-closing:

      + +

      Expanding:

      + +

      An invalid tag: <hR>

      + +

      A <p>block tag</p>.

      + +

      An invalid </closing> tag.

      + +

      A tag.

      + +

      An unclosed tag.

      + +

      Some element with | pipe symbol

      + +

      Some element with | pipe symbol

      + +

      Some element with | pipe +symbol|

      + +

      underlined

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/normal.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/normal.text new file mode 100644 index 00000000000..0156d7c05bd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/normal.text @@ -0,0 +1,43 @@ +Empty ! + +title is a title. + +This is . + +This is comment. + +This is multiline comment. + +This is tag +now . + +This is tag + now. + +This is an empty tag. + +This is _something strange_. + +Auto-closing:
      + +Expanding: + +An invalid tag:
      + +A

      block tag

      . + +An invalid tag. + +A tag. + +An unclosed *tag.* + +Some element with | pipe symbol + +Some element with | pipe symbol + +Some element with | pipe +symbol| + +underlined diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/raw_span_elements.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/raw_span_elements.html new file mode 100644 index 00000000000..808f1dbf3aa --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/raw_span_elements.html @@ -0,0 +1,2 @@ +

      This is raw --version and --version and --version and +---version.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/raw_span_elements.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/raw_span_elements.text new file mode 100644 index 00000000000..5b128fcbe9c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/raw_span_elements.text @@ -0,0 +1,2 @@ +This is raw --version and --version and --version and +---version. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/xml.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/xml.html new file mode 100644 index 00000000000..00b43c12478 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/xml.html @@ -0,0 +1,5 @@ +

      This doit test

      + +

      This doit test

      + +

      This doit</some> test

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/xml.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/xml.text new file mode 100644 index 00000000000..bc234de42bd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/05_html/xml.text @@ -0,0 +1,5 @@ +This doit test + +This doit test + +This doit test diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev.html new file mode 100644 index 00000000000..f247c538da7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev.html @@ -0,0 +1,21 @@ +

      This is some text.

      + +

      There is some real concern about OtHeR!

      + +

      is some Think empty about Oesterreich. CSS und CSS3

      + +

      no abbrev here because there is someone and kulis some

      + +
        +
      • (X)HTML test
      • +
      • line two
      • +
      + +

      (X)HTML

      + +
        +
      • test (X)HTML
      • +
      + +

      This is awesome.

      + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev.text new file mode 100644 index 00000000000..1aa8100c597 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev.text @@ -0,0 +1,34 @@ +This is some text. + +*[is some]: Yes it is +*[OtHeR!]: This & that + +*[is some]: It is, yes +*[empty]: + +There *is some real* concern about OtHeR! + +is some Think empty about Oesterreich. CSS und CSS3 + +no abbrev here because there is someone and kulis some + +*[Oesterreich]: Very nice country + +*[CSS]: Cascading +*[CSS3]: Cascading 3 + +* (X)HTML test +* line two + +[(X)HTML](http://en.wikipedia.org/wiki/Xhtml) + +* test (X)HTML + +*[(X)HTML]: (eXtensible) HyperText Markup Language + + +This is awesome. + +{:.testit} +*[awesome]: Some text here +{:.test} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev_defs.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev_defs.html new file mode 100644 index 00000000000..108fcfcea83 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev_defs.html @@ -0,0 +1,2 @@ +
      *[4]: noabbrev
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev_defs.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev_defs.text new file mode 100644 index 00000000000..3f3a0e5b6d0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/abbrev_defs.text @@ -0,0 +1,5 @@ +*[ABBR]: Some abbreviations + *[one abbr]: one abbrev + *[2 and other]: another + *[3]: yet another + *[4]: noabbrev diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/in_footnote.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/in_footnote.html new file mode 100644 index 00000000000..f4f6ea4cf54 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/in_footnote.html @@ -0,0 +1,9 @@ +

      There is a TXT file here. 1

      + +
      +
        +
      1. +

        A TXT file. 

        +
      2. +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/in_footnote.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/in_footnote.text new file mode 100644 index 00000000000..e7709cb96df --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/abbreviations/in_footnote.text @@ -0,0 +1,5 @@ +There is a TXT file here. [^1] + +*[TXT]: Text File + +[^1]: A TXT file. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/autolinks/url_links.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/autolinks/url_links.html new file mode 100644 index 00000000000..90eae7d58d0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/autolinks/url_links.html @@ -0,0 +1,15 @@ +

      This should be a http://www.example.com/ link. +This should be a john.doe@example.com link. +As should john.doe@example.com this. +As should john_doe@example.com this. +As should CSS@example.com this. +Another ampersand http://www.example.com/?doit&x=y link. +More entities http://www.example.com/?doit&x="y&z=y.

      + +

      Email international übung@macht.den.meister.de, ü.äß@hülse.de +Email invalid: <me@example.com>

      + +

      Autolink with underscore: http://www.example.com/with_under_score

      + +

      http://www.example.com/

      + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/autolinks/url_links.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/autolinks/url_links.text new file mode 100644 index 00000000000..033e8af43bd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/autolinks/url_links.text @@ -0,0 +1,16 @@ +This should be a link. +This should be a link. +As should this. +As should this. +As should this. +Another ampersand link. +More entities . + +Email international <übung@macht.den.meister.de>, <ü.äß@hülse.de> +Email invalid: <[me@example.com](mailtos:me@example.com)> + +Autolink with underscore: + + + +*[CSS]: Cascading diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/escaped_chars/normal.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/escaped_chars/normal.html new file mode 100644 index 00000000000..015d5948281 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/escaped_chars/normal.html @@ -0,0 +1,47 @@ +

      \

      + +

      .

      + +

      *

      + +

      _

      + +

      +

      + +

      -

      + +

      `

      + +

      (

      + +

      )

      + +

      [

      + +

      ]

      + +

      {

      + +

      }

      + +

      #

      + +

      !

      + +

      <<

      + +

      >>

      + +

      :

      + +

      |

      + +

      "

      + +

      '

      + +

      =

      + +

      >

      + +

      <

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/escaped_chars/normal.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/escaped_chars/normal.text new file mode 100644 index 00000000000..1c47104acf3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/escaped_chars/normal.text @@ -0,0 +1,47 @@ +\\ + +\. + +\* + +\_ + +\+ + +\- + +\` + +\( + +\) + +\[ + +\] + +\{ + +\} + +\# + +\! + +\<< + +\>> + +\: + +\| + +\" + +\' + +\= + +\> + +\< diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/comment.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/comment.html new file mode 100644 index 00000000000..3544d49fb79 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/comment.html @@ -0,0 +1,6 @@ +

      This is a paragraph. +This is a paragraph. +This is a . +This is a paragraph. +This is a {:/comment} simple {:/} paragraph. +This is a {::comment} paragraph.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/comment.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/comment.text new file mode 100644 index 00000000000..8b9e8d362de --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/comment.text @@ -0,0 +1,6 @@ +This is a {::comment}simple{:/} paragraph. +This is a {::comment}simple{:/comment} paragraph. +This is a {::comment}simple {:/other} paragraph{:/comment}. +This is a {::comment/} paragraph. +This is a {:/comment} simple {:/} paragraph. +This is a {::comment} paragraph. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/ignored.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/ignored.html new file mode 100644 index 00000000000..63c2c404c69 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/ignored.html @@ -0,0 +1 @@ +

      This is {::something}paragraph{:/}

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/ignored.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/ignored.text new file mode 100644 index 00000000000..a7e77375f9f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/ignored.text @@ -0,0 +1 @@ +This is {::something}paragraph{:/} diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/nomarkdown.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/nomarkdown.html new file mode 100644 index 00000000000..83de93125f4 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/nomarkdown.html @@ -0,0 +1 @@ +

      This is *some* text.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/nomarkdown.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/nomarkdown.text new file mode 100644 index 00000000000..57c4b38fd63 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/nomarkdown.text @@ -0,0 +1 @@ +This is {::nomarkdown}*some*{:/} text. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/options.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/options.html new file mode 100644 index 00000000000..48e3076a96d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/options.html @@ -0,0 +1 @@ +

      This is an option *true*!

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/options.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/options.text new file mode 100644 index 00000000000..e289491ef75 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/extension/options.text @@ -0,0 +1 @@ +This is an {::options parse_span_html="false" /} option *true*! diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/ial/simple.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/ial/simple.html new file mode 100644 index 00000000000..c0f3a4757bf --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/ial/simple.html @@ -0,0 +1,6 @@ +

      This is a span.

      + +

      This is a span.

      + +

      This is an{: .ignored} span ial. +This is an{: .escaped} span ial.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/ial/simple.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/ial/simple.text new file mode 100644 index 00000000000..8945602b21d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/ial/simple.text @@ -0,0 +1,6 @@ +This is a `span`{: .hund #dog}. + +This is a `span`{: .hund #dog}{: .katz key='val'}. + +This is an{: .ignored} span ial. +This is an\{: .escaped} span ial. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/line_breaks/normal.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/line_breaks/normal.html new file mode 100644 index 00000000000..11066a509f3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/line_breaks/normal.html @@ -0,0 +1,11 @@ +

      This is a line
      +with a line break.

      + +

      This is a line +without a line break.

      + +

      This is a line
      +with a line\
      +break.

      + +

      Line break on last line.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/line_breaks/normal.latex b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/line_breaks/normal.latex new file mode 100644 index 00000000000..a62ff56167e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/line_breaks/normal.latex @@ -0,0 +1,12 @@ +This is a line\newline +with a line break. + +This is a line +without a line break. + +This is a line \newline +with a line\textbackslash{} \newline +break. + +Line break on last line. + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/line_breaks/normal.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/line_breaks/normal.text new file mode 100644 index 00000000000..92f866f2e18 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/line_breaks/normal.text @@ -0,0 +1,11 @@ +This is a line +with a line break. + +This is a line +without a line break. + +This is a line \\ +with a line\\ +break. + +Line break on last line. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/itex2mml.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/itex2mml.html new file mode 100644 index 00000000000..4e195d18f7c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/itex2mml.html @@ -0,0 +1 @@ +

      This is f(x)=ax 3+bx 2+cx+df(x) = a{x^3} + b{x^2} + cx + d something!

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/itex2mml.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/itex2mml.options new file mode 100644 index 00000000000..953bdae24be --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/itex2mml.options @@ -0,0 +1 @@ +:math_engine: itex2mml diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/itex2mml.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/itex2mml.text new file mode 100644 index 00000000000..3e20b55e827 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/itex2mml.text @@ -0,0 +1 @@ +This is $$f(x) = a{x^3} + b{x^2} + cx + d$$ something! diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/katex.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/katex.html.19 new file mode 100644 index 00000000000..7317df21c7b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/katex.html.19 @@ -0,0 +1 @@ +

      Erst einmal eine Formel wie a2+b2=c2a^2+b^2=c^2 innerhalb eines Satzes.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/katex.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/katex.options new file mode 100644 index 00000000000..108b2654a65 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/katex.options @@ -0,0 +1 @@ +:math_engine: :katex diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/katex.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/katex.text new file mode 100644 index 00000000000..94af23014bc --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/katex.text @@ -0,0 +1 @@ +Erst einmal eine Formel wie $$a^2+b^2=c^2$$ innerhalb eines Satzes. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/mathjaxnode.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/mathjaxnode.html.19 new file mode 100644 index 00000000000..df82f90fdde --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/mathjaxnode.html.19 @@ -0,0 +1,27 @@ +

      This is + f + ( + x + ) + = + a + + + x + 3 + + + + + b + + + x + 2 + + + + + c + x + + + d + something!

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/mathjaxnode.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/mathjaxnode.options new file mode 100644 index 00000000000..adc27e8aa11 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/mathjaxnode.options @@ -0,0 +1 @@ +:math_engine: mathjaxnode diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/mathjaxnode.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/mathjaxnode.text new file mode 100644 index 00000000000..3e20b55e827 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/mathjaxnode.text @@ -0,0 +1 @@ +This is $$f(x) = a{x^3} + b{x^2} + cx + d$$ something! diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/no_engine.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/no_engine.html new file mode 100644 index 00000000000..3b93c542fbd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/no_engine.html @@ -0,0 +1 @@ +

      $5+5$ inline math

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/no_engine.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/no_engine.options new file mode 100644 index 00000000000..06d559e5459 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/no_engine.options @@ -0,0 +1 @@ +:math_engine: ~ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/no_engine.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/no_engine.text new file mode 100644 index 00000000000..a22f9fd4585 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/no_engine.text @@ -0,0 +1 @@ +$$5+5$$ inline math diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/normal.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/normal.html new file mode 100644 index 00000000000..d99130e7d94 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/normal.html @@ -0,0 +1,10 @@ +

      This is some math. With new line characters in between.

      + +

      inline math, $5.00 $$no math$$

      + +

      $$5+5$$ inline math

      + +

      + +

      $$5+5$$

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/normal.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/normal.text new file mode 100644 index 00000000000..e37a0078929 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/normal.text @@ -0,0 +1,10 @@ +This is $$\lambda_\alpha > 5$$ some math. With $$1 ++ 1$$ new line characters in between. + +$$5+5$$ inline math, $5.00 \$$no math$$ + +\$\$5+5$$ inline math + +\$$5+5$$ + +\$\$5+5$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/ritex.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/ritex.html new file mode 100644 index 00000000000..60ba8fea66a --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/ritex.html @@ -0,0 +1 @@ +

      This is f(x)=ax3+bx2+cx+d something!

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/ritex.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/ritex.options new file mode 100644 index 00000000000..0ef54eb92a5 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/ritex.options @@ -0,0 +1 @@ +:math_engine: ritex diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/ritex.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/ritex.text new file mode 100644 index 00000000000..3e20b55e827 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/ritex.text @@ -0,0 +1 @@ +This is $$f(x) = a{x^3} + b{x^2} + cx + d$$ something! diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/sskatex.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/sskatex.html.19 new file mode 100644 index 00000000000..7317df21c7b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/sskatex.html.19 @@ -0,0 +1 @@ +

      Erst einmal eine Formel wie a2+b2=c2a^2+b^2=c^2 innerhalb eines Satzes.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/sskatex.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/sskatex.options new file mode 100644 index 00000000000..214a301b971 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/sskatex.options @@ -0,0 +1 @@ +:math_engine: sskatex diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/sskatex.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/sskatex.text new file mode 100644 index 00000000000..94af23014bc --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/math/sskatex.text @@ -0,0 +1 @@ +Erst einmal eine Formel wie $$a^2+b^2=c^2$$ innerhalb eines Satzes. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities.html new file mode 100644 index 00000000000..96b3b5ce25a --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities.html @@ -0,0 +1,6 @@ +

      This is the A&O. © 2008 by me +As well \& as this. Some ŗ other +values may ¯ may also show but +not st. like &#xYZ;.

      + +

      This is BS&T; done!

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities.options new file mode 100644 index 00000000000..036c561983f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities.options @@ -0,0 +1 @@ +:entity_output: :as_input diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities.text new file mode 100644 index 00000000000..0446f4c519b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities.text @@ -0,0 +1,6 @@ +This is the A&O. © 2008 by me +As well \& as this. Some ŗ other +values may ¯ may also show but +not st. like &#xYZ;. + +This is BS&T; done! diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.html new file mode 100644 index 00000000000..7507f751b2c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.html @@ -0,0 +1 @@ +

      This "is" 'the' A&O. © 2008 by me ŗ and λ

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.html.19 new file mode 100644 index 00000000000..ed2817bbeb7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.html.19 @@ -0,0 +1 @@ +

      This "is" 'the' A&O. © 2008 by me ŗ and λ

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.options new file mode 100644 index 00000000000..32a751e36ff --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.options @@ -0,0 +1,2 @@ +:entity_output: :as_char +:smart_quotes: apos,apos,quot,quot diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.text new file mode 100644 index 00000000000..279b5115238 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_char.text @@ -0,0 +1 @@ +This "is" 'the' A&O. © 2008 by me ŗ and λ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_input.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_input.html new file mode 100644 index 00000000000..d2eec9dd614 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_input.html @@ -0,0 +1 @@ +

      This is the A&O. © 2008 by me ŗ and λ

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_input.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_input.options new file mode 100644 index 00000000000..036c561983f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_input.options @@ -0,0 +1 @@ +:entity_output: :as_input diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_input.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_input.text new file mode 100644 index 00000000000..1ddf7cdd921 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_as_input.text @@ -0,0 +1 @@ +This is the A&O. © 2008 by me ŗ and λ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_numeric.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_numeric.html new file mode 100644 index 00000000000..d04613ee95d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_numeric.html @@ -0,0 +1 @@ +

      This is the A&O. © 2008 by me ŗ and λ

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_numeric.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_numeric.options new file mode 100644 index 00000000000..2e6e0a12061 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_numeric.options @@ -0,0 +1 @@ +:entity_output: :numeric diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_numeric.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_numeric.text new file mode 100644 index 00000000000..1ddf7cdd921 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_numeric.text @@ -0,0 +1 @@ +This is the A&O. © 2008 by me ŗ and λ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_symbolic.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_symbolic.html new file mode 100644 index 00000000000..258ba147a40 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_symbolic.html @@ -0,0 +1 @@ +

      This is the A&O. © 2008 by me ŗ and λ

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_symbolic.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_symbolic.options new file mode 100644 index 00000000000..c195785fba1 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_symbolic.options @@ -0,0 +1 @@ +:entity_output: :symbolic diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_symbolic.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_symbolic.text new file mode 100644 index 00000000000..1ddf7cdd921 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/entities_symbolic.text @@ -0,0 +1 @@ +This is the A&O. © 2008 by me ŗ and λ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/greaterthan.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/greaterthan.html new file mode 100644 index 00000000000..dcce4cc381c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/greaterthan.html @@ -0,0 +1 @@ +

      2 > 1 > 0

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/greaterthan.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/greaterthan.text new file mode 100644 index 00000000000..7dfb7f123cb --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/greaterthan.text @@ -0,0 +1 @@ +2 > 1 > 0 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/lowerthan.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/lowerthan.html new file mode 100644 index 00000000000..8ebac237067 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/lowerthan.html @@ -0,0 +1 @@ +

      0 < 1 < 2

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/lowerthan.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/lowerthan.text new file mode 100644 index 00000000000..038df8bb46a --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/lowerthan.text @@ -0,0 +1 @@ +0 < 1 < 2 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography.html new file mode 100644 index 00000000000..02d1dbce2e4 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography.html @@ -0,0 +1,40 @@ +

      This is… something—this too–!

      + +

      This «is» some text, « this » too!

      + +

      “Fancy quotes” are ‘cool’, even in the ’80s! +Je t’ aime. You’re a funny one! Thomas’ name +Mark’s name. “…you” +“‘Nested’ quotes are ‘possible’”, too! +‘“Otherway” is “round”’!

      + +

      ‘Opening now!’

      + +

      ’80s are really cool.

      + +

      Cluster’s Last Stand.

      + +

      Nam liber tempor +“…At vero eos et accusam”

      + +

      Single underscores should work.”

      + +

      Single asterisks should work.”

      + +

      Double underscores should work.’

      + +

      Double asterisks should work.’

      + +

      Hurrah!

      + +

      Absolutely.’

      + +

      “…some Text”

      + +

      “… some Text”

      + +

      This: “…some Text”

      + +

      This: “… some Text”

      + +

      ”[foo]” “[foo]” d “[foo]”

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography.options new file mode 100644 index 00000000000..4f1c17c63e1 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography.options @@ -0,0 +1 @@ +:entity_output: symbolic diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography.text new file mode 100644 index 00000000000..27e090e902b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography.text @@ -0,0 +1,40 @@ +This is... something---this too--! + +This <> some text, << this >> too! + +"Fancy quotes" are 'cool', even in the '80s! +Je t' aime. You're a funny one! Thomas' name +Mark's name. "...you" +"'Nested' quotes are 'possible'", too! +'"Otherway" is "round"'! + +'Opening now!' + +'80s are really cool. + +Cluster's Last Stand. + +Nam liber tempor +"...At vero eos et accusam" + +"_Single underscores_ should work." + +"*Single asterisks* should work." + +'__Double underscores__ should work.' + +'**Double asterisks** should work.' + +"_Hurrah!_" + +'__Absolutely__.' + +"...some Text" + +"... some Text" + +This: "...some Text" + +This: "... some Text" + +"\[foo]" "\[foo]" d "\[foo]" diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.html new file mode 100644 index 00000000000..4a6c2260d8c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.html @@ -0,0 +1,3 @@ +

      This ... something---this too--!

      + +

      This <<is>> some text, << this >> too!

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.latex b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.latex new file mode 100644 index 00000000000..c7d9ba59a42 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.latex @@ -0,0 +1,4 @@ +This ... something---this too--! + +This \textless{}\textless{}is\textgreater{}\textgreater{} some text, \textless{}\textless{} this \textgreater{}\textgreater{} too! + diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.options new file mode 100644 index 00000000000..d0a031322db --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.options @@ -0,0 +1,8 @@ +typographic_symbols: + hellip: '...' + mdash: '---' + ndash: '--' + laquo: '<<' + raquo: '>>' + laquo_space: '<< ' + raquo_space: ' >>' diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.text new file mode 100644 index 00000000000..a3d59b37862 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases/span/text_substitutions/typography_subst.text @@ -0,0 +1,3 @@ +This ... something---this too--! + +This <> some text, << this >> too! diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/atx_header.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/atx_header.html new file mode 100644 index 00000000000..776d7a15ac9 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/atx_header.html @@ -0,0 +1,3 @@ +

      header

      + +

      #no header

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/atx_header.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/atx_header.text new file mode 100644 index 00000000000..5e70e2b139a --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/atx_header.text @@ -0,0 +1,3 @@ +# header + +#no header diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_disable_highlighting.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_disable_highlighting.html new file mode 100644 index 00000000000..8390d097a3c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_disable_highlighting.html @@ -0,0 +1,2 @@ +
      Kramdown::Document.new(text, :input => 'GFM')
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_disable_highlighting.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_disable_highlighting.options new file mode 100644 index 00000000000..72e9bc1eecc --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_disable_highlighting.options @@ -0,0 +1 @@ +:enable_coderay: false diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_disable_highlighting.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_disable_highlighting.text new file mode 100644 index 00000000000..98cf3a858cd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_disable_highlighting.text @@ -0,0 +1,3 @@ +```ruby +Kramdown::Document.new(text, :input => 'GFM') +``` diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_syntax.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_syntax.html new file mode 100644 index 00000000000..8c1079d16f6 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_syntax.html @@ -0,0 +1,20 @@ +
      Three backticks
      +
      + +
      Four backticks
      +
      + +
      Unbalanced bottom heavy
      +
      + +
      +
      1language no space
      +
      +
      +
      + +
      +
      1language with space
      +
      +
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_syntax.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_syntax.text new file mode 100644 index 00000000000..fb5c6111f9f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/backticks_syntax.text @@ -0,0 +1,19 @@ +``` +Three backticks +``` + +```` +Four backticks +```` + +``` +Unbalanced bottom heavy +`````` + +````ruby +language no space +```` + +```` ruby +language with space +```` diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/codeblock_fenced.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/codeblock_fenced.html new file mode 100644 index 00000000000..0bdefdc3e09 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/codeblock_fenced.html @@ -0,0 +1,20 @@ +

      normal

      + +
      require 'kramdown'
      +
      +Kramdown::Document.new(text).to_html
      +
      + +

      indent with tab

      + +
      ```ruby
      +require 'kramdown'
      +
      +Kramdown::Document.new(text).to_html
      +```
      +
      + +

      indent with 2 spaces

      + +
        console.log("hello");
      +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/codeblock_fenced.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/codeblock_fenced.options new file mode 100644 index 00000000000..72e9bc1eecc --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/codeblock_fenced.options @@ -0,0 +1 @@ +:enable_coderay: false diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/codeblock_fenced.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/codeblock_fenced.text new file mode 100644 index 00000000000..5e3e192cdee --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/codeblock_fenced.text @@ -0,0 +1,21 @@ +normal + +```ruby +require 'kramdown' + +Kramdown::Document.new(text).to_html +``` + +indent with tab + + ```ruby + require 'kramdown' + + Kramdown::Document.new(text).to_html + ``` + +indent with 2 spaces + + ```js + console.log("hello"); + ``` diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks.html new file mode 100644 index 00000000000..1dfb2f08d91 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks.html @@ -0,0 +1,3 @@ +

      one
      +two
      +three

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks.text new file mode 100644 index 00000000000..f1287bde817 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks.text @@ -0,0 +1,3 @@ +one +_two_ +three diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks_off.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks_off.html new file mode 100644 index 00000000000..e1dba2bfcc2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks_off.html @@ -0,0 +1,2 @@ +

      This is just a normal paragraph.
      +Containing a manual line break above.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks_off.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks_off.options new file mode 100644 index 00000000000..f2da68328b0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks_off.options @@ -0,0 +1 @@ +:hard_wrap: false diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks_off.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks_off.text new file mode 100644 index 00000000000..2fe88b94f37 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/hard_line_breaks_off.text @@ -0,0 +1,2 @@ +This is just a normal paragraph. +Containing a manual line break above. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.html new file mode 100644 index 00000000000..1e5265073cf --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.html @@ -0,0 +1,27 @@ +

      test

      + +

      variable_name

      + +

      abc def öúß

      + +

      192 abc 192

      + +

      ;.;;

      + +

      variable_name

      + +

      variable_name

      + +

      ;;

      + +

      before after tab

      + +

      with code

      + +

      with  ä space

      + +

      With “smart” quotes

      + +

      with — « typographic » … symbols

      + +

      with

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.html.19 new file mode 100644 index 00000000000..b45fe8f3677 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.html.19 @@ -0,0 +1,27 @@ +

      test

      + +

      variable_name

      + +

      abc def öúß

      + +

      192 abc 192

      + +

      ;.;;

      + +

      variable_name

      + +

      variable_name

      + +

      ;;

      + +

      before after tab

      + +

      with code

      + +

      with  ä space

      + +

      With “smart” quotes

      + +

      with — « typographic » … symbols

      + +

      with

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.options new file mode 100644 index 00000000000..8776b5524df --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.options @@ -0,0 +1 @@ +:auto_ids: true diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.text new file mode 100644 index 00000000000..0a89c0b4eeb --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids.text @@ -0,0 +1,27 @@ +### test {#myid} + +### variable_name + +### abc def öúß + +### 192 abc 192 + +### ;.;; + +### variable_name + +### variable_name + +### ;; + +### before after tab + +### with `code` + +### with  ä space + +### With "smart" quotes + +### with --- << typographic >> ... symbols + +### with $$m=5$$ diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids_with_prefix.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids_with_prefix.html new file mode 100644 index 00000000000..4aab0728ef2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids_with_prefix.html @@ -0,0 +1,3 @@ +

      Header 1

      + +

      123

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids_with_prefix.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids_with_prefix.options new file mode 100644 index 00000000000..f37255d52b8 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids_with_prefix.options @@ -0,0 +1,2 @@ +:auto_ids: true +:auto_id_prefix: hallo- diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids_with_prefix.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids_with_prefix.text new file mode 100644 index 00000000000..acf09fe446f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/header_ids_with_prefix.text @@ -0,0 +1,3 @@ +# Header 1 + +# 123 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.html new file mode 100644 index 00000000000..beecad4c3ce --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.html @@ -0,0 +1,3 @@ +

      Header with --ndash

      + +

      with --- << typographic >> ... symbols

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.html.19 new file mode 100644 index 00000000000..beecad4c3ce --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.html.19 @@ -0,0 +1,3 @@ +

      Header with --ndash

      + +

      with --- << typographic >> ... symbols

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.options new file mode 100644 index 00000000000..4a83cd1bb92 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.options @@ -0,0 +1 @@ +:gfm_quirks: [no_auto_typographic] diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.text new file mode 100644 index 00000000000..f57965114e4 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/no_typographic.text @@ -0,0 +1,3 @@ +### Header with --ndash + +### with --- << typographic >> ... symbols diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end-disabled.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end-disabled.html new file mode 100644 index 00000000000..41dfb3a6a5e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end-disabled.html @@ -0,0 +1,31 @@ +

      A
      + - b

      + +

      This is a list
      +- or is it

      + +

      blockquote
      +> text

      + +

      header
      +# text

      + +

      codeblock fenced
      + +puts hello world +

      + +
        +
      • +

        level 1
        +some text

        + +

        begin level 2
        +* level 2
        +* level 2

        +
      • +
      + +

      h1

      +

      ## h2
      +### h3

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end-disabled.options b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end-disabled.options new file mode 100644 index 00000000000..704f643d0f7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end-disabled.options @@ -0,0 +1 @@ +:gfm_quirks: [] diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end-disabled.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end-disabled.text new file mode 100644 index 00000000000..4e09e0391a3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end-disabled.text @@ -0,0 +1,27 @@ +A + - b + +This is a list +- or is it + +blockquote +> text + +header +# text + +codeblock fenced +``` +puts hello world +``` + +* level 1 + some text + + begin level 2 + * level 2 + * level 2 + +# h1 +## h2 +### h3 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end.html new file mode 100644 index 00000000000..c337d61d960 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end.html @@ -0,0 +1,38 @@ +

      A

      +
        +
      • b
      • +
      + +

      This is a list

      +
        +
      • or is it
      • +
      + +

      blockquote

      +
      +

      text

      +
      + +

      header

      +

      text

      + +

      codeblock fenced

      +
      puts hello world
      +
      + +
        +
      • +

        level 1
        +some text

        + +

        begin level 2

        +
          +
        • level 2
        • +
        • level 2
        • +
        +
      • +
      + +

      h1

      +

      h2

      +

      h3

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end.text new file mode 100644 index 00000000000..4e09e0391a3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/paragraph_end.text @@ -0,0 +1,27 @@ +A + - b + +This is a list +- or is it + +blockquote +> text + +header +# text + +codeblock fenced +``` +puts hello world +``` + +* level 1 + some text + + begin level 2 + * level 2 + * level 2 + +# h1 +## h2 +### h3 diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/strikethrough.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/strikethrough.html new file mode 100644 index 00000000000..dad32abfdbc --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/strikethrough.html @@ -0,0 +1,27 @@ +

      This is a test

      + +

      ~This is another test~

      + +

      This is yet another test~

      + +

      ~~ This is a test of it NOT working ~~

      + +

      ~~
      +This
      +is
      +a
      +multiline
      +test
      +~~

      + +

      This is an inline strikethrough test

      + +

      This is an ~~escaped~~ strikethrough.

      + +

      This is a strikethrough with a ~ in the middle

      + +

      I don’t even~ have an extra tilde.

      + +

      This should ~~not be struck.

      + +

      This is a complex strike through *test ~~with nesting involved* here~~.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/strikethrough.html.19 b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/strikethrough.html.19 new file mode 100644 index 00000000000..ed289956108 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/strikethrough.html.19 @@ -0,0 +1,27 @@ +

      This is a test

      + +

      ~This is another test~

      + +

      This is yet another test~

      + +

      ~~ This is a test of it NOT working ~~

      + +

      ~~
      +This
      +is
      +a
      +multiline
      +test
      +~~

      + +

      This is an inline strikethrough test

      + +

      This is an ~~escaped~~ strikethrough.

      + +

      This is a strikethrough with a ~ in the middle

      + +

      I don’t even~ have an extra tilde.

      + +

      This should ~~not be struck.

      + +

      This is a complex strike through *test ~~with nesting involved* here~~.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/strikethrough.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/strikethrough.text new file mode 100644 index 00000000000..fbeffc6d5c0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/strikethrough.text @@ -0,0 +1,27 @@ +~~This is a test~~ + +~~~This is another test~~~ + +~~This is yet another test~~~ + +~~ This is a test of it NOT working ~~ + +~~ +This +is +a +**multiline** +test +~~ + +This is an ~~_inline_ **strikethrough**~~ test + +This is an \~~escaped~~ strikethrough. + +This is a ~~strikethrough with a ~ in the middle~~ + +I ~~don't even~~~ have an extra tilde. + +This should ~~not be struck. + +This ~~is a complex *strike* through *test ~~with nesting~~ involved* here~~. diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/task_list.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/task_list.html new file mode 100644 index 00000000000..a11b553b36a --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/task_list.html @@ -0,0 +1,40 @@ +

      unordered task list

      + +
        +
      • first ul task item
      • +
      • second ul task item
      • +
      • third ul task item
      • +
      • fourth ul task item [ ] next
      • +
      + +

      unordered list

      + +
        +
      • +
        +

        first ul item

        +
        +
      • +
      • +
      • +
        test
        +
        +
      • +
      • second ul item
      • +
      + +

      ordered list

      + +
        +
      1. first ol item
      2. +
      3. second ol item
      4. +
      + +

      ordered task list

      + +
        +
      1. first ol task item
      2. +
      3. second ol task item
      4. +
      5. third ol task item
      6. +
      7. fourth ol task item
      8. +
      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/task_list.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/task_list.text new file mode 100644 index 00000000000..f6ade2faf16 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/task_list.text @@ -0,0 +1,26 @@ +unordered task list + +- [ ] first ul task item +- [x] second ul task item +- [X] third ul task item +- [ ] fourth ul task item [ ] next + +unordered list + +- > first ul item +- +- + test +- second ul item + +ordered list + +1. first ol item +2. second ol item + +ordered task list + +1. [ ] first ol task item +2. [x] second ol task item +3. [X] third ol task item +4. [ ] fourth ol task item diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/two_para_hard_line_breaks.html b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/two_para_hard_line_breaks.html new file mode 100644 index 00000000000..d5ba2e41f9d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/two_para_hard_line_breaks.html @@ -0,0 +1,4 @@ +

      This is just a normal paragraph.
      +Containing a line break.

      + +

      Another paragraph.

      diff --git a/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/two_para_hard_line_breaks.text b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/two_para_hard_line_breaks.text new file mode 100644 index 00000000000..6b3d7c55c59 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/kramdown-1.17.0/test/testcases_gfm/two_para_hard_line_breaks.text @@ -0,0 +1,4 @@ +This is just a normal paragraph. +Containing a line break. + +Another paragraph. diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/ext/libv8-node/.location.yml b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/ext/libv8-node/.location.yml new file mode 100644 index 00000000000..6753ecbacfc --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/ext/libv8-node/.location.yml @@ -0,0 +1 @@ +--- !ruby/object:Libv8::Node::Location::Vendor {} diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/ext/libv8-node/location.rb b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/ext/libv8-node/location.rb new file mode 100644 index 00000000000..07acff82b4c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/ext/libv8-node/location.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +require 'yaml' +require 'pathname' +require File.expand_path('paths', __dir__) + +module Libv8; end + +module Libv8::Node + class Location + def install! + File.open(Pathname(__FILE__).dirname.join('.location.yml'), 'w') do |f| + f.write(to_yaml) + end + + 0 + end + + def self.load! + File.open(Pathname(__FILE__).dirname.join('.location.yml')) do |f| + YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(f) : YAML.load(f) # rubocop:disable Security/YAMLLoad + end + end + + class Vendor < Location + def install! + require File.expand_path('builder', __dir__) + + builder = Libv8::Node::Builder.new + exit_status = builder.build_libv8! + builder.remove_intermediates! + + super if exit_status == 0 + + verify_installation! + + exit_status + end + + def configure(context = MkmfContext.new) + context.incflags.insert(0, Libv8::Node::Paths.include_paths.map { |p| "-I#{p}" }.join(' ') << ' ') + context.ldflags.insert(0, Libv8::Node::Paths.object_paths.join(' ') << ' ') + end + + def verify_installation! + include_paths = Libv8::Node::Paths.include_paths + + unless include_paths.detect { |p| Pathname(p).join('v8.h').exist? } # rubocop:disable Style/IfUnlessModifier + raise(HeaderNotFound, "Unable to locate 'v8.h' in the libv8 header paths: #{include_paths.inspect}") + end + + Libv8::Node::Paths.object_paths.each do |p| + raise(ArchiveNotFound, p) unless File.exist?(p) + end + end + + class HeaderNotFound < StandardError; end + + class ArchiveNotFound < StandardError + def initialize(filename) + super "libv8 did not install properly, expected binary v8 archive '#{filename}'to exist, but it was not found" + end + end + end + + class MkmfContext + def incflags + $INCFLAGS # rubocop:disable Style/GlobalVars + end + + def ldflags + $LDFLAGS # rubocop:disable Style/GlobalVars + end + end + end +end diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/ext/libv8-node/paths.rb b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/ext/libv8-node/paths.rb new file mode 100644 index 00000000000..469ad5fbf16 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/ext/libv8-node/paths.rb @@ -0,0 +1,34 @@ +require 'rbconfig' +require 'shellwords' + +module Libv8; end + +module Libv8::Node + module Paths + module_function + + def include_paths + [Shellwords.escape(File.join(vendored_source_path, 'include'))] + end + + def object_paths + [Shellwords.escape(File.join(vendored_source_path, + platform, + 'libv8', + 'obj', + "libv8_monolith.#{config['LIBEXT']}"))] + end + + def platform + Gem::Platform.local.tap { |p| RUBY_PLATFORM =~ /musl/ && p.version.nil? && p.instance_eval { @version = 'musl' } }.to_s.gsub(/-darwin-?\d+/, '-darwin') + end + + def config + RbConfig::MAKEFILE_CONFIG + end + + def vendored_source_path + File.expand_path('../../vendor/v8', __dir__) + end + end +end diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/lib/libv8-node.rb b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/lib/libv8-node.rb new file mode 100644 index 00000000000..632153f4d4b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/lib/libv8-node.rb @@ -0,0 +1 @@ +require 'libv8/node' diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/lib/libv8/node.rb b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/lib/libv8/node.rb new file mode 100644 index 00000000000..1d535198dc0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/lib/libv8/node.rb @@ -0,0 +1,11 @@ +require 'libv8/node/version' +require 'libv8-node/location' + +module Libv8; end + +module Libv8::Node + def self.configure_makefile + location = Location.load! + location.configure + end +end diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/lib/libv8/node/version.rb b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/lib/libv8/node/version.rb new file mode 100644 index 00000000000..72534ff28f3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/lib/libv8/node/version.rb @@ -0,0 +1,7 @@ +module Libv8; end + +module Libv8::Node + VERSION = '16.19.0.1'.freeze + NODE_VERSION = '16.19.0'.freeze + LIBV8_VERSION = '9.4.146.26'.freeze # from v8/include/v8-version.h +end diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/arm64-darwin/libv8/obj/libv8_monolith.a b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/arm64-darwin/libv8/obj/libv8_monolith.a new file mode 100644 index 00000000000..3b6eb9ddf2f Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/arm64-darwin/libv8/obj/libv8_monolith.a differ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/allocation.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/allocation.h new file mode 100644 index 00000000000..d75f1a97296 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/allocation.h @@ -0,0 +1,233 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_ALLOCATION_H_ +#define INCLUDE_CPPGC_ALLOCATION_H_ + +#include +#include +#include +#include +#include +#include + +#include "cppgc/custom-space.h" +#include "cppgc/internal/api-constants.h" +#include "cppgc/internal/gc-info.h" +#include "cppgc/type-traits.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +/** + * AllocationHandle is used to allocate garbage-collected objects. + */ +class AllocationHandle; + +namespace internal { + +class V8_EXPORT MakeGarbageCollectedTraitInternal { + protected: + static inline void MarkObjectAsFullyConstructed(const void* payload) { + // See api_constants for an explanation of the constants. + std::atomic* atomic_mutable_bitfield = + reinterpret_cast*>( + const_cast(reinterpret_cast( + reinterpret_cast(payload) - + api_constants::kFullyConstructedBitFieldOffsetFromPayload))); + atomic_mutable_bitfield->fetch_or(api_constants::kFullyConstructedBitMask, + std::memory_order_release); + } + + template + struct SpacePolicy { + static void* Allocate(AllocationHandle& handle, size_t size) { + // Custom space. + static_assert(std::is_base_of::value, + "Custom space must inherit from CustomSpaceBase."); + return MakeGarbageCollectedTraitInternal::Allocate( + handle, size, internal::GCInfoTrait::Index(), + CustomSpace::kSpaceIndex); + } + }; + + template + struct SpacePolicy { + static void* Allocate(AllocationHandle& handle, size_t size) { + // Default space. + return MakeGarbageCollectedTraitInternal::Allocate( + handle, size, internal::GCInfoTrait::Index()); + } + }; + + private: + static void* Allocate(cppgc::AllocationHandle& handle, size_t size, + GCInfoIndex index); + static void* Allocate(cppgc::AllocationHandle& handle, size_t size, + GCInfoIndex index, CustomSpaceIndex space_index); + + friend class HeapObjectHeader; +}; + +} // namespace internal + +/** + * Base trait that provides utilities for advancers users that have custom + * allocation needs (e.g., overriding size). It's expected that users override + * MakeGarbageCollectedTrait (see below) and inherit from + * MakeGarbageCollectedTraitBase and make use of the low-level primitives + * offered to allocate and construct an object. + */ +template +class MakeGarbageCollectedTraitBase + : private internal::MakeGarbageCollectedTraitInternal { + private: + static_assert(internal::IsGarbageCollectedType::value, + "T needs to be a garbage collected object"); + static_assert(!IsGarbageCollectedWithMixinTypeV || + sizeof(T) <= + internal::api_constants::kLargeObjectSizeThreshold, + "GarbageCollectedMixin may not be a large object"); + + protected: + /** + * Allocates memory for an object of type T. + * + * \param handle AllocationHandle identifying the heap to allocate the object + * on. + * \param size The size that should be reserved for the object. + * \returns the memory to construct an object of type T on. + */ + V8_INLINE static void* Allocate(AllocationHandle& handle, size_t size) { + static_assert( + std::is_base_of::value, + "U of GarbageCollected must be a base of T. Check " + "GarbageCollected base class inheritance."); + return SpacePolicy< + typename internal::GCInfoFolding< + T, typename T::ParentMostGarbageCollectedType>::ResultType, + typename SpaceTrait::Space>::Allocate(handle, size); + } + + /** + * Marks an object as fully constructed, resulting in precise handling by the + * garbage collector. + * + * \param payload The base pointer the object is allocated at. + */ + V8_INLINE static void MarkObjectAsFullyConstructed(const void* payload) { + internal::MakeGarbageCollectedTraitInternal::MarkObjectAsFullyConstructed( + payload); + } +}; + +/** + * Passed to MakeGarbageCollected to specify how many bytes should be appended + * to the allocated object. + * + * Example: + * \code + * class InlinedArray final : public GarbageCollected { + * public: + * explicit InlinedArray(size_t bytes) : size(bytes), byte_array(this + 1) {} + * void Trace(Visitor*) const {} + + * size_t size; + * char* byte_array; + * }; + * + * auto* inlined_array = MakeGarbageCollectedbyte_array[i]); + * } + * \endcode + */ +struct AdditionalBytes { + constexpr explicit AdditionalBytes(size_t bytes) : value(bytes) {} + const size_t value; +}; + +/** + * Default trait class that specifies how to construct an object of type T. + * Advanced users may override how an object is constructed using the utilities + * that are provided through MakeGarbageCollectedTraitBase. + * + * Any trait overriding construction must + * - allocate through `MakeGarbageCollectedTraitBase::Allocate`; + * - mark the object as fully constructed using + * `MakeGarbageCollectedTraitBase::MarkObjectAsFullyConstructed`; + */ +template +class MakeGarbageCollectedTrait : public MakeGarbageCollectedTraitBase { + public: + template + static T* Call(AllocationHandle& handle, Args&&... args) { + void* memory = + MakeGarbageCollectedTraitBase::Allocate(handle, sizeof(T)); + T* object = ::new (memory) T(std::forward(args)...); + MakeGarbageCollectedTraitBase::MarkObjectAsFullyConstructed(object); + return object; + } + + template + static T* Call(AllocationHandle& handle, AdditionalBytes additional_bytes, + Args&&... args) { + void* memory = MakeGarbageCollectedTraitBase::Allocate( + handle, sizeof(T) + additional_bytes.value); + T* object = ::new (memory) T(std::forward(args)...); + MakeGarbageCollectedTraitBase::MarkObjectAsFullyConstructed(object); + return object; + } +}; + +/** + * Allows users to specify a post-construction callback for specific types. The + * callback is invoked on the instance of type T right after it has been + * constructed. This can be useful when the callback requires a + * fully-constructed object to be able to dispatch to virtual methods. + */ +template +struct PostConstructionCallbackTrait { + static void Call(T*) {} +}; + +/** + * Constructs a managed object of type T where T transitively inherits from + * GarbageCollected. + * + * \param args List of arguments with which an instance of T will be + * constructed. + * \returns an instance of type T. + */ +template +T* MakeGarbageCollected(AllocationHandle& handle, Args&&... args) { + T* object = + MakeGarbageCollectedTrait::Call(handle, std::forward(args)...); + PostConstructionCallbackTrait::Call(object); + return object; +} + +/** + * Constructs a managed object of type T where T transitively inherits from + * GarbageCollected. Created objects will have additional bytes appended to + * it. Allocated memory would suffice for `sizeof(T) + additional_bytes`. + * + * \param additional_bytes Denotes how many bytes to append to T. + * \param args List of arguments with which an instance of T will be + * constructed. + * \returns an instance of type T. + */ +template +T* MakeGarbageCollected(AllocationHandle& handle, + AdditionalBytes additional_bytes, Args&&... args) { + T* object = MakeGarbageCollectedTrait::Call(handle, additional_bytes, + std::forward(args)...); + PostConstructionCallbackTrait::Call(object); + return object; +} + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_ALLOCATION_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/common.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/common.h new file mode 100644 index 00000000000..b6dbff3dd6f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/common.h @@ -0,0 +1,29 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_COMMON_H_ +#define INCLUDE_CPPGC_COMMON_H_ + +// TODO(chromium:1056170): Remove dependency on v8. +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +/** + * Indicator for the stack state of the embedder. + */ +enum class EmbedderStackState { + /** + * Stack may contain interesting heap pointers. + */ + kMayContainHeapPointers, + /** + * Stack does not contain any interesting heap pointers. + */ + kNoHeapPointers, +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_COMMON_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/cross-thread-persistent.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/cross-thread-persistent.h new file mode 100644 index 00000000000..0a9afdcd2bd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/cross-thread-persistent.h @@ -0,0 +1,413 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_CROSS_THREAD_PERSISTENT_H_ +#define INCLUDE_CPPGC_CROSS_THREAD_PERSISTENT_H_ + +#include + +#include "cppgc/internal/persistent-node.h" +#include "cppgc/internal/pointer-policies.h" +#include "cppgc/persistent.h" +#include "cppgc/visitor.h" + +namespace cppgc { +namespace internal { + +// Wrapper around PersistentBase that allows accessing poisoned memory when +// using ASAN. This is needed as the GC of the heap that owns the value +// of a CTP, may clear it (heap termination, weakness) while the object +// holding the CTP may be poisoned as itself may be deemed dead. +class CrossThreadPersistentBase : public PersistentBase { + public: + CrossThreadPersistentBase() = default; + explicit CrossThreadPersistentBase(const void* raw) : PersistentBase(raw) {} + + V8_CLANG_NO_SANITIZE("address") const void* GetValueFromGC() const { + return raw_; + } + + V8_CLANG_NO_SANITIZE("address") + PersistentNode* GetNodeFromGC() const { return node_; } + + V8_CLANG_NO_SANITIZE("address") + void ClearFromGC() const { + raw_ = nullptr; + node_ = nullptr; + } +}; + +template +class BasicCrossThreadPersistent final : public CrossThreadPersistentBase, + public LocationPolicy, + private WeaknessPolicy, + private CheckingPolicy { + public: + using typename WeaknessPolicy::IsStrongPersistent; + using PointeeType = T; + + ~BasicCrossThreadPersistent() { Clear(); } + + BasicCrossThreadPersistent( + const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc) {} + + BasicCrossThreadPersistent( + std::nullptr_t, const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc) {} + + BasicCrossThreadPersistent( + SentinelPointer s, const SourceLocation& loc = SourceLocation::Current()) + : CrossThreadPersistentBase(s), LocationPolicy(loc) {} + + BasicCrossThreadPersistent( + T* raw, const SourceLocation& loc = SourceLocation::Current()) + : CrossThreadPersistentBase(raw), LocationPolicy(loc) { + if (!IsValid(raw)) return; + PersistentRegionLock guard; + CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw); + SetNode(region.AllocateNode(this, &Trace)); + this->CheckPointer(raw); + } + + class UnsafeCtorTag { + private: + UnsafeCtorTag() = default; + template + friend class BasicCrossThreadPersistent; + }; + + BasicCrossThreadPersistent( + UnsafeCtorTag, T* raw, + const SourceLocation& loc = SourceLocation::Current()) + : CrossThreadPersistentBase(raw), LocationPolicy(loc) { + if (!IsValid(raw)) return; + CrossThreadPersistentRegion& region = this->GetPersistentRegion(raw); + SetNode(region.AllocateNode(this, &Trace)); + this->CheckPointer(raw); + } + + BasicCrossThreadPersistent( + T& raw, const SourceLocation& loc = SourceLocation::Current()) + : BasicCrossThreadPersistent(&raw, loc) {} + + template ::value>> + BasicCrossThreadPersistent( + internal::BasicMember + member, + const SourceLocation& loc = SourceLocation::Current()) + : BasicCrossThreadPersistent(member.Get(), loc) {} + + BasicCrossThreadPersistent( + const BasicCrossThreadPersistent& other, + const SourceLocation& loc = SourceLocation::Current()) + : BasicCrossThreadPersistent(loc) { + // Invoke operator=. + *this = other; + } + + // Heterogeneous ctor. + template ::value>> + BasicCrossThreadPersistent( + const BasicCrossThreadPersistent& other, + const SourceLocation& loc = SourceLocation::Current()) + : BasicCrossThreadPersistent(loc) { + *this = other; + } + + BasicCrossThreadPersistent( + BasicCrossThreadPersistent&& other, + const SourceLocation& loc = SourceLocation::Current()) noexcept { + // Invoke operator=. + *this = std::move(other); + } + + BasicCrossThreadPersistent& operator=( + const BasicCrossThreadPersistent& other) { + PersistentRegionLock guard; + AssignUnsafe(other.Get()); + return *this; + } + + template ::value>> + BasicCrossThreadPersistent& operator=( + const BasicCrossThreadPersistent& other) { + PersistentRegionLock guard; + AssignUnsafe(other.Get()); + return *this; + } + + BasicCrossThreadPersistent& operator=(BasicCrossThreadPersistent&& other) { + if (this == &other) return *this; + Clear(); + PersistentRegionLock guard; + PersistentBase::operator=(std::move(other)); + LocationPolicy::operator=(std::move(other)); + if (!IsValid(GetValue())) return *this; + GetNode()->UpdateOwner(this); + other.SetValue(nullptr); + other.SetNode(nullptr); + this->CheckPointer(Get()); + return *this; + } + + BasicCrossThreadPersistent& operator=(T* other) { + Assign(other); + return *this; + } + + // Assignment from member. + template ::value>> + BasicCrossThreadPersistent& operator=( + internal::BasicMember + member) { + return operator=(member.Get()); + } + + BasicCrossThreadPersistent& operator=(std::nullptr_t) { + Clear(); + return *this; + } + + BasicCrossThreadPersistent& operator=(SentinelPointer s) { + Assign(s); + return *this; + } + + /** + * Returns a pointer to the stored object. + * + * Note: **Not thread-safe.** + * + * \returns a pointer to the stored object. + */ + // CFI cast exemption to allow passing SentinelPointer through T* and support + // heterogeneous assignments between different Member and Persistent handles + // based on their actual types. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") T* Get() const { + return static_cast(const_cast(GetValue())); + } + + /** + * Clears the stored object. + */ + void Clear() { + // Simplified version of `Assign()` to allow calling without a complete type + // `T`. + const void* old_value = GetValue(); + if (IsValid(old_value)) { + PersistentRegionLock guard; + old_value = GetValue(); + // The fast path check (IsValid()) does not acquire the lock. Reload + // the value to ensure the reference has not been cleared. + if (IsValid(old_value)) { + CrossThreadPersistentRegion& region = + this->GetPersistentRegion(old_value); + region.FreeNode(GetNode()); + SetNode(nullptr); + } else { + CPPGC_DCHECK(!GetNode()); + } + } + SetValue(nullptr); + } + + /** + * Returns a pointer to the stored object and releases it. + * + * Note: **Not thread-safe.** + * + * \returns a pointer to the stored object. + */ + T* Release() { + T* result = Get(); + Clear(); + return result; + } + + /** + * Conversio to boolean. + * + * Note: **Not thread-safe.** + * + * \returns true if an actual object has been stored and false otherwise. + */ + explicit operator bool() const { return Get(); } + + /** + * Conversion to object of type T. + * + * Note: **Not thread-safe.** + * + * \returns the object. + */ + operator T*() const { return Get(); } + + /** + * Dereferences the stored object. + * + * Note: **Not thread-safe.** + */ + T* operator->() const { return Get(); } + T& operator*() const { return *Get(); } + + template + BasicCrossThreadPersistent + To() const { + using OtherBasicCrossThreadPersistent = + BasicCrossThreadPersistent; + PersistentRegionLock guard; + return OtherBasicCrossThreadPersistent( + typename OtherBasicCrossThreadPersistent::UnsafeCtorTag(), + static_cast(Get())); + } + + template ::IsStrongPersistent::value>::type> + BasicCrossThreadPersistent + Lock() const { + return BasicCrossThreadPersistent< + U, internal::StrongCrossThreadPersistentPolicy>(*this); + } + + private: + static bool IsValid(const void* ptr) { + return ptr && ptr != kSentinelPointer; + } + + static void Trace(Visitor* v, const void* ptr) { + const auto* handle = static_cast(ptr); + v->TraceRoot(*handle, handle->Location()); + } + + void Assign(T* ptr) { + const void* old_value = GetValue(); + if (IsValid(old_value)) { + PersistentRegionLock guard; + old_value = GetValue(); + // The fast path check (IsValid()) does not acquire the lock. Reload + // the value to ensure the reference has not been cleared. + if (IsValid(old_value)) { + CrossThreadPersistentRegion& region = + this->GetPersistentRegion(old_value); + if (IsValid(ptr) && (®ion == &this->GetPersistentRegion(ptr))) { + SetValue(ptr); + this->CheckPointer(ptr); + return; + } + region.FreeNode(GetNode()); + SetNode(nullptr); + } else { + CPPGC_DCHECK(!GetNode()); + } + } + SetValue(ptr); + if (!IsValid(ptr)) return; + PersistentRegionLock guard; + SetNode(this->GetPersistentRegion(ptr).AllocateNode(this, &Trace)); + this->CheckPointer(ptr); + } + + void AssignUnsafe(T* ptr) { + PersistentRegionLock::AssertLocked(); + const void* old_value = GetValue(); + if (IsValid(old_value)) { + CrossThreadPersistentRegion& region = + this->GetPersistentRegion(old_value); + if (IsValid(ptr) && (®ion == &this->GetPersistentRegion(ptr))) { + SetValue(ptr); + this->CheckPointer(ptr); + return; + } + region.FreeNode(GetNode()); + SetNode(nullptr); + } + SetValue(ptr); + if (!IsValid(ptr)) return; + SetNode(this->GetPersistentRegion(ptr).AllocateNode(this, &Trace)); + this->CheckPointer(ptr); + } + + void ClearFromGC() const { + if (IsValid(GetValueFromGC())) { + WeaknessPolicy::GetPersistentRegion(GetValueFromGC()) + .FreeNode(GetNodeFromGC()); + CrossThreadPersistentBase::ClearFromGC(); + } + } + + // See Get() for details. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") + T* GetFromGC() const { + return static_cast(const_cast(GetValueFromGC())); + } + + friend class cppgc::Visitor; +}; + +template +struct IsWeak< + BasicCrossThreadPersistent> + : std::true_type {}; + +} // namespace internal + +namespace subtle { + +/** + * **DO NOT USE: Has known caveats, see below.** + * + * CrossThreadPersistent allows retaining objects from threads other than the + * thread the owning heap is operating on. + * + * Known caveats: + * - Does not protect the heap owning an object from terminating. + * - Reaching transitively through the graph is unsupported as objects may be + * moved concurrently on the thread owning the object. + */ +template +using CrossThreadPersistent = internal::BasicCrossThreadPersistent< + T, internal::StrongCrossThreadPersistentPolicy>; + +/** + * **DO NOT USE: Has known caveats, see below.** + * + * CrossThreadPersistent allows weakly retaining objects from threads other than + * the thread the owning heap is operating on. + * + * Known caveats: + * - Does not protect the heap owning an object from terminating. + * - Reaching transitively through the graph is unsupported as objects may be + * moved concurrently on the thread owning the object. + */ +template +using WeakCrossThreadPersistent = internal::BasicCrossThreadPersistent< + T, internal::WeakCrossThreadPersistentPolicy>; + +} // namespace subtle +} // namespace cppgc + +#endif // INCLUDE_CPPGC_CROSS_THREAD_PERSISTENT_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/custom-space.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/custom-space.h new file mode 100644 index 00000000000..757c4fde15e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/custom-space.h @@ -0,0 +1,97 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_CUSTOM_SPACE_H_ +#define INCLUDE_CPPGC_CUSTOM_SPACE_H_ + +#include + +namespace cppgc { + +/** + * Index identifying a custom space. + */ +struct CustomSpaceIndex { + constexpr CustomSpaceIndex(size_t value) : value(value) {} // NOLINT + size_t value; +}; + +/** + * Top-level base class for custom spaces. Users must inherit from CustomSpace + * below. + */ +class CustomSpaceBase { + public: + virtual ~CustomSpaceBase() = default; + virtual CustomSpaceIndex GetCustomSpaceIndex() const = 0; + virtual bool IsCompactable() const = 0; +}; + +/** + * Base class custom spaces should directly inherit from. The class inheriting + * from `CustomSpace` must define `kSpaceIndex` as unique space index. These + * indices need for form a sequence starting at 0. + * + * Example: + * \code + * class CustomSpace1 : public CustomSpace { + * public: + * static constexpr CustomSpaceIndex kSpaceIndex = 0; + * }; + * class CustomSpace2 : public CustomSpace { + * public: + * static constexpr CustomSpaceIndex kSpaceIndex = 1; + * }; + * \endcode + */ +template +class CustomSpace : public CustomSpaceBase { + public: + /** + * Compaction is only supported on spaces that manually manage slots + * recording. + */ + static constexpr bool kSupportsCompaction = false; + + CustomSpaceIndex GetCustomSpaceIndex() const final { + return ConcreteCustomSpace::kSpaceIndex; + } + bool IsCompactable() const final { + return ConcreteCustomSpace::kSupportsCompaction; + } +}; + +/** + * User-overridable trait that allows pinning types to custom spaces. + */ +template +struct SpaceTrait { + using Space = void; +}; + +namespace internal { + +template +struct IsAllocatedOnCompactableSpaceImpl { + static constexpr bool value = CustomSpace::kSupportsCompaction; +}; + +template <> +struct IsAllocatedOnCompactableSpaceImpl { + // Non-custom spaces are by default not compactable. + static constexpr bool value = false; +}; + +template +struct IsAllocatedOnCompactableSpace { + public: + static constexpr bool value = + IsAllocatedOnCompactableSpaceImpl::Space>::value; +}; + +} // namespace internal + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_CUSTOM_SPACE_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/default-platform.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/default-platform.h new file mode 100644 index 00000000000..2ccdeddd837 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/default-platform.h @@ -0,0 +1,75 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_DEFAULT_PLATFORM_H_ +#define INCLUDE_CPPGC_DEFAULT_PLATFORM_H_ + +#include +#include + +#include "cppgc/platform.h" +#include "libplatform/libplatform.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +/** + * Platform provided by cppgc. Uses V8's DefaultPlatform provided by + * libplatform internally. Exception: `GetForegroundTaskRunner()`, see below. + */ +class V8_EXPORT DefaultPlatform : public Platform { + public: + /** + * Use this method instead of 'cppgc::InitializeProcess' when using + * 'cppgc::DefaultPlatform'. 'cppgc::DefaultPlatform::InitializeProcess' + * will initialize cppgc and v8 if needed (for non-standalone builds). + * + * \param platform DefaultPlatform instance used to initialize cppgc/v8. + */ + static void InitializeProcess(DefaultPlatform* platform); + + using IdleTaskSupport = v8::platform::IdleTaskSupport; + explicit DefaultPlatform( + int thread_pool_size = 0, + IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled, + std::unique_ptr tracing_controller = {}) + : v8_platform_(v8::platform::NewDefaultPlatform( + thread_pool_size, idle_task_support, + v8::platform::InProcessStackDumping::kDisabled, + std::move(tracing_controller))) {} + + cppgc::PageAllocator* GetPageAllocator() override { + return v8_platform_->GetPageAllocator(); + } + + double MonotonicallyIncreasingTime() override { + return v8_platform_->MonotonicallyIncreasingTime(); + } + + std::shared_ptr GetForegroundTaskRunner() override { + // V8's default platform creates a new task runner when passed the + // `v8::Isolate` pointer the first time. For non-default platforms this will + // require getting the appropriate task runner. + return v8_platform_->GetForegroundTaskRunner(kNoIsolate); + } + + std::unique_ptr PostJob( + cppgc::TaskPriority priority, + std::unique_ptr job_task) override { + return v8_platform_->PostJob(priority, std::move(job_task)); + } + + TracingController* GetTracingController() override { + return v8_platform_->GetTracingController(); + } + + protected: + static constexpr v8::Isolate* kNoIsolate = nullptr; + + std::unique_ptr v8_platform_; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_DEFAULT_PLATFORM_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/ephemeron-pair.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/ephemeron-pair.h new file mode 100644 index 00000000000..e16cf1f0aa2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/ephemeron-pair.h @@ -0,0 +1,30 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_EPHEMERON_PAIR_H_ +#define INCLUDE_CPPGC_EPHEMERON_PAIR_H_ + +#include "cppgc/liveness-broker.h" +#include "cppgc/member.h" + +namespace cppgc { + +/** + * An ephemeron pair is used to conditionally retain an object. + * The `value` will be kept alive only if the `key` is alive. + */ +template +struct EphemeronPair { + EphemeronPair(K* k, V* v) : key(k), value(v) {} + WeakMember key; + Member value; + + void ClearValueIfKeyIsDead(const LivenessBroker& broker) { + if (!broker.IsHeapObjectAlive(key)) value = nullptr; + } +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_EPHEMERON_PAIR_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/explicit-management.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/explicit-management.h new file mode 100644 index 00000000000..cdb6af48586 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/explicit-management.h @@ -0,0 +1,82 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_EXPLICIT_MANAGEMENT_H_ +#define INCLUDE_CPPGC_EXPLICIT_MANAGEMENT_H_ + +#include + +#include "cppgc/allocation.h" +#include "cppgc/internal/logging.h" +#include "cppgc/type-traits.h" + +namespace cppgc { + +class HeapHandle; + +namespace internal { + +V8_EXPORT void FreeUnreferencedObject(HeapHandle&, void*); +V8_EXPORT bool Resize(void*, size_t); + +} // namespace internal + +namespace subtle { + +/** + * Informs the garbage collector that `object` can be immediately reclaimed. The + * destructor may not be invoked immediately but only on next garbage + * collection. + * + * It is up to the embedder to guarantee that no other object holds a reference + * to `object` after calling `FreeUnreferencedObject()`. In case such a + * reference exists, it's use results in a use-after-free. + * + * To aid in using the API, `FreeUnreferencedObject()` may be called from + * destructors on objects that would be reclaimed in the same garbage collection + * cycle. + * + * \param heap_handle The corresponding heap. + * \param object Reference to an object that is of type `GarbageCollected` and + * should be immediately reclaimed. + */ +template +void FreeUnreferencedObject(HeapHandle& heap_handle, T& object) { + static_assert(IsGarbageCollectedTypeV, + "Object must be of type GarbageCollected."); + internal::FreeUnreferencedObject(heap_handle, &object); +} + +/** + * Tries to resize `object` of type `T` with additional bytes on top of + * sizeof(T). Resizing is only useful with trailing inlined storage, see e.g. + * `MakeGarbageCollected(AllocationHandle&, AdditionalBytes)`. + * + * `Resize()` performs growing or shrinking as needed and may skip the operation + * for internal reasons, see return value. + * + * It is up to the embedder to guarantee that in case of shrinking a larger + * object down, the reclaimed area is not used anymore. Any subsequent use + * results in a use-after-free. + * + * The `object` must be live when calling `Resize()`. + * + * \param object Reference to an object that is of type `GarbageCollected` and + * should be resized. + * \param additional_bytes Bytes in addition to sizeof(T) that the object should + * provide. + * \returns true when the operation was successful and the result can be relied + * on, and false otherwise. + */ +template +bool Resize(T& object, AdditionalBytes additional_bytes) { + static_assert(IsGarbageCollectedTypeV, + "Object must be of type GarbageCollected."); + return internal::Resize(&object, sizeof(T) + additional_bytes.value); +} + +} // namespace subtle +} // namespace cppgc + +#endif // INCLUDE_CPPGC_EXPLICIT_MANAGEMENT_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/garbage-collected.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/garbage-collected.h new file mode 100644 index 00000000000..a3839e1baa5 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/garbage-collected.h @@ -0,0 +1,117 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_GARBAGE_COLLECTED_H_ +#define INCLUDE_CPPGC_GARBAGE_COLLECTED_H_ + +#include + +#include "cppgc/internal/api-constants.h" +#include "cppgc/platform.h" +#include "cppgc/trace-trait.h" +#include "cppgc/type-traits.h" + +namespace cppgc { + +class Visitor; + +namespace internal { + +class GarbageCollectedBase { + public: + // Must use MakeGarbageCollected. + void* operator new(size_t) = delete; + void* operator new[](size_t) = delete; + // The garbage collector is taking care of reclaiming the object. Also, + // virtual destructor requires an unambiguous, accessible 'operator delete'. + void operator delete(void*) { +#ifdef V8_ENABLE_CHECKS + internal::Abort(); +#endif // V8_ENABLE_CHECKS + } + void operator delete[](void*) = delete; + + protected: + GarbageCollectedBase() = default; +}; + +} // namespace internal + +/** + * Base class for managed objects. Only descendent types of `GarbageCollected` + * can be constructed using `MakeGarbageCollected()`. Must be inherited from as + * left-most base class. + * + * Types inheriting from GarbageCollected must provide a method of + * signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed + * pointers to the visitor and delegates to garbage-collected base classes. + * The method must be virtual if the type is not directly a child of + * GarbageCollected and marked as final. + * + * \code + * // Example using final class. + * class FinalType final : public GarbageCollected { + * public: + * void Trace(cppgc::Visitor* visitor) const { + * // Dispatch using visitor->Trace(...); + * } + * }; + * + * // Example using non-final base class. + * class NonFinalBase : public GarbageCollected { + * public: + * virtual void Trace(cppgc::Visitor*) const {} + * }; + * + * class FinalChild final : public NonFinalBase { + * public: + * void Trace(cppgc::Visitor* visitor) const final { + * // Dispatch using visitor->Trace(...); + * NonFinalBase::Trace(visitor); + * } + * }; + * \endcode + */ +template +class GarbageCollected : public internal::GarbageCollectedBase { + public: + using IsGarbageCollectedTypeMarker = void; + using ParentMostGarbageCollectedType = T; + + protected: + GarbageCollected() = default; +}; + +/** + * Base class for managed mixin objects. Such objects cannot be constructed + * directly but must be mixed into the inheritance hierarchy of a + * GarbageCollected object. + * + * Types inheriting from GarbageCollectedMixin must override a virtual method + * of signature `void Trace(cppgc::Visitor*) const` that dispatchs all managed + * pointers to the visitor and delegates to base classes. + * + * \code + * class Mixin : public GarbageCollectedMixin { + * public: + * void Trace(cppgc::Visitor* visitor) const override { + * // Dispatch using visitor->Trace(...); + * } + * }; + * \endcode + */ +class GarbageCollectedMixin : public internal::GarbageCollectedBase { + public: + using IsGarbageCollectedMixinTypeMarker = void; + + /** + * This Trace method must be overriden by objects inheriting from + * GarbageCollectedMixin. + */ + virtual void Trace(cppgc::Visitor*) const {} +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_GARBAGE_COLLECTED_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap-consistency.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap-consistency.h new file mode 100644 index 00000000000..8e603d5d8af --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap-consistency.h @@ -0,0 +1,253 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_HEAP_CONSISTENCY_H_ +#define INCLUDE_CPPGC_HEAP_CONSISTENCY_H_ + +#include + +#include "cppgc/internal/write-barrier.h" +#include "cppgc/macros.h" +#include "cppgc/trace-trait.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class HeapHandle; + +namespace subtle { + +/** + * **DO NOT USE: Use the appropriate managed types.** + * + * Consistency helpers that aid in maintaining a consistent internal state of + * the garbage collector. + */ +class HeapConsistency final { + public: + using WriteBarrierParams = internal::WriteBarrier::Params; + using WriteBarrierType = internal::WriteBarrier::Type; + + /** + * Gets the required write barrier type for a specific write. + * + * \param slot Slot containing the pointer to the object. The slot itself + * must reside in an object that has been allocated using + * `MakeGarbageCollected()`. + * \param value The pointer to the object. May be an interior pointer to an + * interface of the actual object. + * \param params Parameters that may be used for actual write barrier calls. + * Only filled if return value indicates that a write barrier is needed. The + * contents of the `params` are an implementation detail. + * \returns whether a write barrier is needed and which barrier to invoke. + */ + static V8_INLINE WriteBarrierType GetWriteBarrierType( + const void* slot, const void* value, WriteBarrierParams& params) { + return internal::WriteBarrier::GetWriteBarrierType(slot, value, params); + } + + /** + * Gets the required write barrier type for a specific write. + * + * \param slot Slot to some part of an object. The object must not necessarily + have been allocated using `MakeGarbageCollected()` but can also live + off-heap or on stack. + * \param params Parameters that may be used for actual write barrier calls. + * Only filled if return value indicates that a write barrier is needed. The + * contents of the `params` are an implementation detail. + * \param callback Callback returning the corresponding heap handle. The + * callback is only invoked if the heap cannot otherwise be figured out. The + * callback must not allocate. + * \returns whether a write barrier is needed and which barrier to invoke. + */ + template + static V8_INLINE WriteBarrierType + GetWriteBarrierType(const void* slot, WriteBarrierParams& params, + HeapHandleCallback callback) { + return internal::WriteBarrier::GetWriteBarrierType(slot, params, callback); + } + + /** + * Gets the required write barrier type for a specific write. + * This version is meant to be used in conjunction with with a marking write + * barrier barrier which doesn't consider the slot. + * + * \param value The pointer to the object. May be an interior pointer to an + * interface of the actual object. + * \param params Parameters that may be used for actual write barrier calls. + * Only filled if return value indicates that a write barrier is needed. The + * contents of the `params` are an implementation detail. + * \returns whether a write barrier is needed and which barrier to invoke. + */ + static V8_INLINE WriteBarrierType + GetWriteBarrierType(const void* value, WriteBarrierParams& params) { + return internal::WriteBarrier::GetWriteBarrierType(value, params); + } + + /** + * Conservative Dijkstra-style write barrier that processes an object if it + * has not yet been processed. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param object The pointer to the object. May be an interior pointer to a + * an interface of the actual object. + */ + static V8_INLINE void DijkstraWriteBarrier(const WriteBarrierParams& params, + const void* object) { + internal::WriteBarrier::DijkstraMarkingBarrier(params, object); + } + + /** + * Conservative Dijkstra-style write barrier that processes a range of + * elements if they have not yet been processed. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param first_element Pointer to the first element that should be processed. + * The slot itself must reside in an object that has been allocated using + * `MakeGarbageCollected()`. + * \param element_size Size of the element in bytes. + * \param number_of_elements Number of elements that should be processed, + * starting with `first_element`. + * \param trace_callback The trace callback that should be invoked for each + * element if necessary. + */ + static V8_INLINE void DijkstraWriteBarrierRange( + const WriteBarrierParams& params, const void* first_element, + size_t element_size, size_t number_of_elements, + TraceCallback trace_callback) { + internal::WriteBarrier::DijkstraMarkingBarrierRange( + params, first_element, element_size, number_of_elements, + trace_callback); + } + + /** + * Steele-style write barrier that re-processes an object if it has already + * been processed. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param object The pointer to the object which must point to an object that + * has been allocated using `MakeGarbageCollected()`. Interior pointers are + * not supported. + */ + static V8_INLINE void SteeleWriteBarrier(const WriteBarrierParams& params, + const void* object) { + internal::WriteBarrier::SteeleMarkingBarrier(params, object); + } + + /** + * Generational barrier for maintaining consistency when running with multiple + * generations. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param slot Slot containing the pointer to the object. The slot itself + * must reside in an object that has been allocated using + * `MakeGarbageCollected()`. + */ + static V8_INLINE void GenerationalBarrier(const WriteBarrierParams& params, + const void* slot) { + internal::WriteBarrier::GenerationalBarrier(params, slot); + } + + private: + HeapConsistency() = delete; +}; + +/** + * Disallows garbage collection finalizations. Any garbage collection triggers + * result in a crash when in this scope. + * + * Note that the garbage collector already covers paths that can lead to garbage + * collections, so user code does not require checking + * `IsGarbageCollectionAllowed()` before allocations. + */ +class V8_EXPORT V8_NODISCARD DisallowGarbageCollectionScope final { + CPPGC_STACK_ALLOCATED(); + + public: + /** + * \returns whether garbage collections are currently allowed. + */ + static bool IsGarbageCollectionAllowed(HeapHandle& heap_handle); + + /** + * Enters a disallow garbage collection scope. Must be paired with `Leave()`. + * Prefer a scope instance of `DisallowGarbageCollectionScope`. + * + * \param heap_handle The corresponding heap. + */ + static void Enter(HeapHandle& heap_handle); + + /** + * Leaves a disallow garbage collection scope. Must be paired with `Enter()`. + * Prefer a scope instance of `DisallowGarbageCollectionScope`. + * + * \param heap_handle The corresponding heap. + */ + static void Leave(HeapHandle& heap_handle); + + /** + * Constructs a scoped object that automatically enters and leaves a disallow + * garbage collection scope based on its lifetime. + * + * \param heap_handle The corresponding heap. + */ + explicit DisallowGarbageCollectionScope(HeapHandle& heap_handle); + ~DisallowGarbageCollectionScope(); + + DisallowGarbageCollectionScope(const DisallowGarbageCollectionScope&) = + delete; + DisallowGarbageCollectionScope& operator=( + const DisallowGarbageCollectionScope&) = delete; + + private: + HeapHandle& heap_handle_; +}; + +/** + * Avoids invoking garbage collection finalizations. Already running garbage + * collection phase are unaffected by this scope. + * + * Should only be used temporarily as the scope has an impact on memory usage + * and follow up garbage collections. + */ +class V8_EXPORT V8_NODISCARD NoGarbageCollectionScope final { + CPPGC_STACK_ALLOCATED(); + + public: + /** + * Enters a no garbage collection scope. Must be paired with `Leave()`. Prefer + * a scope instance of `NoGarbageCollectionScope`. + * + * \param heap_handle The corresponding heap. + */ + static void Enter(HeapHandle& heap_handle); + + /** + * Leaves a no garbage collection scope. Must be paired with `Enter()`. Prefer + * a scope instance of `NoGarbageCollectionScope`. + * + * \param heap_handle The corresponding heap. + */ + static void Leave(HeapHandle& heap_handle); + + /** + * Constructs a scoped object that automatically enters and leaves a no + * garbage collection scope based on its lifetime. + * + * \param heap_handle The corresponding heap. + */ + explicit NoGarbageCollectionScope(HeapHandle& heap_handle); + ~NoGarbageCollectionScope(); + + NoGarbageCollectionScope(const NoGarbageCollectionScope&) = delete; + NoGarbageCollectionScope& operator=(const NoGarbageCollectionScope&) = delete; + + private: + HeapHandle& heap_handle_; +}; + +} // namespace subtle +} // namespace cppgc + +#endif // INCLUDE_CPPGC_HEAP_CONSISTENCY_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap-state.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap-state.h new file mode 100644 index 00000000000..3fd6b54a8a2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap-state.h @@ -0,0 +1,70 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_HEAP_STATE_H_ +#define INCLUDE_CPPGC_HEAP_STATE_H_ + +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class HeapHandle; + +namespace subtle { + +/** + * Helpers to peek into heap-internal state. + */ +class V8_EXPORT HeapState final { + public: + /** + * Returns whether the garbage collector is marking. This API is experimental + * and is expected to be removed in future. + * + * \param heap_handle The corresponding heap. + * \returns true if the garbage collector is currently marking, and false + * otherwise. + */ + static bool IsMarking(const HeapHandle& heap_handle); + + /* + * Returns whether the garbage collector is sweeping. This API is experimental + * and is expected to be removed in future. + * + * \param heap_handle The corresponding heap. + * \returns true if the garbage collector is currently sweeping, and false + * otherwise. + */ + static bool IsSweeping(const HeapHandle& heap_handle); + + /** + * Returns whether the garbage collector is in the atomic pause, i.e., the + * mutator is stopped from running. This API is experimental and is expected + * to be removed in future. + * + * \param heap_handle The corresponding heap. + * \returns true if the garbage collector is currently in the atomic pause, + * and false otherwise. + */ + static bool IsInAtomicPause(const HeapHandle& heap_handle); + + /** + * Returns whether the last garbage collection was finalized conservatively + * (i.e., with a non-empty stack). This API is experimental and is expected to + * be removed in future. + * + * \param heap_handle The corresponding heap. + * \returns true if the last garbage collection was finalized conservatively, + * and false otherwise. + */ + static bool PreviousGCWasConservative(const HeapHandle& heap_handle); + + private: + HeapState() = delete; +}; + +} // namespace subtle +} // namespace cppgc + +#endif // INCLUDE_CPPGC_HEAP_STATE_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap-statistics.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap-statistics.h new file mode 100644 index 00000000000..8e626596e5b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap-statistics.h @@ -0,0 +1,120 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_HEAP_STATISTICS_H_ +#define INCLUDE_CPPGC_HEAP_STATISTICS_H_ + +#include +#include +#include +#include + +namespace cppgc { + +/** + * `HeapStatistics` contains memory consumption and utilization statistics for a + * cppgc heap. + */ +struct HeapStatistics final { + /** + * Specifies the detail level of the heap statistics. Brief statistics contain + * only the top-level allocated and used memory statistics for the entire + * heap. Detailed statistics also contain a break down per space and page, as + * well as freelist statistics and object type histograms. Note that used + * memory reported by brief statistics and detailed statistics might differ + * slightly. + */ + enum DetailLevel : uint8_t { + kBrief, + kDetailed, + }; + + /** + * Object statistics for a single type. + */ + struct ObjectStatsEntry { + /** + * Number of allocated bytes. + */ + size_t allocated_bytes; + /** + * Number of allocated objects. + */ + size_t object_count; + }; + + /** + * Page granularity statistics. For each page the statistics record the + * allocated memory size and overall used memory size for the page. + */ + struct PageStatistics { + /** Overall committed amount of memory for the page. */ + size_t committed_size_bytes = 0; + /** Resident amount of memory held by the page. */ + size_t resident_size_bytes = 0; + /** Amount of memory actually used on the page. */ + size_t used_size_bytes = 0; + /** Statistics for object allocated on the page. Filled only when + * NameProvider::HideInternalNames() is false. */ + std::vector object_statistics; + }; + + /** + * Statistics of the freelist (used only in non-large object spaces). For + * each bucket in the freelist the statistics record the bucket size, the + * number of freelist entries in the bucket, and the overall allocated memory + * consumed by these freelist entries. + */ + struct FreeListStatistics { + /** bucket sizes in the freelist. */ + std::vector bucket_size; + /** number of freelist entries per bucket. */ + std::vector free_count; + /** memory size consumed by freelist entries per size. */ + std::vector free_size; + }; + + /** + * Space granularity statistics. For each space the statistics record the + * space name, the amount of allocated memory and overall used memory for the + * space. The statistics also contain statistics for each of the space's + * pages, its freelist and the objects allocated on the space. + */ + struct SpaceStatistics { + /** The space name */ + std::string name; + /** Overall committed amount of memory for the heap. */ + size_t committed_size_bytes = 0; + /** Resident amount of memory held by the heap. */ + size_t resident_size_bytes = 0; + /** Amount of memory actually used on the space. */ + size_t used_size_bytes = 0; + /** Statistics for each of the pages in the space. */ + std::vector page_stats; + /** Statistics for the freelist of the space. */ + FreeListStatistics free_list_stats; + }; + + /** Overall committed amount of memory for the heap. */ + size_t committed_size_bytes = 0; + /** Resident amount of memory help by the heap. */ + size_t resident_size_bytes = 0; + /** Amount of memory actually used on the heap. */ + size_t used_size_bytes = 0; + /** Detail level of this HeapStatistics. */ + DetailLevel detail_level; + + /** Statistics for each of the spaces in the heap. Filled only when + * `detail_level` is `DetailLevel::kDetailed`. */ + std::vector space_stats; + + /** + * Vector of `cppgc::GarbageCollected` type names. + */ + std::vector type_names; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_HEAP_STATISTICS_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap.h new file mode 100644 index 00000000000..136c4fb44d0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/heap.h @@ -0,0 +1,201 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_HEAP_H_ +#define INCLUDE_CPPGC_HEAP_H_ + +#include +#include +#include +#include + +#include "cppgc/common.h" +#include "cppgc/custom-space.h" +#include "cppgc/platform.h" +#include "v8config.h" // NOLINT(build/include_directory) + +/** + * cppgc - A C++ garbage collection library. + */ +namespace cppgc { + +class AllocationHandle; + +/** + * Implementation details of cppgc. Those details are considered internal and + * may change at any point in time without notice. Users should never rely on + * the contents of this namespace. + */ +namespace internal { +class Heap; +} // namespace internal + +/** + * Used for additional heap APIs. + */ +class HeapHandle; + +class V8_EXPORT Heap { + public: + /** + * Specifies the stack state the embedder is in. + */ + using StackState = EmbedderStackState; + + /** + * Specifies whether conservative stack scanning is supported. + */ + enum class StackSupport : uint8_t { + /** + * Conservative stack scan is supported. + */ + kSupportsConservativeStackScan, + /** + * Conservative stack scan is not supported. Embedders may use this option + * when using custom infrastructure that is unsupported by the library. + */ + kNoConservativeStackScan, + }; + + /** + * Specifies supported marking types + */ + enum class MarkingType : uint8_t { + /** + * Atomic stop-the-world marking. This option does not require any write + * barriers but is the most intrusive in terms of jank. + */ + kAtomic, + /** + * Incremental marking, i.e. interleave marking is the rest of the + * application on the same thread. + */ + kIncremental, + /** + * Incremental and concurrent marking. + */ + kIncrementalAndConcurrent + }; + + /** + * Specifies supported sweeping types + */ + enum class SweepingType : uint8_t { + /** + * Atomic stop-the-world sweeping. All of sweeping is performed at once. + */ + kAtomic, + /** + * Incremental and concurrent sweeping. Sweeping is split and interleaved + * with the rest of the application. + */ + kIncrementalAndConcurrent + }; + + /** + * Constraints for a Heap setup. + */ + struct ResourceConstraints { + /** + * Allows the heap to grow to some initial size in bytes before triggering + * garbage collections. This is useful when it is known that applications + * need a certain minimum heap to run to avoid repeatedly invoking the + * garbage collector when growing the heap. + */ + size_t initial_heap_size_bytes = 0; + }; + + /** + * Options specifying Heap properties (e.g. custom spaces) when initializing a + * heap through `Heap::Create()`. + */ + struct HeapOptions { + /** + * Creates reasonable defaults for instantiating a Heap. + * + * \returns the HeapOptions that can be passed to `Heap::Create()`. + */ + static HeapOptions Default() { return {}; } + + /** + * Custom spaces added to heap are required to have indices forming a + * numbered sequence starting at 0, i.e., their `kSpaceIndex` must + * correspond to the index they reside in the vector. + */ + std::vector> custom_spaces; + + /** + * Specifies whether conservative stack scan is supported. When conservative + * stack scan is not supported, the collector may try to invoke + * garbage collections using non-nestable task, which are guaranteed to have + * no interesting stack, through the provided Platform. If such tasks are + * not supported by the Platform, the embedder must take care of invoking + * the GC through `ForceGarbageCollectionSlow()`. + */ + StackSupport stack_support = StackSupport::kSupportsConservativeStackScan; + + /** + * Specifies which types of marking are supported by the heap. + */ + MarkingType marking_support = MarkingType::kIncrementalAndConcurrent; + + /** + * Specifies which types of sweeping are supported by the heap. + */ + SweepingType sweeping_support = SweepingType::kIncrementalAndConcurrent; + + /** + * Resource constraints specifying various properties that the internal + * GC scheduler follows. + */ + ResourceConstraints resource_constraints; + }; + + /** + * Creates a new heap that can be used for object allocation. + * + * \param platform implemented and provided by the embedder. + * \param options HeapOptions specifying various properties for the Heap. + * \returns a new Heap instance. + */ + static std::unique_ptr Create( + std::shared_ptr platform, + HeapOptions options = HeapOptions::Default()); + + virtual ~Heap() = default; + + /** + * Forces garbage collection. + * + * \param source String specifying the source (or caller) triggering a + * forced garbage collection. + * \param reason String specifying the reason for the forced garbage + * collection. + * \param stack_state The embedder stack state, see StackState. + */ + void ForceGarbageCollectionSlow( + const char* source, const char* reason, + StackState stack_state = StackState::kMayContainHeapPointers); + + /** + * \returns the opaque handle for allocating objects using + * `MakeGarbageCollected()`. + */ + AllocationHandle& GetAllocationHandle(); + + /** + * \returns the opaque heap handle which may be used to refer to this heap in + * other APIs. Valid as long as the underlying `Heap` is alive. + */ + HeapHandle& GetHeapHandle(); + + private: + Heap() = default; + + friend class internal::Heap; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_HEAP_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/api-constants.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/api-constants.h new file mode 100644 index 00000000000..7253a470893 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/api-constants.h @@ -0,0 +1,47 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_API_CONSTANTS_H_ +#define INCLUDE_CPPGC_INTERNAL_API_CONSTANTS_H_ + +#include +#include + +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { +namespace internal { + +// Embedders should not rely on this code! + +// Internal constants to avoid exposing internal types on the API surface. +namespace api_constants { + +constexpr size_t kKB = 1024; +constexpr size_t kMB = kKB * 1024; +constexpr size_t kGB = kMB * 1024; + +// Offset of the uint16_t bitfield from the payload contaning the +// in-construction bit. This is subtracted from the payload pointer to get +// to the right bitfield. +static constexpr size_t kFullyConstructedBitFieldOffsetFromPayload = + 2 * sizeof(uint16_t); +// Mask for in-construction bit. +static constexpr uint16_t kFullyConstructedBitMask = uint16_t{1}; + +static constexpr size_t kPageSize = size_t{1} << 17; + +static constexpr size_t kLargeObjectSizeThreshold = kPageSize / 2; + +#if defined(CPPGC_CAGED_HEAP) +constexpr size_t kCagedHeapReservationSize = static_cast(4) * kGB; +constexpr size_t kCagedHeapReservationAlignment = kCagedHeapReservationSize; +#endif + +} // namespace api_constants + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_API_CONSTANTS_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/atomic-entry-flag.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/atomic-entry-flag.h new file mode 100644 index 00000000000..5a7d3b8f8ac --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/atomic-entry-flag.h @@ -0,0 +1,48 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_ATOMIC_ENTRY_FLAG_H_ +#define INCLUDE_CPPGC_INTERNAL_ATOMIC_ENTRY_FLAG_H_ + +#include + +namespace cppgc { +namespace internal { + +// A flag which provides a fast check whether a scope may be entered on the +// current thread, without needing to access thread-local storage or mutex. Can +// have false positives (i.e., spuriously report that it might be entered), so +// it is expected that this will be used in tandem with a precise check that the +// scope is in fact entered on that thread. +// +// Example: +// g_frobnicating_flag.MightBeEntered() && +// ThreadLocalFrobnicator().IsFrobnicating() +// +// Relaxed atomic operations are sufficient, since: +// - all accesses remain atomic +// - each thread must observe its own operations in order +// - no thread ever exits the flag more times than it enters (if used correctly) +// And so if a thread observes zero, it must be because it has observed an equal +// number of exits as entries. +class AtomicEntryFlag final { + public: + void Enter() { entries_.fetch_add(1, std::memory_order_relaxed); } + void Exit() { entries_.fetch_sub(1, std::memory_order_relaxed); } + + // Returns false only if the current thread is not between a call to Enter + // and a call to Exit. Returns true if this thread or another thread may + // currently be in the scope guarded by this flag. + bool MightBeEntered() const { + return entries_.load(std::memory_order_relaxed) != 0; + } + + private: + std::atomic_int entries_{0}; +}; + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_ATOMIC_ENTRY_FLAG_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/caged-heap-local-data.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/caged-heap-local-data.h new file mode 100644 index 00000000000..1fa60b69536 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/caged-heap-local-data.h @@ -0,0 +1,68 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_CAGED_HEAP_LOCAL_DATA_H_ +#define INCLUDE_CPPGC_INTERNAL_CAGED_HEAP_LOCAL_DATA_H_ + +#include + +#include "cppgc/internal/api-constants.h" +#include "cppgc/internal/logging.h" +#include "cppgc/platform.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { +namespace internal { + +class HeapBase; + +#if defined(CPPGC_YOUNG_GENERATION) + +// AgeTable contains entries that correspond to 4KB memory regions. Each entry +// can be in one of three states: kOld, kYoung or kUnknown. +class AgeTable final { + static constexpr size_t kGranularityBits = 12; // 4KiB per byte. + + public: + enum class Age : uint8_t { kOld, kYoung, kUnknown }; + + static constexpr size_t kEntrySizeInBytes = 1 << kGranularityBits; + + Age& operator[](uintptr_t offset) { return table_[entry(offset)]; } + Age operator[](uintptr_t offset) const { return table_[entry(offset)]; } + + void Reset(PageAllocator* allocator); + + private: + static constexpr size_t kAgeTableSize = + api_constants::kCagedHeapReservationSize >> kGranularityBits; + + size_t entry(uintptr_t offset) const { + const size_t entry = offset >> kGranularityBits; + CPPGC_DCHECK(table_.size() > entry); + return entry; + } + + std::array table_; +}; + +static_assert(sizeof(AgeTable) == 1 * api_constants::kMB, + "Size of AgeTable is 1MB"); + +#endif // CPPGC_YOUNG_GENERATION + +struct CagedHeapLocalData final { + explicit CagedHeapLocalData(HeapBase* heap_base) : heap_base(heap_base) {} + + bool is_incremental_marking_in_progress = false; + HeapBase* heap_base = nullptr; +#if defined(CPPGC_YOUNG_GENERATION) + AgeTable age_table; +#endif +}; + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_CAGED_HEAP_LOCAL_DATA_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/compiler-specific.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/compiler-specific.h new file mode 100644 index 00000000000..595b6398cb7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/compiler-specific.h @@ -0,0 +1,38 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_ +#define INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_ + +namespace cppgc { + +#if defined(__has_attribute) +#define CPPGC_HAS_ATTRIBUTE(FEATURE) __has_attribute(FEATURE) +#else +#define CPPGC_HAS_ATTRIBUTE(FEATURE) 0 +#endif + +#if defined(__has_cpp_attribute) +#define CPPGC_HAS_CPP_ATTRIBUTE(FEATURE) __has_cpp_attribute(FEATURE) +#else +#define CPPGC_HAS_CPP_ATTRIBUTE(FEATURE) 0 +#endif + +// [[no_unique_address]] comes in C++20 but supported in clang with -std >= +// c++11. +#if CPPGC_HAS_CPP_ATTRIBUTE(no_unique_address) +#define CPPGC_NO_UNIQUE_ADDRESS [[no_unique_address]] +#else +#define CPPGC_NO_UNIQUE_ADDRESS +#endif + +#if CPPGC_HAS_ATTRIBUTE(unused) +#define CPPGC_UNUSED __attribute__((unused)) +#else +#define CPPGC_UNUSED +#endif + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_COMPILER_SPECIFIC_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/finalizer-trait.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/finalizer-trait.h new file mode 100644 index 00000000000..a95126591cb --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/finalizer-trait.h @@ -0,0 +1,90 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_FINALIZER_TRAIT_H_ +#define INCLUDE_CPPGC_INTERNAL_FINALIZER_TRAIT_H_ + +#include + +#include "cppgc/type-traits.h" + +namespace cppgc { +namespace internal { + +using FinalizationCallback = void (*)(void*); + +template +struct HasFinalizeGarbageCollectedObject : std::false_type {}; + +template +struct HasFinalizeGarbageCollectedObject< + T, void_t().FinalizeGarbageCollectedObject())>> + : std::true_type {}; + +// The FinalizerTraitImpl specifies how to finalize objects. +template +struct FinalizerTraitImpl; + +template +struct FinalizerTraitImpl { + private: + // Dispatch to custom FinalizeGarbageCollectedObject(). + struct Custom { + static void Call(void* obj) { + static_cast(obj)->FinalizeGarbageCollectedObject(); + } + }; + + // Dispatch to regular destructor. + struct Destructor { + static void Call(void* obj) { static_cast(obj)->~T(); } + }; + + using FinalizeImpl = + std::conditional_t::value, Custom, + Destructor>; + + public: + static void Finalize(void* obj) { + static_assert(sizeof(T), "T must be fully defined"); + FinalizeImpl::Call(obj); + } +}; + +template +struct FinalizerTraitImpl { + static void Finalize(void* obj) { + static_assert(sizeof(T), "T must be fully defined"); + } +}; + +// The FinalizerTrait is used to determine if a type requires finalization and +// what finalization means. +template +struct FinalizerTrait { + private: + // Object has a finalizer if it has + // - a custom FinalizeGarbageCollectedObject method, or + // - a destructor. + static constexpr bool kNonTrivialFinalizer = + internal::HasFinalizeGarbageCollectedObject::value || + !std::is_trivially_destructible::type>::value; + + static void Finalize(void* obj) { + internal::FinalizerTraitImpl::Finalize(obj); + } + + public: + // The callback used to finalize an object of type T. + static constexpr FinalizationCallback kCallback = + kNonTrivialFinalizer ? Finalize : nullptr; +}; + +template +constexpr FinalizationCallback FinalizerTrait::kCallback; + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_FINALIZER_TRAIT_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/gc-info.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/gc-info.h new file mode 100644 index 00000000000..0830b194909 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/gc-info.h @@ -0,0 +1,76 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_GC_INFO_H_ +#define INCLUDE_CPPGC_INTERNAL_GC_INFO_H_ + +#include +#include +#include + +#include "cppgc/internal/finalizer-trait.h" +#include "cppgc/internal/name-trait.h" +#include "cppgc/trace-trait.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { +namespace internal { + +using GCInfoIndex = uint16_t; + +// Acquires a new GC info object and returns the index. In addition, also +// updates `registered_index` atomically. +V8_EXPORT GCInfoIndex +EnsureGCInfoIndex(std::atomic& registered_index, + FinalizationCallback, TraceCallback, NameCallback, bool); + +// Fold types based on finalizer behavior. Note that finalizer characteristics +// align with trace behavior, i.e., destructors are virtual when trace methods +// are and vice versa. +template +struct GCInfoFolding { + static constexpr bool kHasVirtualDestructorAtBase = + std::has_virtual_destructor::value; + static constexpr bool kBothTypesAreTriviallyDestructible = + std::is_trivially_destructible::value && + std::is_trivially_destructible::value; + static constexpr bool kHasCustomFinalizerDispatchAtBase = + internal::HasFinalizeGarbageCollectedObject< + ParentMostGarbageCollectedType>::value; +#ifdef CPPGC_SUPPORTS_OBJECT_NAMES + static constexpr bool kWantsDetailedObjectNames = true; +#else // !CPPGC_SUPPORTS_OBJECT_NAMES + static constexpr bool kWantsDetailedObjectNames = false; +#endif // !CPPGC_SUPPORTS_OBJECT_NAMES + + // Folding would regresses name resolution when deriving names from C++ + // class names as it would just folds a name to the base class name. + using ResultType = std::conditional_t<(kHasVirtualDestructorAtBase || + kBothTypesAreTriviallyDestructible || + kHasCustomFinalizerDispatchAtBase) && + !kWantsDetailedObjectNames, + ParentMostGarbageCollectedType, T>; +}; + +// Trait determines how the garbage collector treats objects wrt. to traversing, +// finalization, and naming. +template +struct GCInfoTrait final { + static GCInfoIndex Index() { + static_assert(sizeof(T), "T must be fully defined"); + static std::atomic + registered_index; // Uses zero initialization. + const GCInfoIndex index = registered_index.load(std::memory_order_acquire); + return index ? index + : EnsureGCInfoIndex( + registered_index, FinalizerTrait::kCallback, + TraceTrait::Trace, NameTrait::GetName, + std::is_polymorphic::value); + } +}; + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_GC_INFO_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/logging.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/logging.h new file mode 100644 index 00000000000..79beaef7d4f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/logging.h @@ -0,0 +1,50 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_LOGGING_H_ +#define INCLUDE_CPPGC_INTERNAL_LOGGING_H_ + +#include "cppgc/source-location.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { +namespace internal { + +void V8_EXPORT DCheckImpl(const char*, + const SourceLocation& = SourceLocation::Current()); +[[noreturn]] void V8_EXPORT +FatalImpl(const char*, const SourceLocation& = SourceLocation::Current()); + +// Used to ignore -Wunused-variable. +template +struct EatParams {}; + +#if DEBUG +#define CPPGC_DCHECK_MSG(condition, message) \ + do { \ + if (V8_UNLIKELY(!(condition))) { \ + ::cppgc::internal::DCheckImpl(message); \ + } \ + } while (false) +#else +#define CPPGC_DCHECK_MSG(condition, message) \ + (static_cast(::cppgc::internal::EatParams(condition), message)>{})) +#endif + +#define CPPGC_DCHECK(condition) CPPGC_DCHECK_MSG(condition, #condition) + +#define CPPGC_CHECK_MSG(condition, message) \ + do { \ + if (V8_UNLIKELY(!(condition))) { \ + ::cppgc::internal::FatalImpl(message); \ + } \ + } while (false) + +#define CPPGC_CHECK(condition) CPPGC_CHECK_MSG(condition, #condition) + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_LOGGING_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/name-trait.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/name-trait.h new file mode 100644 index 00000000000..2e2da1eab4a --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/name-trait.h @@ -0,0 +1,111 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_NAME_TRAIT_H_ +#define INCLUDE_CPPGC_INTERNAL_NAME_TRAIT_H_ + +#include + +#include "cppgc/name-provider.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { +namespace internal { + +#if CPPGC_SUPPORTS_OBJECT_NAMES && defined(__clang__) +#define CPPGC_SUPPORTS_COMPILE_TIME_TYPENAME 1 + +// Provides constexpr c-string storage for a name of fixed |Size| characters. +// Automatically appends terminating 0 byte. +template +struct NameBuffer { + char name[Size + 1]{}; + + static constexpr NameBuffer FromCString(const char* str) { + NameBuffer result; + for (size_t i = 0; i < Size; ++i) result.name[i] = str[i]; + result.name[Size] = 0; + return result; + } +}; + +template +const char* GetTypename() { + static constexpr char kSelfPrefix[] = + "const char *cppgc::internal::GetTypename() [T ="; + static_assert(__builtin_strncmp(__PRETTY_FUNCTION__, kSelfPrefix, + sizeof(kSelfPrefix) - 1) == 0, + "The prefix must match"); + static constexpr const char* kTypenameStart = + __PRETTY_FUNCTION__ + sizeof(kSelfPrefix); + static constexpr size_t kTypenameSize = + __builtin_strlen(__PRETTY_FUNCTION__) - sizeof(kSelfPrefix) - 1; + // NameBuffer is an indirection that is needed to make sure that only a + // substring of __PRETTY_FUNCTION__ gets materialized in the binary. + static constexpr auto buffer = + NameBuffer::FromCString(kTypenameStart); + return buffer.name; +} + +#else +#define CPPGC_SUPPORTS_COMPILE_TIME_TYPENAME 0 +#endif + +struct HeapObjectName { + const char* value; + bool name_was_hidden; +}; + +class V8_EXPORT NameTraitBase { + protected: + static HeapObjectName GetNameFromTypeSignature(const char*); +}; + +// Trait that specifies how the garbage collector retrieves the name for a +// given object. +template +class NameTrait final : public NameTraitBase { + public: + static HeapObjectName GetName(const void* obj) { + return GetNameFor(static_cast(obj)); + } + + private: + static HeapObjectName GetNameFor(const NameProvider* name_provider) { + return {name_provider->GetHumanReadableName(), false}; + } + + static HeapObjectName GetNameFor(...) { +#if CPPGC_SUPPORTS_COMPILE_TIME_TYPENAME + return {GetTypename(), false}; +#elif CPPGC_SUPPORTS_OBJECT_NAMES + +#if defined(V8_CC_GNU) +#define PRETTY_FUNCTION_VALUE __PRETTY_FUNCTION__ +#elif defined(V8_CC_MSVC) +#define PRETTY_FUNCTION_VALUE __FUNCSIG__ +#else +#define PRETTY_FUNCTION_VALUE nullptr +#endif + + static const HeapObjectName leaky_name = + GetNameFromTypeSignature(PRETTY_FUNCTION_VALUE); + return {leaky_name, false}; + +#undef PRETTY_FUNCTION_VALUE + +#else // !CPPGC_SUPPORTS_OBJECT_NAMES + return {NameProvider::kHiddenName, true}; +#endif // !CPPGC_SUPPORTS_OBJECT_NAMES + } +}; + +using NameCallback = HeapObjectName (*)(const void*); + +} // namespace internal +} // namespace cppgc + +#undef CPPGC_SUPPORTS_COMPILE_TIME_TYPENAME + +#endif // INCLUDE_CPPGC_INTERNAL_NAME_TRAIT_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/persistent-node.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/persistent-node.h new file mode 100644 index 00000000000..b5dba476a47 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/persistent-node.h @@ -0,0 +1,172 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_ +#define INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_ + +#include +#include +#include + +#include "cppgc/internal/logging.h" +#include "cppgc/trace-trait.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class Visitor; + +namespace internal { + +class CrossThreadPersistentRegion; + +// PersistentNode represents a variant of two states: +// 1) traceable node with a back pointer to the Persistent object; +// 2) freelist entry. +class PersistentNode final { + public: + PersistentNode() = default; + + PersistentNode(const PersistentNode&) = delete; + PersistentNode& operator=(const PersistentNode&) = delete; + + void InitializeAsUsedNode(void* owner, TraceCallback trace) { + CPPGC_DCHECK(trace); + owner_ = owner; + trace_ = trace; + } + + void InitializeAsFreeNode(PersistentNode* next) { + next_ = next; + trace_ = nullptr; + } + + void UpdateOwner(void* owner) { + CPPGC_DCHECK(IsUsed()); + owner_ = owner; + } + + PersistentNode* FreeListNext() const { + CPPGC_DCHECK(!IsUsed()); + return next_; + } + + void Trace(Visitor* visitor) const { + CPPGC_DCHECK(IsUsed()); + trace_(visitor, owner_); + } + + bool IsUsed() const { return trace_; } + + void* owner() const { + CPPGC_DCHECK(IsUsed()); + return owner_; + } + + private: + // PersistentNode acts as a designated union: + // If trace_ != nullptr, owner_ points to the corresponding Persistent handle. + // Otherwise, next_ points to the next freed PersistentNode. + union { + void* owner_ = nullptr; + PersistentNode* next_; + }; + TraceCallback trace_ = nullptr; +}; + +class V8_EXPORT PersistentRegion { + using PersistentNodeSlots = std::array; + + public: + PersistentRegion() = default; + // Clears Persistent fields to avoid stale pointers after heap teardown. + ~PersistentRegion(); + + PersistentRegion(const PersistentRegion&) = delete; + PersistentRegion& operator=(const PersistentRegion&) = delete; + + PersistentNode* AllocateNode(void* owner, TraceCallback trace) { + if (!free_list_head_) { + EnsureNodeSlots(); + } + PersistentNode* node = free_list_head_; + free_list_head_ = free_list_head_->FreeListNext(); + CPPGC_DCHECK(!node->IsUsed()); + node->InitializeAsUsedNode(owner, trace); + nodes_in_use_++; + return node; + } + + void FreeNode(PersistentNode* node) { + CPPGC_DCHECK(node); + CPPGC_DCHECK(node->IsUsed()); + node->InitializeAsFreeNode(free_list_head_); + free_list_head_ = node; + CPPGC_DCHECK(nodes_in_use_ > 0); + nodes_in_use_--; + } + + void Trace(Visitor*); + + size_t NodesInUse() const; + + void ClearAllUsedNodes(); + + private: + void EnsureNodeSlots(); + + template + void ClearAllUsedNodes(); + + std::vector> nodes_; + PersistentNode* free_list_head_ = nullptr; + size_t nodes_in_use_ = 0; + + friend class CrossThreadPersistentRegion; +}; + +// CrossThreadPersistent uses PersistentRegion but protects it using this lock +// when needed. +class V8_EXPORT PersistentRegionLock final { + public: + PersistentRegionLock(); + ~PersistentRegionLock(); + + static void AssertLocked(); +}; + +// Variant of PersistentRegion that checks whether the PersistentRegionLock is +// locked. +class V8_EXPORT CrossThreadPersistentRegion final : protected PersistentRegion { + public: + CrossThreadPersistentRegion() = default; + // Clears Persistent fields to avoid stale pointers after heap teardown. + ~CrossThreadPersistentRegion(); + + CrossThreadPersistentRegion(const CrossThreadPersistentRegion&) = delete; + CrossThreadPersistentRegion& operator=(const CrossThreadPersistentRegion&) = + delete; + + V8_INLINE PersistentNode* AllocateNode(void* owner, TraceCallback trace) { + PersistentRegionLock::AssertLocked(); + return PersistentRegion::AllocateNode(owner, trace); + } + + V8_INLINE void FreeNode(PersistentNode* node) { + PersistentRegionLock::AssertLocked(); + PersistentRegion::FreeNode(node); + } + + void Trace(Visitor*); + + size_t NodesInUse() const; + + void ClearAllUsedNodes(); +}; + +} // namespace internal + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_PERSISTENT_NODE_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/pointer-policies.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/pointer-policies.h new file mode 100644 index 00000000000..cdf0bb693d6 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/pointer-policies.h @@ -0,0 +1,175 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_ +#define INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_ + +#include +#include + +#include "cppgc/internal/write-barrier.h" +#include "cppgc/sentinel-pointer.h" +#include "cppgc/source-location.h" +#include "cppgc/type-traits.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { +namespace internal { + +class HeapBase; +class PersistentRegion; +class CrossThreadPersistentRegion; + +// Tags to distinguish between strong and weak member types. +class StrongMemberTag; +class WeakMemberTag; +class UntracedMemberTag; + +struct DijkstraWriteBarrierPolicy { + static void InitializingBarrier(const void*, const void*) { + // Since in initializing writes the source object is always white, having no + // barrier doesn't break the tri-color invariant. + } + static void AssigningBarrier(const void* slot, const void* value) { + WriteBarrier::Params params; + switch (WriteBarrier::GetWriteBarrierType(slot, value, params)) { + case WriteBarrier::Type::kGenerational: + WriteBarrier::GenerationalBarrier(params, slot); + break; + case WriteBarrier::Type::kMarking: + WriteBarrier::DijkstraMarkingBarrier(params, value); + break; + case WriteBarrier::Type::kNone: + break; + } + } +}; + +struct NoWriteBarrierPolicy { + static void InitializingBarrier(const void*, const void*) {} + static void AssigningBarrier(const void*, const void*) {} +}; + +class V8_EXPORT EnabledCheckingPolicy { + protected: + template + void CheckPointer(const T* ptr) { + if (!ptr || (kSentinelPointer == ptr)) return; + + CheckPointersImplTrampoline::Call(this, ptr); + } + + private: + void CheckPointerImpl(const void* ptr, bool points_to_payload); + + template > + struct CheckPointersImplTrampoline { + static void Call(EnabledCheckingPolicy* policy, const T* ptr) { + policy->CheckPointerImpl(ptr, false); + } + }; + + template + struct CheckPointersImplTrampoline { + static void Call(EnabledCheckingPolicy* policy, const T* ptr) { + policy->CheckPointerImpl(ptr, IsGarbageCollectedTypeV); + } + }; + + const HeapBase* heap_ = nullptr; +}; + +class DisabledCheckingPolicy { + protected: + void CheckPointer(const void*) {} +}; + +#if V8_ENABLE_CHECKS +using DefaultMemberCheckingPolicy = EnabledCheckingPolicy; +using DefaultPersistentCheckingPolicy = EnabledCheckingPolicy; +#else +using DefaultMemberCheckingPolicy = DisabledCheckingPolicy; +using DefaultPersistentCheckingPolicy = DisabledCheckingPolicy; +#endif +// For CT(W)P neither marking information (for value), nor objectstart bitmap +// (for slot) are guaranteed to be present because there's no synchonization +// between heaps after marking. +using DefaultCrossThreadPersistentCheckingPolicy = DisabledCheckingPolicy; + +class KeepLocationPolicy { + public: + constexpr const SourceLocation& Location() const { return location_; } + + protected: + constexpr KeepLocationPolicy() = default; + constexpr explicit KeepLocationPolicy(const SourceLocation& location) + : location_(location) {} + + // KeepLocationPolicy must not copy underlying source locations. + KeepLocationPolicy(const KeepLocationPolicy&) = delete; + KeepLocationPolicy& operator=(const KeepLocationPolicy&) = delete; + + // Location of the original moved from object should be preserved. + KeepLocationPolicy(KeepLocationPolicy&&) = default; + KeepLocationPolicy& operator=(KeepLocationPolicy&&) = default; + + private: + SourceLocation location_; +}; + +class IgnoreLocationPolicy { + public: + constexpr SourceLocation Location() const { return {}; } + + protected: + constexpr IgnoreLocationPolicy() = default; + constexpr explicit IgnoreLocationPolicy(const SourceLocation&) {} +}; + +#if CPPGC_SUPPORTS_OBJECT_NAMES +using DefaultLocationPolicy = KeepLocationPolicy; +#else +using DefaultLocationPolicy = IgnoreLocationPolicy; +#endif + +struct StrongPersistentPolicy { + using IsStrongPersistent = std::true_type; + static V8_EXPORT PersistentRegion& GetPersistentRegion(const void* object); +}; + +struct WeakPersistentPolicy { + using IsStrongPersistent = std::false_type; + static V8_EXPORT PersistentRegion& GetPersistentRegion(const void* object); +}; + +struct StrongCrossThreadPersistentPolicy { + using IsStrongPersistent = std::true_type; + static V8_EXPORT CrossThreadPersistentRegion& GetPersistentRegion( + const void* object); +}; + +struct WeakCrossThreadPersistentPolicy { + using IsStrongPersistent = std::false_type; + static V8_EXPORT CrossThreadPersistentRegion& GetPersistentRegion( + const void* object); +}; + +// Forward declarations setting up the default policies. +template +class BasicCrossThreadPersistent; +template +class BasicPersistent; +template +class BasicMember; + +} // namespace internal + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_POINTER_POLICIES_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/prefinalizer-handler.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/prefinalizer-handler.h new file mode 100644 index 00000000000..64b07ec9112 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/prefinalizer-handler.h @@ -0,0 +1,30 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_ +#define INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_ + +#include "cppgc/heap.h" +#include "cppgc/liveness-broker.h" + +namespace cppgc { +namespace internal { + +class V8_EXPORT PreFinalizerRegistrationDispatcher final { + public: + using PreFinalizerCallback = bool (*)(const LivenessBroker&, void*); + struct PreFinalizer { + void* object; + PreFinalizerCallback callback; + + bool operator==(const PreFinalizer& other) const; + }; + + static void RegisterPrefinalizer(PreFinalizer pre_finalizer); +}; + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/write-barrier.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/write-barrier.h new file mode 100644 index 00000000000..28184dc9c83 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/internal/write-barrier.h @@ -0,0 +1,433 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_INTERNAL_WRITE_BARRIER_H_ +#define INCLUDE_CPPGC_INTERNAL_WRITE_BARRIER_H_ + +#include +#include + +#include "cppgc/heap-state.h" +#include "cppgc/internal/api-constants.h" +#include "cppgc/internal/atomic-entry-flag.h" +#include "cppgc/platform.h" +#include "cppgc/sentinel-pointer.h" +#include "cppgc/trace-trait.h" +#include "v8config.h" // NOLINT(build/include_directory) + +#if defined(CPPGC_CAGED_HEAP) +#include "cppgc/internal/caged-heap-local-data.h" +#endif + +namespace cppgc { + +class HeapHandle; + +namespace internal { + +#if defined(CPPGC_CAGED_HEAP) +class WriteBarrierTypeForCagedHeapPolicy; +#else // !CPPGC_CAGED_HEAP +class WriteBarrierTypeForNonCagedHeapPolicy; +#endif // !CPPGC_CAGED_HEAP + +class V8_EXPORT WriteBarrier final { + public: + enum class Type : uint8_t { + kNone, + kMarking, + kGenerational, + }; + + struct Params { + HeapHandle* heap = nullptr; +#if V8_ENABLE_CHECKS + Type type = Type::kNone; +#endif // !V8_ENABLE_CHECKS +#if defined(CPPGC_CAGED_HEAP) + uintptr_t start = 0; + CagedHeapLocalData& caged_heap() const { + return *reinterpret_cast(start); + } + uintptr_t slot_offset = 0; + uintptr_t value_offset = 0; +#endif // CPPGC_CAGED_HEAP + }; + + enum class ValueMode { + kValuePresent, + kNoValuePresent, + }; + + // Returns the required write barrier for a given `slot` and `value`. + static V8_INLINE Type GetWriteBarrierType(const void* slot, const void* value, + Params& params); + // Returns the required write barrier for a given `slot`. + template + static V8_INLINE Type GetWriteBarrierType(const void* slot, Params& params, + HeapHandleCallback callback); + // Returns the required write barrier for a given `value`. + static V8_INLINE Type GetWriteBarrierType(const void* value, Params& params); + + template + static V8_INLINE Type GetWriteBarrierTypeForExternallyReferencedObject( + const void* value, Params& params, HeapHandleCallback callback); + + static V8_INLINE void DijkstraMarkingBarrier(const Params& params, + const void* object); + static V8_INLINE void DijkstraMarkingBarrierRange( + const Params& params, const void* first_element, size_t element_size, + size_t number_of_elements, TraceCallback trace_callback); + static V8_INLINE void SteeleMarkingBarrier(const Params& params, + const void* object); +#if defined(CPPGC_YOUNG_GENERATION) + static V8_INLINE void GenerationalBarrier(const Params& params, + const void* slot); +#else // !CPPGC_YOUNG_GENERATION + static V8_INLINE void GenerationalBarrier(const Params& params, + const void* slot) {} +#endif // CPPGC_YOUNG_GENERATION + +#if V8_ENABLE_CHECKS + static void CheckParams(Type expected_type, const Params& params); +#else // !V8_ENABLE_CHECKS + static void CheckParams(Type expected_type, const Params& params) {} +#endif // !V8_ENABLE_CHECKS + + // The IncrementalOrConcurrentUpdater class allows cppgc internal to update + // |incremental_or_concurrent_marking_flag_|. + class IncrementalOrConcurrentMarkingFlagUpdater; + static bool IsAnyIncrementalOrConcurrentMarking() { + return incremental_or_concurrent_marking_flag_.MightBeEntered(); + } + + private: + WriteBarrier() = delete; + +#if defined(CPPGC_CAGED_HEAP) + using WriteBarrierTypePolicy = WriteBarrierTypeForCagedHeapPolicy; +#else // !CPPGC_CAGED_HEAP + using WriteBarrierTypePolicy = WriteBarrierTypeForNonCagedHeapPolicy; +#endif // !CPPGC_CAGED_HEAP + + static void DijkstraMarkingBarrierSlow(const void* value); + static void DijkstraMarkingBarrierSlowWithSentinelCheck(const void* value); + static void DijkstraMarkingBarrierRangeSlow(HeapHandle& heap_handle, + const void* first_element, + size_t element_size, + size_t number_of_elements, + TraceCallback trace_callback); + static void SteeleMarkingBarrierSlow(const void* value); + static void SteeleMarkingBarrierSlowWithSentinelCheck(const void* value); + +#if defined(CPPGC_YOUNG_GENERATION) + static CagedHeapLocalData& GetLocalData(HeapHandle&); + static void GenerationalBarrierSlow(const CagedHeapLocalData& local_data, + const AgeTable& ageTable, + const void* slot, uintptr_t value_offset); +#endif // CPPGC_YOUNG_GENERATION + + static AtomicEntryFlag incremental_or_concurrent_marking_flag_; +}; + +template +V8_INLINE WriteBarrier::Type SetAndReturnType(WriteBarrier::Params& params) { + if (type == WriteBarrier::Type::kNone) return WriteBarrier::Type::kNone; +#if V8_ENABLE_CHECKS + params.type = type; +#endif // !V8_ENABLE_CHECKS + return type; +} + +#if defined(CPPGC_CAGED_HEAP) +class V8_EXPORT WriteBarrierTypeForCagedHeapPolicy final { + public: + template + static V8_INLINE WriteBarrier::Type Get(const void* slot, const void* value, + WriteBarrier::Params& params, + HeapHandleCallback callback) { + return ValueModeDispatch::Get(slot, value, params, callback); + } + + template + static V8_INLINE WriteBarrier::Type Get(const void* value, + WriteBarrier::Params& params, + HeapHandleCallback callback) { + return GetNoSlot(value, params, callback); + } + + template + static V8_INLINE WriteBarrier::Type GetForExternallyReferenced( + const void* value, WriteBarrier::Params& params, + HeapHandleCallback callback) { + return GetNoSlot(value, params, callback); + } + + private: + WriteBarrierTypeForCagedHeapPolicy() = delete; + + template + static V8_INLINE WriteBarrier::Type GetNoSlot(const void* value, + WriteBarrier::Params& params, + HeapHandleCallback) { + if (!TryGetCagedHeap(value, value, params)) { + return WriteBarrier::Type::kNone; + } + if (V8_UNLIKELY(params.caged_heap().is_incremental_marking_in_progress)) { + return SetAndReturnType(params); + } + return SetAndReturnType(params); + } + + template + struct ValueModeDispatch; + + static V8_INLINE bool TryGetCagedHeap(const void* slot, const void* value, + WriteBarrier::Params& params) { + // TODO(chromium:1056170): Check if the null check can be folded in with + // the rest of the write barrier. + if (!value) return false; + params.start = reinterpret_cast(value) & + ~(api_constants::kCagedHeapReservationAlignment - 1); + const uintptr_t slot_offset = + reinterpret_cast(slot) - params.start; + if (slot_offset > api_constants::kCagedHeapReservationSize) { + // Check if slot is on stack or value is sentinel or nullptr. This relies + // on the fact that kSentinelPointer is encoded as 0x1. + return false; + } + return true; + } + + // Returns whether marking is in progress. If marking is not in progress + // sets the start of the cage accordingly. + // + // TODO(chromium:1056170): Create fast path on API. + static bool IsMarking(const HeapHandle&, WriteBarrier::Params&); +}; + +template <> +struct WriteBarrierTypeForCagedHeapPolicy::ValueModeDispatch< + WriteBarrier::ValueMode::kValuePresent> { + template + static V8_INLINE WriteBarrier::Type Get(const void* slot, const void* value, + WriteBarrier::Params& params, + HeapHandleCallback) { + bool within_cage = TryGetCagedHeap(slot, value, params); + if (!within_cage) { + return WriteBarrier::Type::kNone; + } + if (V8_LIKELY(!params.caged_heap().is_incremental_marking_in_progress)) { +#if defined(CPPGC_YOUNG_GENERATION) + params.heap = reinterpret_cast(params.start); + params.slot_offset = reinterpret_cast(slot) - params.start; + params.value_offset = reinterpret_cast(value) - params.start; + return SetAndReturnType(params); +#else // !CPPGC_YOUNG_GENERATION + return SetAndReturnType(params); +#endif // !CPPGC_YOUNG_GENERATION + } + params.heap = reinterpret_cast(params.start); + return SetAndReturnType(params); + } +}; + +template <> +struct WriteBarrierTypeForCagedHeapPolicy::ValueModeDispatch< + WriteBarrier::ValueMode::kNoValuePresent> { + template + static V8_INLINE WriteBarrier::Type Get(const void* slot, const void*, + WriteBarrier::Params& params, + HeapHandleCallback callback) { +#if defined(CPPGC_YOUNG_GENERATION) + HeapHandle& handle = callback(); + if (V8_LIKELY(!IsMarking(handle, params))) { + // params.start is populated by IsMarking(). + params.heap = &handle; + params.slot_offset = reinterpret_cast(slot) - params.start; + // params.value_offset stays 0. + if (params.slot_offset > api_constants::kCagedHeapReservationSize) { + // Check if slot is on stack. + return SetAndReturnType(params); + } + return SetAndReturnType(params); + } +#else // !CPPGC_YOUNG_GENERATION + if (V8_LIKELY(!WriteBarrier::IsAnyIncrementalOrConcurrentMarking())) { + return SetAndReturnType(params); + } + HeapHandle& handle = callback(); + if (V8_UNLIKELY(!subtle::HeapState::IsMarking(handle))) { + return SetAndReturnType(params); + } +#endif // !CPPGC_YOUNG_GENERATION + params.heap = &handle; + return SetAndReturnType(params); + } +}; + +#endif // CPPGC_CAGED_HEAP + +class V8_EXPORT WriteBarrierTypeForNonCagedHeapPolicy final { + public: + template + static V8_INLINE WriteBarrier::Type Get(const void* slot, const void* value, + WriteBarrier::Params& params, + HeapHandleCallback callback) { + return ValueModeDispatch::Get(slot, value, params, callback); + } + + template + static V8_INLINE WriteBarrier::Type Get(const void* value, + WriteBarrier::Params& params, + HeapHandleCallback callback) { + // The slot will never be used in `Get()` below. + return Get(nullptr, value, params, + callback); + } + + template + static V8_INLINE WriteBarrier::Type GetForExternallyReferenced( + const void* value, WriteBarrier::Params& params, + HeapHandleCallback callback) { + // The slot will never be used in `Get()` below. + return Get(nullptr, value, params, + callback); + } + + private: + template + struct ValueModeDispatch; + + // TODO(chromium:1056170): Create fast path on API. + static bool IsMarking(const void*, HeapHandle**); + // TODO(chromium:1056170): Create fast path on API. + static bool IsMarking(HeapHandle&); + + WriteBarrierTypeForNonCagedHeapPolicy() = delete; +}; + +template <> +struct WriteBarrierTypeForNonCagedHeapPolicy::ValueModeDispatch< + WriteBarrier::ValueMode::kValuePresent> { + template + static V8_INLINE WriteBarrier::Type Get(const void*, const void* object, + WriteBarrier::Params& params, + HeapHandleCallback callback) { + // The following check covers nullptr as well as sentinel pointer. + if (object <= static_cast(kSentinelPointer)) { + return WriteBarrier::Type::kNone; + } + if (IsMarking(object, ¶ms.heap)) { + return SetAndReturnType(params); + } + return SetAndReturnType(params); + } +}; + +template <> +struct WriteBarrierTypeForNonCagedHeapPolicy::ValueModeDispatch< + WriteBarrier::ValueMode::kNoValuePresent> { + template + static V8_INLINE WriteBarrier::Type Get(const void*, const void*, + WriteBarrier::Params& params, + HeapHandleCallback callback) { + if (V8_UNLIKELY(WriteBarrier::IsAnyIncrementalOrConcurrentMarking())) { + HeapHandle& handle = callback(); + if (IsMarking(handle)) { + params.heap = &handle; + return SetAndReturnType(params); + } + } + return WriteBarrier::Type::kNone; + } +}; + +// static +WriteBarrier::Type WriteBarrier::GetWriteBarrierType( + const void* slot, const void* value, WriteBarrier::Params& params) { + return WriteBarrierTypePolicy::Get(slot, value, + params, []() {}); +} + +// static +template +WriteBarrier::Type WriteBarrier::GetWriteBarrierType( + const void* slot, WriteBarrier::Params& params, + HeapHandleCallback callback) { + return WriteBarrierTypePolicy::Get( + slot, nullptr, params, callback); +} + +// static +WriteBarrier::Type WriteBarrier::GetWriteBarrierType( + const void* value, WriteBarrier::Params& params) { + return WriteBarrierTypePolicy::Get(value, params, + []() {}); +} + +// static +template +WriteBarrier::Type +WriteBarrier::GetWriteBarrierTypeForExternallyReferencedObject( + const void* value, Params& params, HeapHandleCallback callback) { + return WriteBarrierTypePolicy::GetForExternallyReferenced(value, params, + callback); +} + +// static +void WriteBarrier::DijkstraMarkingBarrier(const Params& params, + const void* object) { + CheckParams(Type::kMarking, params); +#if defined(CPPGC_CAGED_HEAP) + // Caged heap already filters out sentinels. + DijkstraMarkingBarrierSlow(object); +#else // !CPPGC_CAGED_HEAP + DijkstraMarkingBarrierSlowWithSentinelCheck(object); +#endif // !CPPGC_CAGED_HEAP +} + +// static +void WriteBarrier::DijkstraMarkingBarrierRange(const Params& params, + const void* first_element, + size_t element_size, + size_t number_of_elements, + TraceCallback trace_callback) { + CheckParams(Type::kMarking, params); + DijkstraMarkingBarrierRangeSlow(*params.heap, first_element, element_size, + number_of_elements, trace_callback); +} + +// static +void WriteBarrier::SteeleMarkingBarrier(const Params& params, + const void* object) { + CheckParams(Type::kMarking, params); +#if defined(CPPGC_CAGED_HEAP) + // Caged heap already filters out sentinels. + SteeleMarkingBarrierSlow(object); +#else // !CPPGC_CAGED_HEAP + SteeleMarkingBarrierSlowWithSentinelCheck(object); +#endif // !CPPGC_CAGED_HEAP +} + +#if defined(CPPGC_YOUNG_GENERATION) +// static +void WriteBarrier::GenerationalBarrier(const Params& params, const void* slot) { + CheckParams(Type::kGenerational, params); + + const CagedHeapLocalData& local_data = params.caged_heap(); + const AgeTable& age_table = local_data.age_table; + + // Bail out if the slot is in young generation. + if (V8_LIKELY(age_table[params.slot_offset] == AgeTable::Age::kYoung)) return; + + GenerationalBarrierSlow(local_data, age_table, slot, params.value_offset); +} + +#endif // !CPPGC_YOUNG_GENERATION + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_INTERNAL_WRITE_BARRIER_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/liveness-broker.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/liveness-broker.h new file mode 100644 index 00000000000..c94eef0d4ac --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/liveness-broker.h @@ -0,0 +1,77 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_LIVENESS_BROKER_H_ +#define INCLUDE_CPPGC_LIVENESS_BROKER_H_ + +#include "cppgc/heap.h" +#include "cppgc/member.h" +#include "cppgc/trace-trait.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +namespace internal { +class LivenessBrokerFactory; +} // namespace internal + +/** + * The broker is passed to weak callbacks to allow (temporarily) querying + * the liveness state of an object. References to non-live objects must be + * cleared when `IsHeapObjectAlive()` returns false. + * + * \code + * class GCedWithCustomWeakCallback final + * : public GarbageCollected { + * public: + * UntracedMember bar; + * + * void CustomWeakCallbackMethod(const LivenessBroker& broker) { + * if (!broker.IsHeapObjectAlive(bar)) + * bar = nullptr; + * } + * + * void Trace(cppgc::Visitor* visitor) const { + * visitor->RegisterWeakCallbackMethod< + * GCedWithCustomWeakCallback, + * &GCedWithCustomWeakCallback::CustomWeakCallbackMethod>(this); + * } + * }; + * \endcode + */ +class V8_EXPORT LivenessBroker final { + public: + template + bool IsHeapObjectAlive(const T* object) const { + // nullptr objects are considered alive to allow weakness to be used from + // stack while running into a conservative GC. Treating nullptr as dead + // would mean that e.g. custom collectins could not be strongified on stack. + return !object || + IsHeapObjectAliveImpl( + TraceTrait::GetTraceDescriptor(object).base_object_payload); + } + + template + bool IsHeapObjectAlive(const WeakMember& weak_member) const { + return (weak_member != kSentinelPointer) && + IsHeapObjectAlive(weak_member.Get()); + } + + template + bool IsHeapObjectAlive(const UntracedMember& untraced_member) const { + return (untraced_member != kSentinelPointer) && + IsHeapObjectAlive(untraced_member.Get()); + } + + private: + LivenessBroker() = default; + + bool IsHeapObjectAliveImpl(const void*) const; + + friend class internal::LivenessBrokerFactory; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_LIVENESS_BROKER_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/macros.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/macros.h new file mode 100644 index 00000000000..030f397e3df --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/macros.h @@ -0,0 +1,26 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_MACROS_H_ +#define INCLUDE_CPPGC_MACROS_H_ + +#include + +#include "cppgc/internal/compiler-specific.h" + +namespace cppgc { + +// Use if the object is only stack allocated. +#define CPPGC_STACK_ALLOCATED() \ + public: \ + using IsStackAllocatedTypeMarker CPPGC_UNUSED = int; \ + \ + private: \ + void* operator new(size_t) = delete; \ + void* operator new(size_t, void*) = delete; \ + static_assert(true, "Force semicolon.") + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_MACROS_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/member.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/member.h new file mode 100644 index 00000000000..38105b8e432 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/member.h @@ -0,0 +1,288 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_MEMBER_H_ +#define INCLUDE_CPPGC_MEMBER_H_ + +#include +#include +#include + +#include "cppgc/internal/pointer-policies.h" +#include "cppgc/sentinel-pointer.h" +#include "cppgc/type-traits.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class Visitor; + +namespace internal { + +// MemberBase always refers to the object as const object and defers to +// BasicMember on casting to the right type as needed. +class MemberBase { + protected: + struct AtomicInitializerTag {}; + + MemberBase() = default; + explicit MemberBase(const void* value) : raw_(value) {} + MemberBase(const void* value, AtomicInitializerTag) { SetRawAtomic(value); } + + const void** GetRawSlot() const { return &raw_; } + const void* GetRaw() const { return raw_; } + void SetRaw(void* value) { raw_ = value; } + + const void* GetRawAtomic() const { + return reinterpret_cast*>(&raw_)->load( + std::memory_order_relaxed); + } + void SetRawAtomic(const void* value) { + reinterpret_cast*>(&raw_)->store( + value, std::memory_order_relaxed); + } + + void ClearFromGC() const { raw_ = nullptr; } + + private: + mutable const void* raw_ = nullptr; +}; + +// The basic class from which all Member classes are 'generated'. +template +class BasicMember final : private MemberBase, private CheckingPolicy { + public: + using PointeeType = T; + + constexpr BasicMember() = default; + constexpr BasicMember(std::nullptr_t) {} // NOLINT + BasicMember(SentinelPointer s) : MemberBase(s) {} // NOLINT + BasicMember(T* raw) : MemberBase(raw) { // NOLINT + InitializingWriteBarrier(); + this->CheckPointer(Get()); + } + BasicMember(T& raw) : BasicMember(&raw) {} // NOLINT + // Atomic ctor. Using the AtomicInitializerTag forces BasicMember to + // initialize using atomic assignments. This is required for preventing + // data races with concurrent marking. + using AtomicInitializerTag = MemberBase::AtomicInitializerTag; + BasicMember(std::nullptr_t, AtomicInitializerTag atomic) + : MemberBase(nullptr, atomic) {} + BasicMember(SentinelPointer s, AtomicInitializerTag atomic) + : MemberBase(s, atomic) {} + BasicMember(T* raw, AtomicInitializerTag atomic) : MemberBase(raw, atomic) { + InitializingWriteBarrier(); + this->CheckPointer(Get()); + } + BasicMember(T& raw, AtomicInitializerTag atomic) + : BasicMember(&raw, atomic) {} + // Copy ctor. + BasicMember(const BasicMember& other) : BasicMember(other.Get()) {} + // Allow heterogeneous construction. + template ::value>> + BasicMember( // NOLINT + const BasicMember& other) + : BasicMember(other.Get()) {} + // Move ctor. + BasicMember(BasicMember&& other) noexcept : BasicMember(other.Get()) { + other.Clear(); + } + // Allow heterogeneous move construction. + template ::value>> + BasicMember(BasicMember&& other) noexcept + : BasicMember(other.Get()) { + other.Clear(); + } + // Construction from Persistent. + template ::value>> + BasicMember(const BasicPersistent& p) + : BasicMember(p.Get()) {} + + // Copy assignment. + BasicMember& operator=(const BasicMember& other) { + return operator=(other.Get()); + } + // Allow heterogeneous copy assignment. + template ::value>> + BasicMember& operator=( + const BasicMember& other) { + return operator=(other.Get()); + } + // Move assignment. + BasicMember& operator=(BasicMember&& other) noexcept { + operator=(other.Get()); + other.Clear(); + return *this; + } + // Heterogeneous move assignment. + template ::value>> + BasicMember& operator=(BasicMember&& other) noexcept { + operator=(other.Get()); + other.Clear(); + return *this; + } + // Assignment from Persistent. + template ::value>> + BasicMember& operator=( + const BasicPersistent& + other) { + return operator=(other.Get()); + } + BasicMember& operator=(T* other) { + SetRawAtomic(other); + AssigningWriteBarrier(); + this->CheckPointer(Get()); + return *this; + } + BasicMember& operator=(std::nullptr_t) { + Clear(); + return *this; + } + BasicMember& operator=(SentinelPointer s) { + SetRawAtomic(s); + return *this; + } + + template + void Swap(BasicMember& other) { + T* tmp = Get(); + *this = other; + other = tmp; + } + + explicit operator bool() const { return Get(); } + operator T*() const { return Get(); } + T* operator->() const { return Get(); } + T& operator*() const { return *Get(); } + + // CFI cast exemption to allow passing SentinelPointer through T* and support + // heterogeneous assignments between different Member and Persistent handles + // based on their actual types. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") T* Get() const { + // Executed by the mutator, hence non atomic load. + // + // The const_cast below removes the constness from MemberBase storage. The + // following static_cast re-adds any constness if specified through the + // user-visible template parameter T. + return static_cast(const_cast(MemberBase::GetRaw())); + } + + void Clear() { SetRawAtomic(nullptr); } + + T* Release() { + T* result = Get(); + Clear(); + return result; + } + + const T** GetSlotForTesting() const { + return reinterpret_cast(GetRawSlot()); + } + + private: + const T* GetRawAtomic() const { + return static_cast(MemberBase::GetRawAtomic()); + } + + void InitializingWriteBarrier() const { + WriteBarrierPolicy::InitializingBarrier(GetRawSlot(), GetRaw()); + } + void AssigningWriteBarrier() const { + WriteBarrierPolicy::AssigningBarrier(GetRawSlot(), GetRaw()); + } + + void ClearFromGC() const { MemberBase::ClearFromGC(); } + + T* GetFromGC() const { return Get(); } + + friend class cppgc::Visitor; + template + friend struct cppgc::TraceTrait; +}; + +template +bool operator==(const BasicMember& member1, + const BasicMember& member2) { + return member1.Get() == member2.Get(); +} + +template +bool operator!=(const BasicMember& member1, + const BasicMember& member2) { + return !(member1 == member2); +} + +template +struct IsWeak< + internal::BasicMember> + : std::true_type {}; + +} // namespace internal + +/** + * Members are used in classes to contain strong pointers to other garbage + * collected objects. All Member fields of a class must be traced in the class' + * trace method. + */ +template +using Member = internal::BasicMember; + +/** + * WeakMember is similar to Member in that it is used to point to other garbage + * collected objects. However instead of creating a strong pointer to the + * object, the WeakMember creates a weak pointer, which does not keep the + * pointee alive. Hence if all pointers to to a heap allocated object are weak + * the object will be garbage collected. At the time of GC the weak pointers + * will automatically be set to null. + */ +template +using WeakMember = internal::BasicMember; + +/** + * UntracedMember is a pointer to an on-heap object that is not traced for some + * reason. Do not use this unless you know what you are doing. Keeping raw + * pointers to on-heap objects is prohibited unless used from stack. Pointee + * must be kept alive through other means. + */ +template +using UntracedMember = internal::BasicMember; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_MEMBER_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/name-provider.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/name-provider.h new file mode 100644 index 00000000000..224dd4b5d67 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/name-provider.h @@ -0,0 +1,65 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_NAME_PROVIDER_H_ +#define INCLUDE_CPPGC_NAME_PROVIDER_H_ + +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +/** + * NameProvider allows for providing a human-readable name for garbage-collected + * objects. + * + * There's two cases of names to distinguish: + * a. Explicitly specified names via using NameProvider. Such names are always + * preserved in the system. + * b. Internal names that Oilpan infers from a C++ type on the class hierarchy + * of the object. This is not necessarily the type of the actually + * instantiated object. + * + * Depending on the build configuration, Oilpan may hide names, i.e., represent + * them with kHiddenName, of case b. to avoid exposing internal details. + */ +class V8_EXPORT NameProvider { + public: + /** + * Name that is used when hiding internals. + */ + static constexpr const char kHiddenName[] = "InternalNode"; + + /** + * Name that is used in case compiler support is missing for composing a name + * from C++ types. + */ + static constexpr const char kNoNameDeducible[] = ""; + + /** + * Indicating whether internal names are hidden or not. + * + * @returns true if C++ names should be hidden and represented by kHiddenName. + */ + static constexpr bool HideInternalNames() { +#if CPPGC_SUPPORTS_OBJECT_NAMES + return false; +#else // !CPPGC_SUPPORTS_OBJECT_NAMES + return true; +#endif // !CPPGC_SUPPORTS_OBJECT_NAMES + } + + virtual ~NameProvider() = default; + + /** + * Specifies a name for the garbage-collected object. Such names will never + * be hidden, as they are explicitly specified by the user of this API. + * + * @returns a human readable name for the object. + */ + virtual const char* GetHumanReadableName() const = 0; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_NAME_PROVIDER_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/object-size-trait.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/object-size-trait.h new file mode 100644 index 00000000000..35795596d36 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/object-size-trait.h @@ -0,0 +1,58 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_OBJECT_SIZE_TRAIT_H_ +#define INCLUDE_CPPGC_OBJECT_SIZE_TRAIT_H_ + +#include + +#include "cppgc/type-traits.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +namespace internal { + +struct V8_EXPORT BaseObjectSizeTrait { + protected: + static size_t GetObjectSizeForGarbageCollected(const void*); + static size_t GetObjectSizeForGarbageCollectedMixin(const void*); +}; + +} // namespace internal + +namespace subtle { + +/** + * Trait specifying how to get the size of an object that was allocated using + * `MakeGarbageCollected()`. Also supports querying the size with an inner + * pointer to a mixin. + */ +template > +struct ObjectSizeTrait; + +template +struct ObjectSizeTrait : cppgc::internal::BaseObjectSizeTrait { + static_assert(sizeof(T), "T must be fully defined"); + static_assert(IsGarbageCollectedTypeV, + "T must be of type GarbageCollected or GarbageCollectedMixin"); + + static size_t GetSize(const T& object) { + return GetObjectSizeForGarbageCollected(&object); + } +}; + +template +struct ObjectSizeTrait : cppgc::internal::BaseObjectSizeTrait { + static_assert(sizeof(T), "T must be fully defined"); + + static size_t GetSize(const T& object) { + return GetObjectSizeForGarbageCollectedMixin(&object); + } +}; + +} // namespace subtle +} // namespace cppgc + +#endif // INCLUDE_CPPGC_OBJECT_SIZE_TRAIT_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/persistent.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/persistent.h new file mode 100644 index 00000000000..b83a464576e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/persistent.h @@ -0,0 +1,371 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_PERSISTENT_H_ +#define INCLUDE_CPPGC_PERSISTENT_H_ + +#include + +#include "cppgc/internal/persistent-node.h" +#include "cppgc/internal/pointer-policies.h" +#include "cppgc/sentinel-pointer.h" +#include "cppgc/source-location.h" +#include "cppgc/type-traits.h" +#include "cppgc/visitor.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class Visitor; + +namespace internal { + +// PersistentBase always refers to the object as const object and defers to +// BasicPersistent on casting to the right type as needed. +class PersistentBase { + protected: + PersistentBase() = default; + explicit PersistentBase(const void* raw) : raw_(raw) {} + + const void* GetValue() const { return raw_; } + void SetValue(const void* value) { raw_ = value; } + + PersistentNode* GetNode() const { return node_; } + void SetNode(PersistentNode* node) { node_ = node; } + + // Performs a shallow clear which assumes that internal persistent nodes are + // destroyed elsewhere. + void ClearFromGC() const { + raw_ = nullptr; + node_ = nullptr; + } + + protected: + mutable const void* raw_ = nullptr; + mutable PersistentNode* node_ = nullptr; + + friend class PersistentRegion; +}; + +// The basic class from which all Persistent classes are generated. +template +class BasicPersistent final : public PersistentBase, + public LocationPolicy, + private WeaknessPolicy, + private CheckingPolicy { + public: + using typename WeaknessPolicy::IsStrongPersistent; + using PointeeType = T; + + // Null-state/sentinel constructors. + BasicPersistent( // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc) {} + + BasicPersistent(std::nullptr_t, // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : LocationPolicy(loc) {} + + BasicPersistent( // NOLINT + SentinelPointer s, const SourceLocation& loc = SourceLocation::Current()) + : PersistentBase(s), LocationPolicy(loc) {} + + // Raw value constructors. + BasicPersistent(T* raw, // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : PersistentBase(raw), LocationPolicy(loc) { + if (!IsValid()) return; + SetNode(WeaknessPolicy::GetPersistentRegion(GetValue()) + .AllocateNode(this, &BasicPersistent::Trace)); + this->CheckPointer(Get()); + } + + BasicPersistent(T& raw, // NOLINT + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(&raw, loc) {} + + // Copy ctor. + BasicPersistent(const BasicPersistent& other, + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(other.Get(), loc) {} + + // Heterogeneous ctor. + template ::value>> + BasicPersistent( + const BasicPersistent& other, + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(other.Get(), loc) {} + + // Move ctor. The heterogeneous move ctor is not supported since e.g. + // persistent can't reuse persistent node from weak persistent. + BasicPersistent( + BasicPersistent&& other, + const SourceLocation& loc = SourceLocation::Current()) noexcept + : PersistentBase(std::move(other)), LocationPolicy(std::move(other)) { + if (!IsValid()) return; + GetNode()->UpdateOwner(this); + other.SetValue(nullptr); + other.SetNode(nullptr); + this->CheckPointer(Get()); + } + + // Constructor from member. + template ::value>> + BasicPersistent(internal::BasicMember + member, + const SourceLocation& loc = SourceLocation::Current()) + : BasicPersistent(member.Get(), loc) {} + + ~BasicPersistent() { Clear(); } + + // Copy assignment. + BasicPersistent& operator=(const BasicPersistent& other) { + return operator=(other.Get()); + } + + template ::value>> + BasicPersistent& operator=( + const BasicPersistent& other) { + return operator=(other.Get()); + } + + // Move assignment. + BasicPersistent& operator=(BasicPersistent&& other) noexcept { + if (this == &other) return *this; + Clear(); + PersistentBase::operator=(std::move(other)); + LocationPolicy::operator=(std::move(other)); + if (!IsValid()) return *this; + GetNode()->UpdateOwner(this); + other.SetValue(nullptr); + other.SetNode(nullptr); + this->CheckPointer(Get()); + return *this; + } + + // Assignment from member. + template ::value>> + BasicPersistent& operator=( + internal::BasicMember + member) { + return operator=(member.Get()); + } + + BasicPersistent& operator=(T* other) { + Assign(other); + return *this; + } + + BasicPersistent& operator=(std::nullptr_t) { + Clear(); + return *this; + } + + BasicPersistent& operator=(SentinelPointer s) { + Assign(s); + return *this; + } + + explicit operator bool() const { return Get(); } + operator T*() const { return Get(); } + T* operator->() const { return Get(); } + T& operator*() const { return *Get(); } + + // CFI cast exemption to allow passing SentinelPointer through T* and support + // heterogeneous assignments between different Member and Persistent handles + // based on their actual types. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") T* Get() const { + // The const_cast below removes the constness from PersistentBase storage. + // The following static_cast re-adds any constness if specified through the + // user-visible template parameter T. + return static_cast(const_cast(GetValue())); + } + + void Clear() { + // Simplified version of `Assign()` to allow calling without a complete type + // `T`. + if (IsValid()) { + WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode()); + SetNode(nullptr); + } + SetValue(nullptr); + } + + T* Release() { + T* result = Get(); + Clear(); + return result; + } + + template + BasicPersistent + To() const { + return BasicPersistent(static_cast(Get())); + } + + private: + static void Trace(Visitor* v, const void* ptr) { + const auto* persistent = static_cast(ptr); + v->TraceRoot(*persistent, persistent->Location()); + } + + bool IsValid() const { + // Ideally, handling kSentinelPointer would be done by the embedder. On the + // other hand, having Persistent aware of it is beneficial since no node + // gets wasted. + return GetValue() != nullptr && GetValue() != kSentinelPointer; + } + + void Assign(T* ptr) { + if (IsValid()) { + if (ptr && ptr != kSentinelPointer) { + // Simply assign the pointer reusing the existing node. + SetValue(ptr); + this->CheckPointer(ptr); + return; + } + WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode()); + SetNode(nullptr); + } + SetValue(ptr); + if (!IsValid()) return; + SetNode(WeaknessPolicy::GetPersistentRegion(GetValue()) + .AllocateNode(this, &BasicPersistent::Trace)); + this->CheckPointer(Get()); + } + + void ClearFromGC() const { + if (IsValid()) { + WeaknessPolicy::GetPersistentRegion(GetValue()).FreeNode(GetNode()); + PersistentBase::ClearFromGC(); + } + } + + // Set Get() for details. + V8_CLANG_NO_SANITIZE("cfi-unrelated-cast") + T* GetFromGC() const { + return static_cast(const_cast(GetValue())); + } + + friend class cppgc::Visitor; +}; + +template +bool operator==(const BasicPersistent& p1, + const BasicPersistent& p2) { + return p1.Get() == p2.Get(); +} + +template +bool operator!=(const BasicPersistent& p1, + const BasicPersistent& p2) { + return !(p1 == p2); +} + +template +bool operator==(const BasicPersistent& p, + BasicMember + m) { + return p.Get() == m.Get(); +} + +template +bool operator!=(const BasicPersistent& p, + BasicMember + m) { + return !(p == m); +} + +template +bool operator==(BasicMember + m, + const BasicPersistent& p) { + return m.Get() == p.Get(); +} + +template +bool operator!=(BasicMember + m, + const BasicPersistent& p) { + return !(m == p); +} + +template +struct IsWeak> : std::true_type {}; +} // namespace internal + +/** + * Persistent is a way to create a strong pointer from an off-heap object to + * another on-heap object. As long as the Persistent handle is alive the GC will + * keep the object pointed to alive. The Persistent handle is always a GC root + * from the point of view of the GC. Persistent must be constructed and + * destructed in the same thread. + */ +template +using Persistent = + internal::BasicPersistent; + +/** + * WeakPersistent is a way to create a weak pointer from an off-heap object to + * an on-heap object. The pointer is automatically cleared when the pointee gets + * collected. WeakPersistent must be constructed and destructed in the same + * thread. + */ +template +using WeakPersistent = + internal::BasicPersistent; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_PERSISTENT_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/platform.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/platform.h new file mode 100644 index 00000000000..3276a26b652 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/platform.h @@ -0,0 +1,154 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_PLATFORM_H_ +#define INCLUDE_CPPGC_PLATFORM_H_ + +#include + +#include "v8-platform.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +// TODO(v8:10346): Create separate includes for concepts that are not +// V8-specific. +using IdleTask = v8::IdleTask; +using JobHandle = v8::JobHandle; +using JobDelegate = v8::JobDelegate; +using JobTask = v8::JobTask; +using PageAllocator = v8::PageAllocator; +using Task = v8::Task; +using TaskPriority = v8::TaskPriority; +using TaskRunner = v8::TaskRunner; +using TracingController = v8::TracingController; + +/** + * Platform interface used by Heap. Contains allocators and executors. + */ +class V8_EXPORT Platform { + public: + virtual ~Platform() = default; + + /** + * Returns the allocator used by cppgc to allocate its heap and various + * support structures. + */ + virtual PageAllocator* GetPageAllocator() = 0; + + /** + * Monotonically increasing time in seconds from an arbitrary fixed point in + * the past. This function is expected to return at least + * millisecond-precision values. For this reason, + * it is recommended that the fixed point be no further in the past than + * the epoch. + **/ + virtual double MonotonicallyIncreasingTime() = 0; + + /** + * Foreground task runner that should be used by a Heap. + */ + virtual std::shared_ptr GetForegroundTaskRunner() { + return nullptr; + } + + /** + * Posts `job_task` to run in parallel. Returns a `JobHandle` associated with + * the `Job`, which can be joined or canceled. + * This avoids degenerate cases: + * - Calling `CallOnWorkerThread()` for each work item, causing significant + * overhead. + * - Fixed number of `CallOnWorkerThread()` calls that split the work and + * might run for a long time. This is problematic when many components post + * "num cores" tasks and all expect to use all the cores. In these cases, + * the scheduler lacks context to be fair to multiple same-priority requests + * and/or ability to request lower priority work to yield when high priority + * work comes in. + * A canonical implementation of `job_task` looks like: + * \code + * class MyJobTask : public JobTask { + * public: + * MyJobTask(...) : worker_queue_(...) {} + * // JobTask implementation. + * void Run(JobDelegate* delegate) override { + * while (!delegate->ShouldYield()) { + * // Smallest unit of work. + * auto work_item = worker_queue_.TakeWorkItem(); // Thread safe. + * if (!work_item) return; + * ProcessWork(work_item); + * } + * } + * + * size_t GetMaxConcurrency() const override { + * return worker_queue_.GetSize(); // Thread safe. + * } + * }; + * + * // ... + * auto handle = PostJob(TaskPriority::kUserVisible, + * std::make_unique(...)); + * handle->Join(); + * \endcode + * + * `PostJob()` and methods of the returned JobHandle/JobDelegate, must never + * be called while holding a lock that could be acquired by `JobTask::Run()` + * or `JobTask::GetMaxConcurrency()` -- that could result in a deadlock. This + * is because (1) `JobTask::GetMaxConcurrency()` may be invoked while holding + * internal lock (A), hence `JobTask::GetMaxConcurrency()` can only use a lock + * (B) if that lock is *never* held while calling back into `JobHandle` from + * any thread (A=>B/B=>A deadlock) and (2) `JobTask::Run()` or + * `JobTask::GetMaxConcurrency()` may be invoked synchronously from + * `JobHandle` (B=>JobHandle::foo=>B deadlock). + * + * A sufficient `PostJob()` implementation that uses the default Job provided + * in libplatform looks like: + * \code + * std::unique_ptr PostJob( + * TaskPriority priority, std::unique_ptr job_task) override { + * return std::make_unique( + * std::make_shared( + * this, std::move(job_task), kNumThreads)); + * } + * \endcode + */ + virtual std::unique_ptr PostJob( + TaskPriority priority, std::unique_ptr job_task) { + return nullptr; + } + + /** + * Returns an instance of a `TracingController`. This must be non-nullptr. The + * default implementation returns an empty `TracingController` that consumes + * trace data without effect. + */ + virtual TracingController* GetTracingController(); +}; + +/** + * Process-global initialization of the garbage collector. Must be called before + * creating a Heap. + * + * Can be called multiple times when paired with `ShutdownProcess()`. + * + * \param page_allocator The allocator used for maintaining meta data. Must not + * change between multiple calls to InitializeProcess. + */ +V8_EXPORT void InitializeProcess(PageAllocator* page_allocator); + +/** + * Must be called after destroying the last used heap. Some process-global + * metadata may not be returned and reused upon a subsequent + * `InitializeProcess()` call. + */ +V8_EXPORT void ShutdownProcess(); + +namespace internal { + +V8_EXPORT void Abort(); + +} // namespace internal + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_PLATFORM_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/prefinalizer.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/prefinalizer.h new file mode 100644 index 00000000000..29b18bef909 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/prefinalizer.h @@ -0,0 +1,52 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_PREFINALIZER_H_ +#define INCLUDE_CPPGC_PREFINALIZER_H_ + +#include "cppgc/internal/compiler-specific.h" +#include "cppgc/internal/prefinalizer-handler.h" +#include "cppgc/liveness-broker.h" + +namespace cppgc { + +namespace internal { + +template +class PrefinalizerRegistration final { + public: + explicit PrefinalizerRegistration(T* self) { + static_assert(sizeof(&T::InvokePreFinalizer) > 0, + "USING_PRE_FINALIZER(T) must be defined."); + + cppgc::internal::PreFinalizerRegistrationDispatcher::RegisterPrefinalizer( + {self, T::InvokePreFinalizer}); + } + + void* operator new(size_t, void* location) = delete; + void* operator new(size_t) = delete; +}; + +} // namespace internal + +#define CPPGC_USING_PRE_FINALIZER(Class, PreFinalizer) \ + public: \ + static bool InvokePreFinalizer(const cppgc::LivenessBroker& liveness_broker, \ + void* object) { \ + static_assert(cppgc::IsGarbageCollectedOrMixinTypeV, \ + "Only garbage collected objects can have prefinalizers"); \ + Class* self = static_cast(object); \ + if (liveness_broker.IsHeapObjectAlive(self)) return false; \ + self->Class::PreFinalizer(); \ + return true; \ + } \ + \ + private: \ + CPPGC_NO_UNIQUE_ADDRESS cppgc::internal::PrefinalizerRegistration \ + prefinalizer_dummy_{this}; \ + static_assert(true, "Force semicolon.") + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_PREFINALIZER_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/process-heap-statistics.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/process-heap-statistics.h new file mode 100644 index 00000000000..774cc92f46c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/process-heap-statistics.h @@ -0,0 +1,36 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_PROCESS_HEAP_STATISTICS_H_ +#define INCLUDE_CPPGC_PROCESS_HEAP_STATISTICS_H_ + +#include +#include + +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { +namespace internal { +class ProcessHeapStatisticsUpdater; +} // namespace internal + +class V8_EXPORT ProcessHeapStatistics final { + public: + static size_t TotalAllocatedObjectSize() { + return total_allocated_object_size_.load(std::memory_order_relaxed); + } + static size_t TotalAllocatedSpace() { + return total_allocated_space_.load(std::memory_order_relaxed); + } + + private: + static std::atomic_size_t total_allocated_space_; + static std::atomic_size_t total_allocated_object_size_; + + friend class internal::ProcessHeapStatisticsUpdater; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_PROCESS_HEAP_STATISTICS_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/sentinel-pointer.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/sentinel-pointer.h new file mode 100644 index 00000000000..b049d1a2b34 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/sentinel-pointer.h @@ -0,0 +1,32 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_SENTINEL_POINTER_H_ +#define INCLUDE_CPPGC_SENTINEL_POINTER_H_ + +#include + +namespace cppgc { +namespace internal { + +// Special tag type used to denote some sentinel member. The semantics of the +// sentinel is defined by the embedder. +struct SentinelPointer { + template + operator T*() const { + static constexpr intptr_t kSentinelValue = 1; + return reinterpret_cast(kSentinelValue); + } + // Hidden friends. + friend bool operator==(SentinelPointer, SentinelPointer) { return true; } + friend bool operator!=(SentinelPointer, SentinelPointer) { return false; } +}; + +} // namespace internal + +constexpr internal::SentinelPointer kSentinelPointer; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_SENTINEL_POINTER_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/source-location.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/source-location.h new file mode 100644 index 00000000000..da5a5ede520 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/source-location.h @@ -0,0 +1,92 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_SOURCE_LOCATION_H_ +#define INCLUDE_CPPGC_SOURCE_LOCATION_H_ + +#include +#include + +#include "v8config.h" // NOLINT(build/include_directory) + +#if defined(__has_builtin) +#define CPPGC_SUPPORTS_SOURCE_LOCATION \ + (__has_builtin(__builtin_FUNCTION) && __has_builtin(__builtin_FILE) && \ + __has_builtin(__builtin_LINE)) // NOLINT +#elif defined(V8_CC_GNU) && __GNUC__ >= 7 +#define CPPGC_SUPPORTS_SOURCE_LOCATION 1 +#elif defined(V8_CC_INTEL) && __ICC >= 1800 +#define CPPGC_SUPPORTS_SOURCE_LOCATION 1 +#else +#define CPPGC_SUPPORTS_SOURCE_LOCATION 0 +#endif + +namespace cppgc { + +/** + * Encapsulates source location information. Mimics C++20's + * `std::source_location`. + */ +class V8_EXPORT SourceLocation final { + public: + /** + * Construct source location information corresponding to the location of the + * call site. + */ +#if CPPGC_SUPPORTS_SOURCE_LOCATION + static constexpr SourceLocation Current( + const char* function = __builtin_FUNCTION(), + const char* file = __builtin_FILE(), size_t line = __builtin_LINE()) { + return SourceLocation(function, file, line); + } +#else + static constexpr SourceLocation Current() { return SourceLocation(); } +#endif // CPPGC_SUPPORTS_SOURCE_LOCATION + + /** + * Constructs unspecified source location information. + */ + constexpr SourceLocation() = default; + + /** + * Returns the name of the function associated with the position represented + * by this object, if any. + * + * \returns the function name as cstring. + */ + constexpr const char* Function() const { return function_; } + + /** + * Returns the name of the current source file represented by this object. + * + * \returns the file name as cstring. + */ + constexpr const char* FileName() const { return file_; } + + /** + * Returns the line number represented by this object. + * + * \returns the line number. + */ + constexpr size_t Line() const { return line_; } + + /** + * Returns a human-readable string representing this object. + * + * \returns a human-readable string representing source location information. + */ + std::string ToString() const; + + private: + constexpr SourceLocation(const char* function, const char* file, size_t line) + : function_(function), file_(file), line_(line) {} + + const char* function_ = nullptr; + const char* file_ = nullptr; + size_t line_ = 0u; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_SOURCE_LOCATION_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/testing.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/testing.h new file mode 100644 index 00000000000..229ce140f94 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/testing.h @@ -0,0 +1,99 @@ +// Copyright 2021 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_TESTING_H_ +#define INCLUDE_CPPGC_TESTING_H_ + +#include "cppgc/common.h" +#include "cppgc/macros.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class HeapHandle; + +/** + * Namespace contains testing helpers. + */ +namespace testing { + +/** + * Overrides the state of the stack with the provided value. Takes precedence + * over other parameters that set the stack state. Must no be nested. + */ +class V8_EXPORT V8_NODISCARD OverrideEmbedderStackStateScope final { + CPPGC_STACK_ALLOCATED(); + + public: + /** + * Constructs a scoped object that automatically enters and leaves the scope. + * + * \param heap_handle The corresponding heap. + */ + explicit OverrideEmbedderStackStateScope(HeapHandle& heap_handle, + EmbedderStackState state); + ~OverrideEmbedderStackStateScope(); + + OverrideEmbedderStackStateScope(const OverrideEmbedderStackStateScope&) = + delete; + OverrideEmbedderStackStateScope& operator=( + const OverrideEmbedderStackStateScope&) = delete; + + private: + HeapHandle& heap_handle_; +}; + +/** + * Testing interface for managed heaps that allows for controlling garbage + * collection timings. Embedders should use this class when testing the + * interaction of their code with incremental/concurrent garbage collection. + */ +class V8_EXPORT StandaloneTestingHeap final { + public: + explicit StandaloneTestingHeap(HeapHandle&); + + /** + * Start an incremental garbage collection. + */ + void StartGarbageCollection(); + + /** + * Perform an incremental step. This will also schedule concurrent steps if + * needed. + * + * \param stack_state The state of the stack during the step. + */ + bool PerformMarkingStep(EmbedderStackState stack_state); + + /** + * Finalize the current garbage collection cycle atomically. + * Assumes that garbage collection is in progress. + * + * \param stack_state The state of the stack for finalizing the garbage + * collection cycle. + */ + void FinalizeGarbageCollection(EmbedderStackState stack_state); + + /** + * Toggle main thread marking on/off. Allows to stress concurrent marking + * (e.g. to better detect data races). + * + * \param should_mark Denotes whether the main thread should contribute to + * marking. Defaults to true. + */ + void ToggleMainThreadMarking(bool should_mark); + + /** + * Force enable compaction for the next garbage collection cycle. + */ + void ForceCompactionForNextGarbageCollection(); + + private: + HeapHandle& heap_handle_; +}; + +} // namespace testing +} // namespace cppgc + +#endif // INCLUDE_CPPGC_TESTING_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/trace-trait.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/trace-trait.h new file mode 100644 index 00000000000..83619b1d518 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/trace-trait.h @@ -0,0 +1,116 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_TRACE_TRAIT_H_ +#define INCLUDE_CPPGC_TRACE_TRAIT_H_ + +#include + +#include "cppgc/type-traits.h" +#include "v8config.h" // NOLINT(build/include_directory) + +namespace cppgc { + +class Visitor; + +namespace internal { + +// Implementation of the default TraceTrait handling GarbageCollected and +// GarbageCollectedMixin. +template ::type>> +struct TraceTraitImpl; + +} // namespace internal + +/** + * Callback for invoking tracing on a given object. + * + * \param visitor The visitor to dispatch to. + * \param object The object to invoke tracing on. + */ +using TraceCallback = void (*)(Visitor* visitor, const void* object); + +/** + * Describes how to trace an object, i.e., how to visit all Oilpan-relevant + * fields of an object. + */ +struct TraceDescriptor { + /** + * Adjusted base pointer, i.e., the pointer to the class inheriting directly + * from GarbageCollected, of the object that is being traced. + */ + const void* base_object_payload; + /** + * Callback for tracing the object. + */ + TraceCallback callback; +}; + +namespace internal { + +struct V8_EXPORT TraceTraitFromInnerAddressImpl { + static TraceDescriptor GetTraceDescriptor(const void* address); +}; + +/** + * Trait specifying how the garbage collector processes an object of type T. + * + * Advanced users may override handling by creating a specialization for their + * type. + */ +template +struct TraceTraitBase { + static_assert(internal::IsTraceableV, "T must have a Trace() method"); + + /** + * Accessor for retrieving a TraceDescriptor to process an object of type T. + * + * \param self The object to be processed. + * \returns a TraceDescriptor to process the object. + */ + static TraceDescriptor GetTraceDescriptor(const void* self) { + return internal::TraceTraitImpl::GetTraceDescriptor( + static_cast(self)); + } + + /** + * Function invoking the tracing for an object of type T. + * + * \param visitor The visitor to dispatch to. + * \param self The object to invoke tracing on. + */ + static void Trace(Visitor* visitor, const void* self) { + static_cast(self)->Trace(visitor); + } +}; + +} // namespace internal + +template +struct TraceTrait : public internal::TraceTraitBase {}; + +namespace internal { + +template +struct TraceTraitImpl { + static_assert(IsGarbageCollectedTypeV, + "T must be of type GarbageCollected or GarbageCollectedMixin"); + static TraceDescriptor GetTraceDescriptor(const void* self) { + return {self, TraceTrait::Trace}; + } +}; + +template +struct TraceTraitImpl { + static TraceDescriptor GetTraceDescriptor(const void* self) { + return internal::TraceTraitFromInnerAddressImpl::GetTraceDescriptor(self); + } +}; + +} // namespace internal +} // namespace cppgc + +#endif // INCLUDE_CPPGC_TRACE_TRAIT_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/type-traits.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/type-traits.h new file mode 100644 index 00000000000..56cd55d61e2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/type-traits.h @@ -0,0 +1,247 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_TYPE_TRAITS_H_ +#define INCLUDE_CPPGC_TYPE_TRAITS_H_ + +// This file should stay with minimal dependencies to allow embedder to check +// against Oilpan types without including any other parts. +#include +#include + +namespace cppgc { + +class Visitor; + +namespace internal { +template +class BasicMember; +struct DijkstraWriteBarrierPolicy; +struct NoWriteBarrierPolicy; +class StrongMemberTag; +class UntracedMemberTag; +class WeakMemberTag; + +// Pre-C++17 custom implementation of std::void_t. +template +struct make_void { + typedef void type; +}; +template +using void_t = typename make_void::type; + +// Not supposed to be specialized by the user. +template +struct IsWeak : std::false_type {}; + +// IsTraceMethodConst is used to verify that all Trace methods are marked as +// const. It is equivalent to IsTraceable but for a non-const object. +template +struct IsTraceMethodConst : std::false_type {}; + +template +struct IsTraceMethodConst().Trace( + std::declval()))>> : std::true_type { +}; + +template +struct IsTraceable : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsTraceable< + T, void_t().Trace(std::declval()))>> + : std::true_type { + // All Trace methods should be marked as const. If an object of type + // 'T' is traceable then any object of type 'const T' should also + // be traceable. + static_assert(IsTraceMethodConst(), + "Trace methods should be marked as const."); +}; + +template +constexpr bool IsTraceableV = IsTraceable::value; + +template +struct HasGarbageCollectedMixinTypeMarker : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct HasGarbageCollectedMixinTypeMarker< + T, + void_t::IsGarbageCollectedMixinTypeMarker>> + : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct HasGarbageCollectedTypeMarker : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct HasGarbageCollectedTypeMarker< + T, void_t::IsGarbageCollectedTypeMarker>> + : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template ::value, + bool = HasGarbageCollectedMixinTypeMarker::value> +struct IsGarbageCollectedMixinType : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsGarbageCollectedMixinType : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template ::value> +struct IsGarbageCollectedType : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsGarbageCollectedType : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsGarbageCollectedOrMixinType + : std::integral_constant::value || + IsGarbageCollectedMixinType::value> { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template ::value && + HasGarbageCollectedMixinTypeMarker::value)> +struct IsGarbageCollectedWithMixinType : std::false_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsGarbageCollectedWithMixinType : std::true_type { + static_assert(sizeof(T), "T must be fully defined"); +}; + +template +struct IsSubclassOfBasicMemberTemplate { + private: + template + static std::true_type SubclassCheck( + BasicMember*); + static std::false_type SubclassCheck(...); + + public: + static constexpr bool value = + decltype(SubclassCheck(std::declval()))::value; +}; + +template ::value> +struct IsMemberType : std::false_type {}; + +template +struct IsMemberType : std::true_type {}; + +template ::value> +struct IsWeakMemberType : std::false_type {}; + +template +struct IsWeakMemberType : std::true_type {}; + +template ::value> +struct IsUntracedMemberType : std::false_type {}; + +template +struct IsUntracedMemberType : std::true_type {}; + +template +struct IsComplete { + private: + template + static std::true_type IsSizeOfKnown(U*); + static std::false_type IsSizeOfKnown(...); + + public: + static constexpr bool value = + decltype(IsSizeOfKnown(std::declval()))::value; +}; + +} // namespace internal + +/** + * Value is true for types that inherit from `GarbageCollectedMixin` but not + * `GarbageCollected` (i.e., they are free mixins), and false otherwise. + */ +template +constexpr bool IsGarbageCollectedMixinTypeV = + internal::IsGarbageCollectedMixinType::value; + +/** + * Value is true for types that inherit from `GarbageCollected`, and false + * otherwise. + */ +template +constexpr bool IsGarbageCollectedTypeV = + internal::IsGarbageCollectedType::value; + +/** + * Value is true for types that inherit from either `GarbageCollected` or + * `GarbageCollectedMixin`, and false otherwise. + */ +template +constexpr bool IsGarbageCollectedOrMixinTypeV = + internal::IsGarbageCollectedOrMixinType::value; + +/** + * Value is true for types that inherit from `GarbageCollected` and + * `GarbageCollectedMixin`, and false otherwise. + */ +template +constexpr bool IsGarbageCollectedWithMixinTypeV = + internal::IsGarbageCollectedWithMixinType::value; + +/** + * Value is true for types of type `Member`, and false otherwise. + */ +template +constexpr bool IsMemberTypeV = internal::IsMemberType::value; + +/** + * Value is true for types of type `UntracedMember`, and false otherwise. + */ +template +constexpr bool IsUntracedMemberTypeV = internal::IsUntracedMemberType::value; + +/** + * Value is true for types of type `WeakMember`, and false otherwise. + */ +template +constexpr bool IsWeakMemberTypeV = internal::IsWeakMemberType::value; + +/** + * Value is true for types that are considered weak references, and false + * otherwise. + */ +template +constexpr bool IsWeakV = internal::IsWeak::value; + +/** + * Value is true for types that are complete, and false otherwise. + */ +template +constexpr bool IsCompleteV = internal::IsComplete::value; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_TYPE_TRAITS_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/visitor.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/visitor.h new file mode 100644 index 00000000000..57e2ce3963a --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/cppgc/visitor.h @@ -0,0 +1,379 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_CPPGC_VISITOR_H_ +#define INCLUDE_CPPGC_VISITOR_H_ + +#include "cppgc/custom-space.h" +#include "cppgc/ephemeron-pair.h" +#include "cppgc/garbage-collected.h" +#include "cppgc/internal/logging.h" +#include "cppgc/internal/pointer-policies.h" +#include "cppgc/liveness-broker.h" +#include "cppgc/member.h" +#include "cppgc/sentinel-pointer.h" +#include "cppgc/source-location.h" +#include "cppgc/trace-trait.h" +#include "cppgc/type-traits.h" + +namespace cppgc { + +namespace internal { +template +class BasicCrossThreadPersistent; +template +class BasicPersistent; +class ConservativeTracingVisitor; +class VisitorBase; +class VisitorFactory; +} // namespace internal + +using WeakCallback = void (*)(const LivenessBroker&, const void*); + +/** + * Visitor passed to trace methods. All managed pointers must have called the + * Visitor's trace method on them. + * + * \code + * class Foo final : public GarbageCollected { + * public: + * void Trace(Visitor* visitor) const { + * visitor->Trace(foo_); + * visitor->Trace(weak_foo_); + * } + * private: + * Member foo_; + * WeakMember weak_foo_; + * }; + * \endcode + */ +class V8_EXPORT Visitor { + public: + class Key { + private: + Key() = default; + friend class internal::VisitorFactory; + }; + + explicit Visitor(Key) {} + + virtual ~Visitor() = default; + + /** + * Trace method for raw pointers. Prefer the versions for managed pointers. + * + * \param member Reference retaining an object. + */ + template + void Trace(const T* t) { + static_assert(sizeof(T), "Pointee type must be fully defined."); + static_assert(internal::IsGarbageCollectedOrMixinType::value, + "T must be GarbageCollected or GarbageCollectedMixin type"); + if (!t) { + return; + } + Visit(t, TraceTrait::GetTraceDescriptor(t)); + } + + /** + * Trace method for Member. + * + * \param member Member reference retaining an object. + */ + template + void Trace(const Member& member) { + const T* value = member.GetRawAtomic(); + CPPGC_DCHECK(value != kSentinelPointer); + Trace(value); + } + + /** + * Trace method for WeakMember. + * + * \param weak_member WeakMember reference weakly retaining an object. + */ + template + void Trace(const WeakMember& weak_member) { + static_assert(sizeof(T), "Pointee type must be fully defined."); + static_assert(internal::IsGarbageCollectedOrMixinType::value, + "T must be GarbageCollected or GarbageCollectedMixin type"); + static_assert(!internal::IsAllocatedOnCompactableSpace::value, + "Weak references to compactable objects are not allowed"); + + const T* value = weak_member.GetRawAtomic(); + + // Bailout assumes that WeakMember emits write barrier. + if (!value) { + return; + } + + CPPGC_DCHECK(value != kSentinelPointer); + VisitWeak(value, TraceTrait::GetTraceDescriptor(value), + &HandleWeak>, &weak_member); + } + + /** + * Trace method for inlined objects that are not allocated themselves but + * otherwise follow managed heap layout and have a Trace() method. + * + * \param object reference of the inlined object. + */ + template + void Trace(const T& object) { +#if V8_ENABLE_CHECKS + // This object is embedded in potentially multiple nested objects. The + // outermost object must not be in construction as such objects are (a) not + // processed immediately, and (b) only processed conservatively if not + // otherwise possible. + CheckObjectNotInConstruction(&object); +#endif // V8_ENABLE_CHECKS + TraceTrait::Trace(this, &object); + } + + /** + * Registers a weak callback method on the object of type T. See + * LivenessBroker for an usage example. + * + * \param object of type T specifying a weak callback method. + */ + template + void RegisterWeakCallbackMethod(const T* object) { + RegisterWeakCallback(&WeakCallbackMethodDelegate, object); + } + + /** + * Trace method for EphemeronPair. + * + * \param ephemeron_pair EphemeronPair reference weakly retaining a key object + * and strongly retaining a value object in case the key object is alive. + */ + template + void Trace(const EphemeronPair& ephemeron_pair) { + TraceEphemeron(ephemeron_pair.key, &ephemeron_pair.value); + RegisterWeakCallbackMethod, + &EphemeronPair::ClearValueIfKeyIsDead>( + &ephemeron_pair); + } + + /** + * Trace method for a single ephemeron. Used for tracing a raw ephemeron in + * which the `key` and `value` are kept separately. + * + * \param weak_member_key WeakMember reference weakly retaining a key object. + * \param member_value Member reference with ephemeron semantics. + */ + template + void TraceEphemeron(const WeakMember& weak_member_key, + const Member* member_value) { + const KeyType* key = weak_member_key.GetRawAtomic(); + if (!key) return; + + // `value` must always be non-null. + CPPGC_DCHECK(member_value); + const ValueType* value = member_value->GetRawAtomic(); + if (!value) return; + + // KeyType and ValueType may refer to GarbageCollectedMixin. + TraceDescriptor value_desc = + TraceTrait::GetTraceDescriptor(value); + CPPGC_DCHECK(value_desc.base_object_payload); + const void* key_base_object_payload = + TraceTrait::GetTraceDescriptor(key).base_object_payload; + CPPGC_DCHECK(key_base_object_payload); + + VisitEphemeron(key_base_object_payload, value, value_desc); + } + + /** + * Trace method for a single ephemeron. Used for tracing a raw ephemeron in + * which the `key` and `value` are kept separately. Note that this overload + * is for non-GarbageCollected `value`s that can be traced though. + * + * \param key `WeakMember` reference weakly retaining a key object. + * \param value Reference weakly retaining a value object. Note that + * `ValueType` here should not be `Member`. It is expected that + * `TraceTrait::GetTraceDescriptor(value)` returns a + * `TraceDescriptor` with a null base pointer but a valid trace method. + */ + template + void TraceEphemeron(const WeakMember& weak_member_key, + const ValueType* value) { + static_assert(!IsGarbageCollectedOrMixinTypeV, + "garbage-collected types must use WeakMember and Member"); + const KeyType* key = weak_member_key.GetRawAtomic(); + if (!key) return; + + // `value` must always be non-null. + CPPGC_DCHECK(value); + TraceDescriptor value_desc = + TraceTrait::GetTraceDescriptor(value); + // `value_desc.base_object_payload` must be null as this override is only + // taken for non-garbage-collected values. + CPPGC_DCHECK(!value_desc.base_object_payload); + + // KeyType might be a GarbageCollectedMixin. + const void* key_base_object_payload = + TraceTrait::GetTraceDescriptor(key).base_object_payload; + CPPGC_DCHECK(key_base_object_payload); + + VisitEphemeron(key_base_object_payload, value, value_desc); + } + + /** + * Trace method that strongifies a WeakMember. + * + * \param weak_member WeakMember reference retaining an object. + */ + template + void TraceStrongly(const WeakMember& weak_member) { + const T* value = weak_member.GetRawAtomic(); + CPPGC_DCHECK(value != kSentinelPointer); + Trace(value); + } + + /** + * Trace method for weak containers. + * + * \param object reference of the weak container. + * \param callback to be invoked. + * \param data custom data that is passed to the callback. + */ + template + void TraceWeakContainer(const T* object, WeakCallback callback, + const void* data) { + if (!object) return; + VisitWeakContainer(object, TraceTrait::GetTraceDescriptor(object), + TraceTrait::GetWeakTraceDescriptor(object), callback, + data); + } + + /** + * Registers a slot containing a reference to an object allocated on a + * compactable space. Such references maybe be arbitrarily moved by the GC. + * + * \param slot location of reference to object that might be moved by the GC. + */ + template + void RegisterMovableReference(const T** slot) { + static_assert(internal::IsAllocatedOnCompactableSpace::value, + "Only references to objects allocated on compactable spaces " + "should be registered as movable slots."); + static_assert(!IsGarbageCollectedMixinTypeV, + "Mixin types do not support compaction."); + HandleMovableReference(reinterpret_cast(slot)); + } + + /** + * Registers a weak callback that is invoked during garbage collection. + * + * \param callback to be invoked. + * \param data custom data that is passed to the callback. + */ + virtual void RegisterWeakCallback(WeakCallback callback, const void* data) {} + + /** + * Defers tracing an object from a concurrent thread to the mutator thread. + * Should be called by Trace methods of types that are not safe to trace + * concurrently. + * + * \param parameter tells the trace callback which object was deferred. + * \param callback to be invoked for tracing on the mutator thread. + * \param deferred_size size of deferred object. + * + * \returns false if the object does not need to be deferred (i.e. currently + * traced on the mutator thread) and true otherwise (i.e. currently traced on + * a concurrent thread). + */ + virtual V8_WARN_UNUSED_RESULT bool DeferTraceToMutatorThreadIfConcurrent( + const void* parameter, TraceCallback callback, size_t deferred_size) { + // By default tracing is not deferred. + return false; + } + + protected: + virtual void Visit(const void* self, TraceDescriptor) {} + virtual void VisitWeak(const void* self, TraceDescriptor, WeakCallback, + const void* weak_member) {} + virtual void VisitRoot(const void*, TraceDescriptor, const SourceLocation&) {} + virtual void VisitWeakRoot(const void* self, TraceDescriptor, WeakCallback, + const void* weak_root, const SourceLocation&) {} + virtual void VisitEphemeron(const void* key, const void* value, + TraceDescriptor value_desc) {} + virtual void VisitWeakContainer(const void* self, TraceDescriptor strong_desc, + TraceDescriptor weak_desc, + WeakCallback callback, const void* data) {} + virtual void HandleMovableReference(const void**) {} + + private: + template + static void WeakCallbackMethodDelegate(const LivenessBroker& info, + const void* self) { + // Callback is registered through a potential const Trace method but needs + // to be able to modify fields. See HandleWeak. + (const_cast(static_cast(self))->*method)(info); + } + + template + static void HandleWeak(const LivenessBroker& info, const void* object) { + const PointerType* weak = static_cast(object); + auto* raw_ptr = weak->GetFromGC(); + // Sentinel values are preserved for weak pointers. + if (raw_ptr == kSentinelPointer) return; + if (!info.IsHeapObjectAlive(raw_ptr)) { + weak->ClearFromGC(); + } + } + + template * = nullptr> + void TraceRoot(const Persistent& p, const SourceLocation& loc) { + using PointeeType = typename Persistent::PointeeType; + static_assert(sizeof(PointeeType), + "Persistent's pointee type must be fully defined"); + static_assert(internal::IsGarbageCollectedOrMixinType::value, + "Persistent's pointee type must be GarbageCollected or " + "GarbageCollectedMixin"); + auto* ptr = p.GetFromGC(); + if (!ptr) { + return; + } + VisitRoot(ptr, TraceTrait::GetTraceDescriptor(ptr), loc); + } + + template < + typename WeakPersistent, + std::enable_if_t* = nullptr> + void TraceRoot(const WeakPersistent& p, const SourceLocation& loc) { + using PointeeType = typename WeakPersistent::PointeeType; + static_assert(sizeof(PointeeType), + "Persistent's pointee type must be fully defined"); + static_assert(internal::IsGarbageCollectedOrMixinType::value, + "Persistent's pointee type must be GarbageCollected or " + "GarbageCollectedMixin"); + static_assert(!internal::IsAllocatedOnCompactableSpace::value, + "Weak references to compactable objects are not allowed"); + auto* ptr = p.GetFromGC(); + VisitWeakRoot(ptr, TraceTrait::GetTraceDescriptor(ptr), + &HandleWeak, &p, loc); + } + +#if V8_ENABLE_CHECKS + void CheckObjectNotInConstruction(const void* address); +#endif // V8_ENABLE_CHECKS + + template + friend class internal::BasicCrossThreadPersistent; + template + friend class internal::BasicPersistent; + friend class internal::ConservativeTracingVisitor; + friend class internal::VisitorBase; +}; + +} // namespace cppgc + +#endif // INCLUDE_CPPGC_VISITOR_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/libplatform/libplatform-export.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/libplatform/libplatform-export.h new file mode 100644 index 00000000000..15618434977 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/libplatform/libplatform-export.h @@ -0,0 +1,29 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_ +#define V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_ + +#if defined(_WIN32) + +#ifdef BUILDING_V8_PLATFORM_SHARED +#define V8_PLATFORM_EXPORT __declspec(dllexport) +#elif USING_V8_PLATFORM_SHARED +#define V8_PLATFORM_EXPORT __declspec(dllimport) +#else +#define V8_PLATFORM_EXPORT +#endif // BUILDING_V8_PLATFORM_SHARED + +#else // defined(_WIN32) + +// Setup for Linux shared library export. +#ifdef BUILDING_V8_PLATFORM_SHARED +#define V8_PLATFORM_EXPORT __attribute__((visibility("default"))) +#else +#define V8_PLATFORM_EXPORT +#endif + +#endif // defined(_WIN32) + +#endif // V8_LIBPLATFORM_LIBPLATFORM_EXPORT_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/libplatform/libplatform.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/libplatform/libplatform.h new file mode 100644 index 00000000000..00de81df887 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/libplatform/libplatform.h @@ -0,0 +1,117 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_LIBPLATFORM_LIBPLATFORM_H_ +#define V8_LIBPLATFORM_LIBPLATFORM_H_ + +#include + +#include "libplatform/libplatform-export.h" +#include "libplatform/v8-tracing.h" +#include "v8-platform.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) + +namespace v8 { +namespace platform { + +enum class IdleTaskSupport { kDisabled, kEnabled }; +enum class InProcessStackDumping { kDisabled, kEnabled }; + +enum class MessageLoopBehavior : bool { + kDoNotWait = false, + kWaitForWork = true +}; + +/** + * Returns a new instance of the default v8::Platform implementation. + * + * The caller will take ownership of the returned pointer. |thread_pool_size| + * is the number of worker threads to allocate for background jobs. If a value + * of zero is passed, a suitable default based on the current number of + * processors online will be chosen. + * If |idle_task_support| is enabled then the platform will accept idle + * tasks (IdleTasksEnabled will return true) and will rely on the embedder + * calling v8::platform::RunIdleTasks to process the idle tasks. + * If |tracing_controller| is nullptr, the default platform will create a + * v8::platform::TracingController instance and use it. + */ +V8_PLATFORM_EXPORT std::unique_ptr NewDefaultPlatform( + int thread_pool_size = 0, + IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled, + InProcessStackDumping in_process_stack_dumping = + InProcessStackDumping::kDisabled, + std::unique_ptr tracing_controller = {}); + +/** + * The same as NewDefaultPlatform but disables the worker thread pool. + * It must be used with the --single-threaded V8 flag. + */ +V8_PLATFORM_EXPORT std::unique_ptr +NewSingleThreadedDefaultPlatform( + IdleTaskSupport idle_task_support = IdleTaskSupport::kDisabled, + InProcessStackDumping in_process_stack_dumping = + InProcessStackDumping::kDisabled, + std::unique_ptr tracing_controller = {}); + +/** + * Returns a new instance of the default v8::JobHandle implementation. + * + * The job will be executed by spawning up to |num_worker_threads| many worker + * threads on the provided |platform| with the given |priority|. + */ +V8_PLATFORM_EXPORT std::unique_ptr NewDefaultJobHandle( + v8::Platform* platform, v8::TaskPriority priority, + std::unique_ptr job_task, size_t num_worker_threads); + +/** + * Pumps the message loop for the given isolate. + * + * The caller has to make sure that this is called from the right thread. + * Returns true if a task was executed, and false otherwise. If the call to + * PumpMessageLoop is nested within another call to PumpMessageLoop, only + * nestable tasks may run. Otherwise, any task may run. Unless requested through + * the |behavior| parameter, this call does not block if no task is pending. The + * |platform| has to be created using |NewDefaultPlatform|. + */ +V8_PLATFORM_EXPORT bool PumpMessageLoop( + v8::Platform* platform, v8::Isolate* isolate, + MessageLoopBehavior behavior = MessageLoopBehavior::kDoNotWait); + +/** + * Runs pending idle tasks for at most |idle_time_in_seconds| seconds. + * + * The caller has to make sure that this is called from the right thread. + * This call does not block if no task is pending. The |platform| has to be + * created using |NewDefaultPlatform|. + */ +V8_PLATFORM_EXPORT void RunIdleTasks(v8::Platform* platform, + v8::Isolate* isolate, + double idle_time_in_seconds); + +/** + * Attempts to set the tracing controller for the given platform. + * + * The |platform| has to be created using |NewDefaultPlatform|. + * + */ +V8_DEPRECATE_SOON("Access the DefaultPlatform directly") +V8_PLATFORM_EXPORT void SetTracingController( + v8::Platform* platform, + v8::platform::tracing::TracingController* tracing_controller); + +/** + * Notifies the given platform about the Isolate getting deleted soon. Has to be + * called for all Isolates which are deleted - unless we're shutting down the + * platform. + * + * The |platform| has to be created using |NewDefaultPlatform|. + * + */ +V8_PLATFORM_EXPORT void NotifyIsolateShutdown(v8::Platform* platform, + Isolate* isolate); + +} // namespace platform +} // namespace v8 + +#endif // V8_LIBPLATFORM_LIBPLATFORM_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/libplatform/v8-tracing.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/libplatform/v8-tracing.h new file mode 100644 index 00000000000..c7a5c4f9f5f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/libplatform/v8-tracing.h @@ -0,0 +1,334 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_LIBPLATFORM_V8_TRACING_H_ +#define V8_LIBPLATFORM_V8_TRACING_H_ + +#include +#include +#include +#include +#include + +#include "libplatform/libplatform-export.h" +#include "v8-platform.h" // NOLINT(build/include_directory) + +namespace perfetto { +namespace trace_processor { +class TraceProcessorStorage; +} +class TracingSession; +} + +namespace v8 { + +namespace base { +class Mutex; +} // namespace base + +namespace platform { +namespace tracing { + +class TraceEventListener; + +const int kTraceMaxNumArgs = 2; + +class V8_PLATFORM_EXPORT TraceObject { + public: + union ArgValue { + V8_DEPRECATED("use as_uint ? true : false") bool as_bool; + uint64_t as_uint; + int64_t as_int; + double as_double; + const void* as_pointer; + const char* as_string; + }; + + TraceObject() = default; + ~TraceObject(); + void Initialize( + char phase, const uint8_t* category_enabled_flag, const char* name, + const char* scope, uint64_t id, uint64_t bind_id, int num_args, + const char** arg_names, const uint8_t* arg_types, + const uint64_t* arg_values, + std::unique_ptr* arg_convertables, + unsigned int flags, int64_t timestamp, int64_t cpu_timestamp); + void UpdateDuration(int64_t timestamp, int64_t cpu_timestamp); + void InitializeForTesting( + char phase, const uint8_t* category_enabled_flag, const char* name, + const char* scope, uint64_t id, uint64_t bind_id, int num_args, + const char** arg_names, const uint8_t* arg_types, + const uint64_t* arg_values, + std::unique_ptr* arg_convertables, + unsigned int flags, int pid, int tid, int64_t ts, int64_t tts, + uint64_t duration, uint64_t cpu_duration); + + int pid() const { return pid_; } + int tid() const { return tid_; } + char phase() const { return phase_; } + const uint8_t* category_enabled_flag() const { + return category_enabled_flag_; + } + const char* name() const { return name_; } + const char* scope() const { return scope_; } + uint64_t id() const { return id_; } + uint64_t bind_id() const { return bind_id_; } + int num_args() const { return num_args_; } + const char** arg_names() { return arg_names_; } + uint8_t* arg_types() { return arg_types_; } + ArgValue* arg_values() { return arg_values_; } + std::unique_ptr* arg_convertables() { + return arg_convertables_; + } + unsigned int flags() const { return flags_; } + int64_t ts() { return ts_; } + int64_t tts() { return tts_; } + uint64_t duration() { return duration_; } + uint64_t cpu_duration() { return cpu_duration_; } + + private: + int pid_; + int tid_; + char phase_; + const char* name_; + const char* scope_; + const uint8_t* category_enabled_flag_; + uint64_t id_; + uint64_t bind_id_; + int num_args_ = 0; + const char* arg_names_[kTraceMaxNumArgs]; + uint8_t arg_types_[kTraceMaxNumArgs]; + ArgValue arg_values_[kTraceMaxNumArgs]; + std::unique_ptr + arg_convertables_[kTraceMaxNumArgs]; + char* parameter_copy_storage_ = nullptr; + unsigned int flags_; + int64_t ts_; + int64_t tts_; + uint64_t duration_; + uint64_t cpu_duration_; + + // Disallow copy and assign + TraceObject(const TraceObject&) = delete; + void operator=(const TraceObject&) = delete; +}; + +class V8_PLATFORM_EXPORT TraceWriter { + public: + TraceWriter() = default; + virtual ~TraceWriter() = default; + virtual void AppendTraceEvent(TraceObject* trace_event) = 0; + virtual void Flush() = 0; + + static TraceWriter* CreateJSONTraceWriter(std::ostream& stream); + static TraceWriter* CreateJSONTraceWriter(std::ostream& stream, + const std::string& tag); + + static TraceWriter* CreateSystemInstrumentationTraceWriter(); + + private: + // Disallow copy and assign + TraceWriter(const TraceWriter&) = delete; + void operator=(const TraceWriter&) = delete; +}; + +class V8_PLATFORM_EXPORT TraceBufferChunk { + public: + explicit TraceBufferChunk(uint32_t seq); + + void Reset(uint32_t new_seq); + bool IsFull() const { return next_free_ == kChunkSize; } + TraceObject* AddTraceEvent(size_t* event_index); + TraceObject* GetEventAt(size_t index) { return &chunk_[index]; } + + uint32_t seq() const { return seq_; } + size_t size() const { return next_free_; } + + static const size_t kChunkSize = 64; + + private: + size_t next_free_ = 0; + TraceObject chunk_[kChunkSize]; + uint32_t seq_; + + // Disallow copy and assign + TraceBufferChunk(const TraceBufferChunk&) = delete; + void operator=(const TraceBufferChunk&) = delete; +}; + +class V8_PLATFORM_EXPORT TraceBuffer { + public: + TraceBuffer() = default; + virtual ~TraceBuffer() = default; + + virtual TraceObject* AddTraceEvent(uint64_t* handle) = 0; + virtual TraceObject* GetEventByHandle(uint64_t handle) = 0; + virtual bool Flush() = 0; + + static const size_t kRingBufferChunks = 1024; + + static TraceBuffer* CreateTraceBufferRingBuffer(size_t max_chunks, + TraceWriter* trace_writer); + + private: + // Disallow copy and assign + TraceBuffer(const TraceBuffer&) = delete; + void operator=(const TraceBuffer&) = delete; +}; + +// Options determines how the trace buffer stores data. +enum TraceRecordMode { + // Record until the trace buffer is full. + RECORD_UNTIL_FULL, + + // Record until the user ends the trace. The trace buffer is a fixed size + // and we use it as a ring buffer during recording. + RECORD_CONTINUOUSLY, + + // Record until the trace buffer is full, but with a huge buffer size. + RECORD_AS_MUCH_AS_POSSIBLE, + + // Echo to console. Events are discarded. + ECHO_TO_CONSOLE, +}; + +class V8_PLATFORM_EXPORT TraceConfig { + public: + typedef std::vector StringList; + + static TraceConfig* CreateDefaultTraceConfig(); + + TraceConfig() : enable_systrace_(false), enable_argument_filter_(false) {} + TraceRecordMode GetTraceRecordMode() const { return record_mode_; } + const StringList& GetEnabledCategories() const { + return included_categories_; + } + bool IsSystraceEnabled() const { return enable_systrace_; } + bool IsArgumentFilterEnabled() const { return enable_argument_filter_; } + + void SetTraceRecordMode(TraceRecordMode mode) { record_mode_ = mode; } + void EnableSystrace() { enable_systrace_ = true; } + void EnableArgumentFilter() { enable_argument_filter_ = true; } + + void AddIncludedCategory(const char* included_category); + + bool IsCategoryGroupEnabled(const char* category_group) const; + + private: + TraceRecordMode record_mode_; + bool enable_systrace_ : 1; + bool enable_argument_filter_ : 1; + StringList included_categories_; + + // Disallow copy and assign + TraceConfig(const TraceConfig&) = delete; + void operator=(const TraceConfig&) = delete; +}; + +#if defined(_MSC_VER) +#define V8_PLATFORM_NON_EXPORTED_BASE(code) \ + __pragma(warning(suppress : 4275)) code +#else +#define V8_PLATFORM_NON_EXPORTED_BASE(code) code +#endif // defined(_MSC_VER) + +class V8_PLATFORM_EXPORT TracingController + : public V8_PLATFORM_NON_EXPORTED_BASE(v8::TracingController) { + public: + TracingController(); + ~TracingController() override; + +#if defined(V8_USE_PERFETTO) + // Must be called before StartTracing() if V8_USE_PERFETTO is true. Provides + // the output stream for the JSON trace data. + void InitializeForPerfetto(std::ostream* output_stream); + // Provide an optional listener for testing that will receive trace events. + // Must be called before StartTracing(). + void SetTraceEventListenerForTesting(TraceEventListener* listener); +#else // defined(V8_USE_PERFETTO) + // The pointer returned from GetCategoryGroupEnabled() points to a value with + // zero or more of the following bits. Used in this class only. The + // TRACE_EVENT macros should only use the value as a bool. These values must + // be in sync with macro values in TraceEvent.h in Blink. + enum CategoryGroupEnabledFlags { + // Category group enabled for the recording mode. + ENABLED_FOR_RECORDING = 1 << 0, + // Category group enabled by SetEventCallbackEnabled(). + ENABLED_FOR_EVENT_CALLBACK = 1 << 2, + // Category group enabled to export events to ETW. + ENABLED_FOR_ETW_EXPORT = 1 << 3 + }; + + // Takes ownership of |trace_buffer|. + void Initialize(TraceBuffer* trace_buffer); + + // v8::TracingController implementation. + const uint8_t* GetCategoryGroupEnabled(const char* category_group) override; + uint64_t AddTraceEvent( + char phase, const uint8_t* category_enabled_flag, const char* name, + const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args, + const char** arg_names, const uint8_t* arg_types, + const uint64_t* arg_values, + std::unique_ptr* arg_convertables, + unsigned int flags) override; + uint64_t AddTraceEventWithTimestamp( + char phase, const uint8_t* category_enabled_flag, const char* name, + const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args, + const char** arg_names, const uint8_t* arg_types, + const uint64_t* arg_values, + std::unique_ptr* arg_convertables, + unsigned int flags, int64_t timestamp) override; + void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, + const char* name, uint64_t handle) override; + + static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag); +#endif // !defined(V8_USE_PERFETTO) + + void AddTraceStateObserver( + v8::TracingController::TraceStateObserver* observer) override; + void RemoveTraceStateObserver( + v8::TracingController::TraceStateObserver* observer) override; + + void StartTracing(TraceConfig* trace_config); + void StopTracing(); + + protected: +#if !defined(V8_USE_PERFETTO) + virtual int64_t CurrentTimestampMicroseconds(); + virtual int64_t CurrentCpuTimestampMicroseconds(); +#endif // !defined(V8_USE_PERFETTO) + + private: +#if !defined(V8_USE_PERFETTO) + void UpdateCategoryGroupEnabledFlag(size_t category_index); + void UpdateCategoryGroupEnabledFlags(); +#endif // !defined(V8_USE_PERFETTO) + + std::unique_ptr mutex_; + std::unique_ptr trace_config_; + std::atomic_bool recording_{false}; + std::unordered_set observers_; + +#if defined(V8_USE_PERFETTO) + std::ostream* output_stream_ = nullptr; + std::unique_ptr + trace_processor_; + TraceEventListener* listener_for_testing_ = nullptr; + std::unique_ptr tracing_session_; +#else // !defined(V8_USE_PERFETTO) + std::unique_ptr trace_buffer_; +#endif // !defined(V8_USE_PERFETTO) + + // Disallow copy and assign + TracingController(const TracingController&) = delete; + void operator=(const TracingController&) = delete; +}; + +#undef V8_PLATFORM_NON_EXPORTED_BASE + +} // namespace tracing +} // namespace platform +} // namespace v8 + +#endif // V8_LIBPLATFORM_V8_TRACING_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-cppgc.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-cppgc.h new file mode 100644 index 00000000000..745fb04347e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-cppgc.h @@ -0,0 +1,325 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_V8_CPPGC_H_ +#define INCLUDE_V8_CPPGC_H_ + +#include +#include +#include + +#include "cppgc/common.h" +#include "cppgc/custom-space.h" +#include "cppgc/heap-statistics.h" +#include "cppgc/internal/write-barrier.h" +#include "cppgc/visitor.h" +#include "v8-internal.h" // NOLINT(build/include_directory) +#include "v8.h" // NOLINT(build/include_directory) + +namespace cppgc { +class AllocationHandle; +class HeapHandle; +} // namespace cppgc + +namespace v8 { + +namespace internal { +class CppHeap; +} // namespace internal + +class CustomSpaceStatisticsReceiver; + +/** + * Describes how V8 wrapper objects maintain references to garbage-collected C++ + * objects. + */ +struct WrapperDescriptor final { + /** + * The index used on `v8::Ojbect::SetAlignedPointerFromInternalField()` and + * related APIs to add additional data to an object which is used to identify + * JS->C++ references. + */ + using InternalFieldIndex = int; + + /** + * Unknown embedder id. The value is reserved for internal usages and must not + * be used with `CppHeap`. + */ + static constexpr uint16_t kUnknownEmbedderId = UINT16_MAX; + + constexpr WrapperDescriptor(InternalFieldIndex wrappable_type_index, + InternalFieldIndex wrappable_instance_index, + uint16_t embedder_id_for_garbage_collected) + : wrappable_type_index(wrappable_type_index), + wrappable_instance_index(wrappable_instance_index), + embedder_id_for_garbage_collected(embedder_id_for_garbage_collected) {} + + /** + * Index of the wrappable type. + */ + InternalFieldIndex wrappable_type_index; + + /** + * Index of the wrappable instance. + */ + InternalFieldIndex wrappable_instance_index; + + /** + * Embedder id identifying instances of garbage-collected objects. It is + * expected that the first field of the wrappable type is a uint16_t holding + * the id. Only references to instances of wrappables types with an id of + * `embedder_id_for_garbage_collected` will be considered by CppHeap. + */ + uint16_t embedder_id_for_garbage_collected; +}; + +struct V8_EXPORT CppHeapCreateParams { + CppHeapCreateParams(const CppHeapCreateParams&) = delete; + CppHeapCreateParams& operator=(const CppHeapCreateParams&) = delete; + + std::vector> custom_spaces; + WrapperDescriptor wrapper_descriptor; +}; + +/** + * A heap for allocating managed C++ objects. + */ +class V8_EXPORT CppHeap { + public: + static std::unique_ptr Create(v8::Platform* platform, + const CppHeapCreateParams& params); + + virtual ~CppHeap() = default; + + /** + * \returns the opaque handle for allocating objects using + * `MakeGarbageCollected()`. + */ + cppgc::AllocationHandle& GetAllocationHandle(); + + /** + * \returns the opaque heap handle which may be used to refer to this heap in + * other APIs. Valid as long as the underlying `CppHeap` is alive. + */ + cppgc::HeapHandle& GetHeapHandle(); + + /** + * Terminate clears all roots and performs multiple garbage collections to + * reclaim potentially newly created objects in destructors. + * + * After this call, object allocation is prohibited. + */ + void Terminate(); + + /** + * \param detail_level specifies whether should return detailed + * statistics or only brief summary statistics. + * \returns current CppHeap statistics regarding memory consumption + * and utilization. + */ + cppgc::HeapStatistics CollectStatistics( + cppgc::HeapStatistics::DetailLevel detail_level); + + /** + * Collects statistics for the given spaces and reports them to the receiver. + * + * \param custom_spaces a collection of custom space indicies. + * \param receiver an object that gets the results. + */ + void CollectCustomSpaceStatisticsAtLastGC( + std::vector custom_spaces, + std::unique_ptr receiver); + + /** + * Enables a detached mode that allows testing garbage collection using + * `cppgc::testing` APIs. Once used, the heap cannot be attached to an + * `Isolate` anymore. + */ + void EnableDetachedGarbageCollectionsForTesting(); + + /** + * Performs a stop-the-world garbage collection for testing purposes. + * + * \param stack_state The stack state to assume for the garbage collection. + */ + void CollectGarbageForTesting(cppgc::EmbedderStackState stack_state); + + private: + CppHeap() = default; + + friend class internal::CppHeap; +}; + +class JSVisitor : public cppgc::Visitor { + public: + explicit JSVisitor(cppgc::Visitor::Key key) : cppgc::Visitor(key) {} + + void Trace(const TracedReferenceBase& ref) { + if (ref.IsEmptyThreadSafe()) return; + Visit(ref); + } + + protected: + using cppgc::Visitor::Visit; + + virtual void Visit(const TracedReferenceBase& ref) {} +}; + +/** + * **DO NOT USE: Use the appropriate managed types.** + * + * Consistency helpers that aid in maintaining a consistent internal state of + * the garbage collector. + */ +class V8_EXPORT JSHeapConsistency final { + public: + using WriteBarrierParams = cppgc::internal::WriteBarrier::Params; + using WriteBarrierType = cppgc::internal::WriteBarrier::Type; + + /** + * Gets the required write barrier type for a specific write. + * + * Note: Handling for C++ to JS references. + * + * \param ref The reference being written to. + * \param params Parameters that may be used for actual write barrier calls. + * Only filled if return value indicates that a write barrier is needed. The + * contents of the `params` are an implementation detail. + * \param callback Callback returning the corresponding heap handle. The + * callback is only invoked if the heap cannot otherwise be figured out. The + * callback must not allocate. + * \returns whether a write barrier is needed and which barrier to invoke. + */ + template + static V8_INLINE WriteBarrierType + GetWriteBarrierType(const TracedReferenceBase& ref, + WriteBarrierParams& params, HeapHandleCallback callback) { + if (ref.IsEmpty()) return WriteBarrierType::kNone; + + if (V8_LIKELY(!cppgc::internal::WriteBarrier:: + IsAnyIncrementalOrConcurrentMarking())) { + return cppgc::internal::WriteBarrier::Type::kNone; + } + cppgc::HeapHandle& handle = callback(); + if (!cppgc::subtle::HeapState::IsMarking(handle)) { + return cppgc::internal::WriteBarrier::Type::kNone; + } + params.heap = &handle; +#if V8_ENABLE_CHECKS + params.type = cppgc::internal::WriteBarrier::Type::kMarking; +#endif // !V8_ENABLE_CHECKS + return cppgc::internal::WriteBarrier::Type::kMarking; + } + + /** + * Gets the required write barrier type for a specific write. + * + * Note: Handling for JS to C++ references. + * + * \param wrapper The wrapper that has been written into. + * \param wrapper_index The wrapper index in `wrapper` that has been written + * into. + * \param wrappable The value that was written. + * \param params Parameters that may be used for actual write barrier calls. + * Only filled if return value indicates that a write barrier is needed. The + * contents of the `params` are an implementation detail. + * \param callback Callback returning the corresponding heap handle. The + * callback is only invoked if the heap cannot otherwise be figured out. The + * callback must not allocate. + * \returns whether a write barrier is needed and which barrier to invoke. + */ + template + static V8_INLINE WriteBarrierType GetWriteBarrierType( + v8::Local& wrapper, int wrapper_index, const void* wrappable, + WriteBarrierParams& params, HeapHandleCallback callback) { +#if V8_ENABLE_CHECKS + CheckWrapper(wrapper, wrapper_index, wrappable); +#endif // V8_ENABLE_CHECKS + return cppgc::internal::WriteBarrier:: + GetWriteBarrierTypeForExternallyReferencedObject(wrappable, params, + callback); + } + + /** + * Conservative Dijkstra-style write barrier that processes an object if it + * has not yet been processed. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param ref The reference being written to. + */ + static V8_INLINE void DijkstraMarkingBarrier(const WriteBarrierParams& params, + cppgc::HeapHandle& heap_handle, + const TracedReferenceBase& ref) { + cppgc::internal::WriteBarrier::CheckParams(WriteBarrierType::kMarking, + params); + DijkstraMarkingBarrierSlow(heap_handle, ref); + } + + /** + * Conservative Dijkstra-style write barrier that processes an object if it + * has not yet been processed. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param object The pointer to the object. May be an interior pointer to a + * an interface of the actual object. + */ + static V8_INLINE void DijkstraMarkingBarrier(const WriteBarrierParams& params, + cppgc::HeapHandle& heap_handle, + const void* object) { + cppgc::internal::WriteBarrier::DijkstraMarkingBarrier(params, object); + } + + /** + * Generational barrier for maintaining consistency when running with multiple + * generations. + * + * \param params The parameters retrieved from `GetWriteBarrierType()`. + * \param ref The reference being written to. + */ + static V8_INLINE void GenerationalBarrier(const WriteBarrierParams& params, + const TracedReferenceBase& ref) {} + + private: + JSHeapConsistency() = delete; + + static void CheckWrapper(v8::Local&, int, const void*); + + static void DijkstraMarkingBarrierSlow(cppgc::HeapHandle&, + const TracedReferenceBase& ref); +}; + +/** + * Provided as input to `CppHeap::CollectCustomSpaceStatisticsAtLastGC()`. + * + * Its method is invoked with the results of the statistic collection. + */ +class CustomSpaceStatisticsReceiver { + public: + virtual ~CustomSpaceStatisticsReceiver() = default; + /** + * Reports the size of a space at the last GC. It is called for each space + * that was requested in `CollectCustomSpaceStatisticsAtLastGC()`. + * + * \param space_index The index of the space. + * \param bytes The total size of live objects in the space at the last GC. + * It is zero if there was no GC yet. + */ + virtual void AllocatedBytes(cppgc::CustomSpaceIndex space_index, + size_t bytes) = 0; +}; + +} // namespace v8 + +namespace cppgc { + +template +struct TraceTrait> { + static void Trace(Visitor* visitor, const v8::TracedReference* self) { + static_cast(visitor)->Trace(*self); + } +}; + +} // namespace cppgc + +#endif // INCLUDE_V8_CPPGC_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-fast-api-calls.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-fast-api-calls.h new file mode 100644 index 00000000000..5dc7473eaa9 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-fast-api-calls.h @@ -0,0 +1,836 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * This file provides additional API on top of the default one for making + * API calls, which come from embedder C++ functions. The functions are being + * called directly from optimized code, doing all the necessary typechecks + * in the compiler itself, instead of on the embedder side. Hence the "fast" + * in the name. Example usage might look like: + * + * \code + * void FastMethod(int param, bool another_param); + * + * v8::FunctionTemplate::New(isolate, SlowCallback, data, + * signature, length, constructor_behavior + * side_effect_type, + * &v8::CFunction::Make(FastMethod)); + * \endcode + * + * By design, fast calls are limited by the following requirements, which + * the embedder should enforce themselves: + * - they should not allocate on the JS heap; + * - they should not trigger JS execution. + * To enforce them, the embedder could use the existing + * v8::Isolate::DisallowJavascriptExecutionScope and a utility similar to + * Blink's NoAllocationScope: + * https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/platform/heap/thread_state_scopes.h;l=16 + * + * Due to these limitations, it's not directly possible to report errors by + * throwing a JS exception or to otherwise do an allocation. There is an + * alternative way of creating fast calls that supports falling back to the + * slow call and then performing the necessary allocation. When one creates + * the fast method by using CFunction::MakeWithFallbackSupport instead of + * CFunction::Make, the fast callback gets as last parameter an output variable, + * through which it can request falling back to the slow call. So one might + * declare their method like: + * + * \code + * void FastMethodWithFallback(int param, FastApiCallbackOptions& options); + * \endcode + * + * If the callback wants to signal an error condition or to perform an + * allocation, it must set options.fallback to true and do an early return from + * the fast method. Then V8 checks the value of options.fallback and if it's + * true, falls back to executing the SlowCallback, which is capable of reporting + * the error (either by throwing a JS exception or logging to the console) or + * doing the allocation. It's the embedder's responsibility to ensure that the + * fast callback is idempotent up to the point where error and fallback + * conditions are checked, because otherwise executing the slow callback might + * produce visible side-effects twice. + * + * An example for custom embedder type support might employ a way to wrap/ + * unwrap various C++ types in JSObject instances, e.g: + * + * \code + * + * // Helper method with a check for field count. + * template + * inline T* GetInternalField(v8::Local wrapper) { + * assert(offset < wrapper->InternalFieldCount()); + * return reinterpret_cast( + * wrapper->GetAlignedPointerFromInternalField(offset)); + * } + * + * class CustomEmbedderType { + * public: + * // Returns the raw C object from a wrapper JS object. + * static CustomEmbedderType* Unwrap(v8::Local wrapper) { + * return GetInternalField(wrapper); + * } + * static void FastMethod(v8::Local receiver_obj, int param) { + * CustomEmbedderType* receiver = static_cast( + * receiver_obj->GetAlignedPointerFromInternalField( + * kV8EmbedderWrapperObjectIndex)); + * + * // Type checks are already done by the optimized code. + * // Then call some performance-critical method like: + * // receiver->Method(param); + * } + * + * static void SlowMethod( + * const v8::FunctionCallbackInfo& info) { + * v8::Local instance = + * v8::Local::Cast(info.Holder()); + * CustomEmbedderType* receiver = Unwrap(instance); + * // TODO: Do type checks and extract {param}. + * receiver->Method(param); + * } + * }; + * + * // TODO(mslekova): Clean-up these constants + * // The constants kV8EmbedderWrapperTypeIndex and + * // kV8EmbedderWrapperObjectIndex describe the offsets for the type info + * // struct and the native object, when expressed as internal field indices + * // within a JSObject. The existance of this helper function assumes that + * // all embedder objects have their JSObject-side type info at the same + * // offset, but this is not a limitation of the API itself. For a detailed + * // use case, see the third example. + * static constexpr int kV8EmbedderWrapperTypeIndex = 0; + * static constexpr int kV8EmbedderWrapperObjectIndex = 1; + * + * // The following setup function can be templatized based on + * // the {embedder_object} argument. + * void SetupCustomEmbedderObject(v8::Isolate* isolate, + * v8::Local context, + * CustomEmbedderType* embedder_object) { + * isolate->set_embedder_wrapper_type_index( + * kV8EmbedderWrapperTypeIndex); + * isolate->set_embedder_wrapper_object_index( + * kV8EmbedderWrapperObjectIndex); + * + * v8::CFunction c_func = + * MakeV8CFunction(CustomEmbedderType::FastMethod); + * + * Local method_template = + * v8::FunctionTemplate::New( + * isolate, CustomEmbedderType::SlowMethod, v8::Local(), + * v8::Local(), 1, v8::ConstructorBehavior::kAllow, + * v8::SideEffectType::kHasSideEffect, &c_func); + * + * v8::Local object_template = + * v8::ObjectTemplate::New(isolate); + * object_template->SetInternalFieldCount( + * kV8EmbedderWrapperObjectIndex + 1); + * object_template->Set(isolate, "method", method_template); + * + * // Instantiate the wrapper JS object. + * v8::Local object = + * object_template->NewInstance(context).ToLocalChecked(); + * object->SetAlignedPointerInInternalField( + * kV8EmbedderWrapperObjectIndex, + * reinterpret_cast(embedder_object)); + * + * // TODO: Expose {object} where it's necessary. + * } + * \endcode + * + * For instance if {object} is exposed via a global "obj" variable, + * one could write in JS: + * function hot_func() { + * obj.method(42); + * } + * and once {hot_func} gets optimized, CustomEmbedderType::FastMethod + * will be called instead of the slow version, with the following arguments: + * receiver := the {embedder_object} from above + * param := 42 + * + * Currently supported return types: + * - void + * - bool + * - int32_t + * - uint32_t + * - float32_t + * - float64_t + * Currently supported argument types: + * - pointer to an embedder type + * - JavaScript array of primitive types + * - bool + * - int32_t + * - uint32_t + * - int64_t + * - uint64_t + * - float32_t + * - float64_t + * + * The 64-bit integer types currently have the IDL (unsigned) long long + * semantics: https://heycam.github.io/webidl/#abstract-opdef-converttoint + * In the future we'll extend the API to also provide conversions from/to + * BigInt to preserve full precision. + * The floating point types currently have the IDL (unrestricted) semantics, + * which is the only one used by WebGL. We plan to add support also for + * restricted floats/doubles, similarly to the BigInt conversion policies. + * We also differ from the specific NaN bit pattern that WebIDL prescribes + * (https://heycam.github.io/webidl/#es-unrestricted-float) in that Blink + * passes NaN values as-is, i.e. doesn't normalize them. + * + * To be supported types: + * - TypedArrays and ArrayBuffers + * - arrays of embedder types + * + * + * The API offers a limited support for function overloads: + * + * \code + * void FastMethod_2Args(int param, bool another_param); + * void FastMethod_3Args(int param, bool another_param, int third_param); + * + * v8::CFunction fast_method_2args_c_func = + * MakeV8CFunction(FastMethod_2Args); + * v8::CFunction fast_method_3args_c_func = + * MakeV8CFunction(FastMethod_3Args); + * const v8::CFunction fast_method_overloads[] = {fast_method_2args_c_func, + * fast_method_3args_c_func}; + * Local method_template = + * v8::FunctionTemplate::NewWithCFunctionOverloads( + * isolate, SlowCallback, data, signature, length, + * constructor_behavior, side_effect_type, + * {fast_method_overloads, 2}); + * \endcode + * + * In this example a single FunctionTemplate is associated to multiple C++ + * functions. The overload resolution is currently only based on the number of + * arguments passed in a call. For example, if this method_template is + * registered with a wrapper JS object as described above, a call with two + * arguments: + * obj.method(42, true); + * will result in a fast call to FastMethod_2Args, while a call with three or + * more arguments: + * obj.method(42, true, 11); + * will result in a fast call to FastMethod_3Args. Instead a call with less than + * two arguments, like: + * obj.method(42); + * would not result in a fast call but would fall back to executing the + * associated SlowCallback. + */ + +#ifndef INCLUDE_V8_FAST_API_CALLS_H_ +#define INCLUDE_V8_FAST_API_CALLS_H_ + +#include +#include + +#include +#include + +#include "v8-internal.h" // NOLINT(build/include_directory) +#include "v8.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) + +namespace v8 { + +class Isolate; + +class CTypeInfo { + public: + enum class Type : uint8_t { + kVoid, + kBool, + kInt32, + kUint32, + kInt64, + kUint64, + kFloat32, + kFloat64, + kV8Value, + kApiObject, // This will be deprecated once all users have + // migrated from v8::ApiObject to v8::Local. + }; + + // kCallbackOptionsType is not part of the Type enum + // because it is only used internally. Use value 255 that is larger + // than any valid Type enum. + static constexpr Type kCallbackOptionsType = Type(255); + + enum class SequenceType : uint8_t { + kScalar, + kIsSequence, // sequence + kIsTypedArray, // TypedArray of T or any ArrayBufferView if T + // is void + kIsArrayBuffer // ArrayBuffer + }; + + enum class Flags : uint8_t { + kNone = 0, + kAllowSharedBit = 1 << 0, // Must be an ArrayBuffer or TypedArray + kEnforceRangeBit = 1 << 1, // T must be integral + kClampBit = 1 << 2, // T must be integral + kIsRestrictedBit = 1 << 3, // T must be float or double + }; + + explicit constexpr CTypeInfo( + Type type, SequenceType sequence_type = SequenceType::kScalar, + Flags flags = Flags::kNone) + : type_(type), sequence_type_(sequence_type), flags_(flags) {} + + constexpr Type GetType() const { return type_; } + constexpr SequenceType GetSequenceType() const { return sequence_type_; } + constexpr Flags GetFlags() const { return flags_; } + + static constexpr bool IsIntegralType(Type type) { + return type == Type::kInt32 || type == Type::kUint32 || + type == Type::kInt64 || type == Type::kUint64; + } + + static constexpr bool IsFloatingPointType(Type type) { + return type == Type::kFloat32 || type == Type::kFloat64; + } + + static constexpr bool IsPrimitive(Type type) { + return IsIntegralType(type) || IsFloatingPointType(type) || + type == Type::kBool; + } + + private: + Type type_; + SequenceType sequence_type_; + Flags flags_; +}; + +struct FastApiTypedArrayBase { + public: + // Returns the length in number of elements. + size_t V8_EXPORT length() const { return length_; } + // Checks whether the given index is within the bounds of the collection. + void V8_EXPORT ValidateIndex(size_t index) const; + + protected: + size_t length_ = 0; +}; + +template +struct FastApiTypedArray : public FastApiTypedArrayBase { + public: + V8_INLINE T get(size_t index) const { +#ifdef DEBUG + ValidateIndex(index); +#endif // DEBUG + T tmp; + memcpy(&tmp, reinterpret_cast(data_) + index, sizeof(T)); + return tmp; + } + + private: + // This pointer should include the typed array offset applied. + // It's not guaranteed that it's aligned to sizeof(T), it's only + // guaranteed that it's 4-byte aligned, so for 8-byte types we need to + // provide a special implementation for reading from it, which hides + // the possibly unaligned read in the `get` method. + void* data_; +}; + +// Any TypedArray. It uses kTypedArrayBit with base type void +// Overloaded args of ArrayBufferView and TypedArray are not supported +// (for now) because the generic “any” ArrayBufferView doesn’t have its +// own instance type. It could be supported if we specify that +// TypedArray always has precedence over the generic ArrayBufferView, +// but this complicates overload resolution. +struct FastApiArrayBufferView { + void* data; + size_t byte_length; +}; + +struct FastApiArrayBuffer { + void* data; + size_t byte_length; +}; + +class V8_EXPORT CFunctionInfo { + public: + // Construct a struct to hold a CFunction's type information. + // |return_info| describes the function's return type. + // |arg_info| is an array of |arg_count| CTypeInfos describing the + // arguments. Only the last argument may be of the special type + // CTypeInfo::kCallbackOptionsType. + CFunctionInfo(const CTypeInfo& return_info, unsigned int arg_count, + const CTypeInfo* arg_info); + + const CTypeInfo& ReturnInfo() const { return return_info_; } + + // The argument count, not including the v8::FastApiCallbackOptions + // if present. + unsigned int ArgumentCount() const { + return HasOptions() ? arg_count_ - 1 : arg_count_; + } + + // |index| must be less than ArgumentCount(). + // Note: if the last argument passed on construction of CFunctionInfo + // has type CTypeInfo::kCallbackOptionsType, it is not included in + // ArgumentCount(). + const CTypeInfo& ArgumentInfo(unsigned int index) const; + + bool HasOptions() const { + // The options arg is always the last one. + return arg_count_ > 0 && arg_info_[arg_count_ - 1].GetType() == + CTypeInfo::kCallbackOptionsType; + } + + private: + const CTypeInfo return_info_; + const unsigned int arg_count_; + const CTypeInfo* arg_info_; +}; + +class V8_EXPORT CFunction { + public: + constexpr CFunction() : address_(nullptr), type_info_(nullptr) {} + + const CTypeInfo& ReturnInfo() const { return type_info_->ReturnInfo(); } + + const CTypeInfo& ArgumentInfo(unsigned int index) const { + return type_info_->ArgumentInfo(index); + } + + unsigned int ArgumentCount() const { return type_info_->ArgumentCount(); } + + const void* GetAddress() const { return address_; } + const CFunctionInfo* GetTypeInfo() const { return type_info_; } + + enum class OverloadResolution { kImpossible, kAtRuntime, kAtCompileTime }; + + // Returns whether an overload between this and the given CFunction can + // be resolved at runtime by the RTTI available for the arguments or at + // compile time for functions with different number of arguments. + OverloadResolution GetOverloadResolution(const CFunction* other) { + // Runtime overload resolution can only deal with functions with the + // same number of arguments. Functions with different arity are handled + // by compile time overload resolution though. + if (ArgumentCount() != other->ArgumentCount()) { + return OverloadResolution::kAtCompileTime; + } + + // The functions can only differ by a single argument position. + int diff_index = -1; + for (unsigned int i = 0; i < ArgumentCount(); ++i) { + if (ArgumentInfo(i).GetSequenceType() != + other->ArgumentInfo(i).GetSequenceType()) { + if (diff_index >= 0) { + return OverloadResolution::kImpossible; + } + diff_index = i; + + // We only support overload resolution between sequence types. + if (ArgumentInfo(i).GetSequenceType() == + CTypeInfo::SequenceType::kScalar || + other->ArgumentInfo(i).GetSequenceType() == + CTypeInfo::SequenceType::kScalar) { + return OverloadResolution::kImpossible; + } + } + } + + return OverloadResolution::kAtRuntime; + } + + template + static CFunction Make(F* func) { + return ArgUnwrap::Make(func); + } + + template + V8_DEPRECATED("Use CFunctionBuilder instead.") + static CFunction MakeWithFallbackSupport(F* func) { + return ArgUnwrap::Make(func); + } + + CFunction(const void* address, const CFunctionInfo* type_info); + + private: + const void* address_; + const CFunctionInfo* type_info_; + + template + class ArgUnwrap { + static_assert(sizeof(F) != sizeof(F), + "CFunction must be created from a function pointer."); + }; + + template + class ArgUnwrap { + public: + static CFunction Make(R (*func)(Args...)); + }; +}; + +struct ApiObject { + uintptr_t address; +}; + +/** + * A struct which may be passed to a fast call callback, like so: + * \code + * void FastMethodWithOptions(int param, FastApiCallbackOptions& options); + * \endcode + */ +struct FastApiCallbackOptions { + /** + * Creates a new instance of FastApiCallbackOptions for testing purpose. The + * returned instance may be filled with mock data. + */ + static FastApiCallbackOptions CreateForTesting(Isolate* isolate) { + return {false, {0}}; + } + + /** + * If the callback wants to signal an error condition or to perform an + * allocation, it must set options.fallback to true and do an early return + * from the fast method. Then V8 checks the value of options.fallback and if + * it's true, falls back to executing the SlowCallback, which is capable of + * reporting the error (either by throwing a JS exception or logging to the + * console) or doing the allocation. It's the embedder's responsibility to + * ensure that the fast callback is idempotent up to the point where error and + * fallback conditions are checked, because otherwise executing the slow + * callback might produce visible side-effects twice. + */ + bool fallback; + + /** + * The `data` passed to the FunctionTemplate constructor, or `undefined`. + * `data_ptr` allows for default constructing FastApiCallbackOptions. + */ + union { + uintptr_t data_ptr; + v8::Value data; + }; +}; + +namespace internal { + +// Helper to count the number of occurances of `T` in `List` +template +struct count : std::integral_constant {}; +template +struct count + : std::integral_constant::value> {}; +template +struct count : count {}; + +template +class CFunctionInfoImpl : public CFunctionInfo { + static constexpr int kOptionsArgCount = + count(); + static constexpr int kReceiverCount = 1; + + static_assert(kOptionsArgCount == 0 || kOptionsArgCount == 1, + "Only one options parameter is supported."); + + static_assert(sizeof...(ArgBuilders) >= kOptionsArgCount + kReceiverCount, + "The receiver or the options argument is missing."); + + public: + constexpr CFunctionInfoImpl() + : CFunctionInfo(RetBuilder::Build(), sizeof...(ArgBuilders), + arg_info_storage_), + arg_info_storage_{ArgBuilders::Build()...} { + constexpr CTypeInfo::Type kReturnType = RetBuilder::Build().GetType(); + static_assert(kReturnType == CTypeInfo::Type::kVoid || + kReturnType == CTypeInfo::Type::kBool || + kReturnType == CTypeInfo::Type::kInt32 || + kReturnType == CTypeInfo::Type::kUint32 || + kReturnType == CTypeInfo::Type::kFloat32 || + kReturnType == CTypeInfo::Type::kFloat64, + "64-bit int and api object values are not currently " + "supported return types."); + } + + private: + const CTypeInfo arg_info_storage_[sizeof...(ArgBuilders)]; +}; + +template +struct TypeInfoHelper { + static_assert(sizeof(T) != sizeof(T), "This type is not supported"); +}; + +#define SPECIALIZE_GET_TYPE_INFO_HELPER_FOR(T, Enum) \ + template <> \ + struct TypeInfoHelper { \ + static constexpr CTypeInfo::Flags Flags() { \ + return CTypeInfo::Flags::kNone; \ + } \ + \ + static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::Enum; } \ + static constexpr CTypeInfo::SequenceType SequenceType() { \ + return CTypeInfo::SequenceType::kScalar; \ + } \ + }; + +template +struct CTypeInfoTraits {}; + +#define DEFINE_TYPE_INFO_TRAITS(CType, Enum) \ + template <> \ + struct CTypeInfoTraits { \ + using ctype = CType; \ + }; + +#define PRIMITIVE_C_TYPES(V) \ + V(bool, kBool) \ + V(int32_t, kInt32) \ + V(uint32_t, kUint32) \ + V(int64_t, kInt64) \ + V(uint64_t, kUint64) \ + V(float, kFloat32) \ + V(double, kFloat64) + +// Same as above, but includes deprecated types for compatibility. +#define ALL_C_TYPES(V) \ + PRIMITIVE_C_TYPES(V) \ + V(void, kVoid) \ + V(v8::Local, kV8Value) \ + V(v8::Local, kV8Value) \ + V(ApiObject, kApiObject) + +// ApiObject was a temporary solution to wrap the pointer to the v8::Value. +// Please use v8::Local in new code for the arguments and +// v8::Local for the receiver, as ApiObject will be deprecated. + +ALL_C_TYPES(SPECIALIZE_GET_TYPE_INFO_HELPER_FOR) +PRIMITIVE_C_TYPES(DEFINE_TYPE_INFO_TRAITS) + +#undef PRIMITIVE_C_TYPES +#undef ALL_C_TYPES + +#define SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA(T, Enum) \ + template <> \ + struct TypeInfoHelper&> { \ + static constexpr CTypeInfo::Flags Flags() { \ + return CTypeInfo::Flags::kNone; \ + } \ + \ + static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::Enum; } \ + static constexpr CTypeInfo::SequenceType SequenceType() { \ + return CTypeInfo::SequenceType::kIsTypedArray; \ + } \ + }; + +#define TYPED_ARRAY_C_TYPES(V) \ + V(int32_t, kInt32) \ + V(uint32_t, kUint32) \ + V(int64_t, kInt64) \ + V(uint64_t, kUint64) \ + V(float, kFloat32) \ + V(double, kFloat64) + +TYPED_ARRAY_C_TYPES(SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA) + +#undef TYPED_ARRAY_C_TYPES + +template <> +struct TypeInfoHelper> { + static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; } + + static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::kVoid; } + static constexpr CTypeInfo::SequenceType SequenceType() { + return CTypeInfo::SequenceType::kIsSequence; + } +}; + +template <> +struct TypeInfoHelper> { + static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; } + + static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::kUint32; } + static constexpr CTypeInfo::SequenceType SequenceType() { + return CTypeInfo::SequenceType::kIsTypedArray; + } +}; + +template <> +struct TypeInfoHelper { + static constexpr CTypeInfo::Flags Flags() { return CTypeInfo::Flags::kNone; } + + static constexpr CTypeInfo::Type Type() { + return CTypeInfo::kCallbackOptionsType; + } + static constexpr CTypeInfo::SequenceType SequenceType() { + return CTypeInfo::SequenceType::kScalar; + } +}; + +#define STATIC_ASSERT_IMPLIES(COND, ASSERTION, MSG) \ + static_assert(((COND) == 0) || (ASSERTION), MSG) + +template +class CTypeInfoBuilder { + public: + using BaseType = T; + + static constexpr CTypeInfo Build() { + constexpr CTypeInfo::Flags kFlags = + MergeFlags(TypeInfoHelper::Flags(), Flags...); + constexpr CTypeInfo::Type kType = TypeInfoHelper::Type(); + constexpr CTypeInfo::SequenceType kSequenceType = + TypeInfoHelper::SequenceType(); + + STATIC_ASSERT_IMPLIES( + uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kAllowSharedBit), + (kSequenceType == CTypeInfo::SequenceType::kIsTypedArray || + kSequenceType == CTypeInfo::SequenceType::kIsArrayBuffer), + "kAllowSharedBit is only allowed for TypedArrays and ArrayBuffers."); + STATIC_ASSERT_IMPLIES( + uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kEnforceRangeBit), + CTypeInfo::IsIntegralType(kType), + "kEnforceRangeBit is only allowed for integral types."); + STATIC_ASSERT_IMPLIES( + uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kClampBit), + CTypeInfo::IsIntegralType(kType), + "kClampBit is only allowed for integral types."); + STATIC_ASSERT_IMPLIES( + uint8_t(kFlags) & uint8_t(CTypeInfo::Flags::kIsRestrictedBit), + CTypeInfo::IsFloatingPointType(kType), + "kIsRestrictedBit is only allowed for floating point types."); + STATIC_ASSERT_IMPLIES(kSequenceType == CTypeInfo::SequenceType::kIsSequence, + kType == CTypeInfo::Type::kVoid, + "Sequences are only supported from void type."); + STATIC_ASSERT_IMPLIES( + kSequenceType == CTypeInfo::SequenceType::kIsTypedArray, + CTypeInfo::IsPrimitive(kType) || kType == CTypeInfo::Type::kVoid, + "TypedArrays are only supported from primitive types or void."); + + // Return the same type with the merged flags. + return CTypeInfo(TypeInfoHelper::Type(), + TypeInfoHelper::SequenceType(), kFlags); + } + + private: + template + static constexpr CTypeInfo::Flags MergeFlags(CTypeInfo::Flags flags, + Rest... rest) { + return CTypeInfo::Flags(uint8_t(flags) | uint8_t(MergeFlags(rest...))); + } + static constexpr CTypeInfo::Flags MergeFlags() { return CTypeInfo::Flags(0); } +}; + +template +class CFunctionBuilderWithFunction { + public: + explicit constexpr CFunctionBuilderWithFunction(const void* fn) : fn_(fn) {} + + template + constexpr auto Ret() { + return CFunctionBuilderWithFunction< + CTypeInfoBuilder, + ArgBuilders...>(fn_); + } + + template + constexpr auto Arg() { + // Return a copy of the builder with the Nth arg builder merged with + // template parameter pack Flags. + return ArgImpl( + std::make_index_sequence()); + } + + auto Build() { + static CFunctionInfoImpl instance; + return CFunction(fn_, &instance); + } + + private: + template + struct GetArgBuilder; + + // Returns the same ArgBuilder as the one at index N, including its flags. + // Flags in the template parameter pack are ignored. + template + struct GetArgBuilder { + using type = + typename std::tuple_element>::type; + }; + + // Returns an ArgBuilder with the same base type as the one at index N, + // but merges the flags with the flags in the template parameter pack. + template + struct GetArgBuilder { + using type = CTypeInfoBuilder< + typename std::tuple_element>::type::BaseType, + std::tuple_element>::type::Build() + .GetFlags(), + Flags...>; + }; + + // Return a copy of the CFunctionBuilder, but merges the Flags on + // ArgBuilder index N with the new Flags passed in the template parameter + // pack. + template + constexpr auto ArgImpl(std::index_sequence) { + return CFunctionBuilderWithFunction< + RetBuilder, typename GetArgBuilder::type...>(fn_); + } + + const void* fn_; +}; + +class CFunctionBuilder { + public: + constexpr CFunctionBuilder() {} + + template + constexpr auto Fn(R (*fn)(Args...)) { + return CFunctionBuilderWithFunction, + CTypeInfoBuilder...>( + reinterpret_cast(fn)); + } +}; + +} // namespace internal + +// static +template +CFunction CFunction::ArgUnwrap::Make(R (*func)(Args...)) { + return internal::CFunctionBuilder().Fn(func).Build(); +} + +using CFunctionBuilder = internal::CFunctionBuilder; + +static constexpr CTypeInfo kTypeInfoInt32 = CTypeInfo(CTypeInfo::Type::kInt32); +static constexpr CTypeInfo kTypeInfoFloat64 = + CTypeInfo(CTypeInfo::Type::kFloat64); + +/** + * Copies the contents of this JavaScript array to a C++ buffer with + * a given max_length. A CTypeInfo is passed as an argument, + * instructing different rules for conversion (e.g. restricted float/double). + * The element type T of the destination array must match the C type + * corresponding to the CTypeInfo (specified by CTypeInfoTraits). + * If the array length is larger than max_length or the array is of + * unsupported type, the operation will fail, returning false. Generally, an + * array which contains objects, undefined, null or anything not convertible + * to the requested destination type, is considered unsupported. The operation + * returns true on success. `type_info` will be used for conversions. + */ +template +bool V8_EXPORT V8_WARN_UNUSED_RESULT TryCopyAndConvertArrayToCppBuffer( + Local src, T* dst, uint32_t max_length); + +template <> +inline bool V8_WARN_UNUSED_RESULT +TryCopyAndConvertArrayToCppBuffer<&kTypeInfoInt32, int32_t>( + Local src, int32_t* dst, uint32_t max_length) { + return CopyAndConvertArrayToCppBufferInt32(src, dst, max_length); +} + +template <> +inline bool V8_WARN_UNUSED_RESULT +TryCopyAndConvertArrayToCppBuffer<&kTypeInfoFloat64, double>( + Local src, double* dst, uint32_t max_length) { + return CopyAndConvertArrayToCppBufferFloat64(src, dst, max_length); +} + +} // namespace v8 + +#endif // INCLUDE_V8_FAST_API_CALLS_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-inspector-protocol.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-inspector-protocol.h new file mode 100644 index 00000000000..a5ffb7d6954 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-inspector-protocol.h @@ -0,0 +1,13 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_V8_INSPECTOR_PROTOCOL_H_ +#define V8_V8_INSPECTOR_PROTOCOL_H_ + +#include "inspector/Debugger.h" // NOLINT(build/include_directory) +#include "inspector/Runtime.h" // NOLINT(build/include_directory) +#include "inspector/Schema.h" // NOLINT(build/include_directory) +#include "v8-inspector.h" // NOLINT(build/include_directory) + +#endif // V8_V8_INSPECTOR_PROTOCOL_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-inspector.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-inspector.h new file mode 100644 index 00000000000..e6621ccd75c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-inspector.h @@ -0,0 +1,345 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_V8_INSPECTOR_H_ +#define V8_V8_INSPECTOR_H_ + +#include +#include + +#include +#include + +#include "v8.h" // NOLINT(build/include_directory) + +namespace v8_inspector { + +namespace protocol { +namespace Debugger { +namespace API { +class SearchMatch; +} +} +namespace Runtime { +namespace API { +class RemoteObject; +class StackTrace; +class StackTraceId; +} +} +namespace Schema { +namespace API { +class Domain; +} +} +} // namespace protocol + +class V8_EXPORT StringView { + public: + StringView() : m_is8Bit(true), m_length(0), m_characters8(nullptr) {} + + StringView(const uint8_t* characters, size_t length) + : m_is8Bit(true), m_length(length), m_characters8(characters) {} + + StringView(const uint16_t* characters, size_t length) + : m_is8Bit(false), m_length(length), m_characters16(characters) {} + + bool is8Bit() const { return m_is8Bit; } + size_t length() const { return m_length; } + + // TODO(dgozman): add DCHECK(m_is8Bit) to accessors once platform can be used + // here. + const uint8_t* characters8() const { return m_characters8; } + const uint16_t* characters16() const { return m_characters16; } + + private: + bool m_is8Bit; + size_t m_length; + union { + const uint8_t* m_characters8; + const uint16_t* m_characters16; + }; +}; + +class V8_EXPORT StringBuffer { + public: + virtual ~StringBuffer() = default; + virtual StringView string() const = 0; + // This method copies contents. + static std::unique_ptr create(StringView); +}; + +class V8_EXPORT V8ContextInfo { + public: + V8ContextInfo(v8::Local context, int contextGroupId, + StringView humanReadableName) + : context(context), + contextGroupId(contextGroupId), + humanReadableName(humanReadableName), + hasMemoryOnConsole(false) {} + + v8::Local context; + // Each v8::Context is a part of a group. The group id must be non-zero. + int contextGroupId; + StringView humanReadableName; + StringView origin; + StringView auxData; + bool hasMemoryOnConsole; + + static int executionContextId(v8::Local context); + + // Disallow copying and allocating this one. + enum NotNullTagEnum { NotNullLiteral }; + void* operator new(size_t) = delete; + void* operator new(size_t, NotNullTagEnum, void*) = delete; + void* operator new(size_t, void*) = delete; + V8ContextInfo(const V8ContextInfo&) = delete; + V8ContextInfo& operator=(const V8ContextInfo&) = delete; +}; + +class V8_EXPORT V8StackTrace { + public: + virtual StringView firstNonEmptySourceURL() const = 0; + virtual bool isEmpty() const = 0; + virtual StringView topSourceURL() const = 0; + virtual int topLineNumber() const = 0; + virtual int topColumnNumber() const = 0; + virtual int topScriptId() const = 0; + V8_DEPRECATE_SOON("Use V8::StackTrace::topScriptId() instead.") + int topScriptIdAsInteger() const { return topScriptId(); } + virtual StringView topFunctionName() const = 0; + + virtual ~V8StackTrace() = default; + virtual std::unique_ptr + buildInspectorObject() const = 0; + virtual std::unique_ptr + buildInspectorObject(int maxAsyncDepth) const = 0; + virtual std::unique_ptr toString() const = 0; + + // Safe to pass between threads, drops async chain. + virtual std::unique_ptr clone() = 0; +}; + +class V8_EXPORT V8InspectorSession { + public: + virtual ~V8InspectorSession() = default; + + // Cross-context inspectable values (DOM nodes in different worlds, etc.). + class V8_EXPORT Inspectable { + public: + virtual v8::Local get(v8::Local) = 0; + virtual ~Inspectable() = default; + }; + class V8_EXPORT CommandLineAPIScope { + public: + virtual ~CommandLineAPIScope() = default; + }; + virtual void addInspectedObject(std::unique_ptr) = 0; + + // Dispatching protocol messages. + static bool canDispatchMethod(StringView method); + virtual void dispatchProtocolMessage(StringView message) = 0; + virtual std::vector state() = 0; + virtual std::vector> + supportedDomains() = 0; + + virtual std::unique_ptr + initializeCommandLineAPIScope(int executionContextId) = 0; + + // Debugger actions. + virtual void schedulePauseOnNextStatement(StringView breakReason, + StringView breakDetails) = 0; + virtual void cancelPauseOnNextStatement() = 0; + virtual void breakProgram(StringView breakReason, + StringView breakDetails) = 0; + virtual void setSkipAllPauses(bool) = 0; + virtual void resume(bool setTerminateOnResume = false) = 0; + virtual void stepOver() = 0; + virtual std::vector> + searchInTextByLines(StringView text, StringView query, bool caseSensitive, + bool isRegex) = 0; + + // Remote objects. + virtual std::unique_ptr wrapObject( + v8::Local, v8::Local, StringView groupName, + bool generatePreview) = 0; + + virtual bool unwrapObject(std::unique_ptr* error, + StringView objectId, v8::Local*, + v8::Local*, + std::unique_ptr* objectGroup) = 0; + virtual void releaseObjectGroup(StringView) = 0; + virtual void triggerPreciseCoverageDeltaUpdate(StringView occasion) = 0; +}; + +class V8_EXPORT V8InspectorClient { + public: + virtual ~V8InspectorClient() = default; + + virtual void runMessageLoopOnPause(int contextGroupId) {} + virtual void quitMessageLoopOnPause() {} + virtual void runIfWaitingForDebugger(int contextGroupId) {} + + virtual void muteMetrics(int contextGroupId) {} + virtual void unmuteMetrics(int contextGroupId) {} + + virtual void beginUserGesture() {} + virtual void endUserGesture() {} + + virtual std::unique_ptr valueSubtype(v8::Local) { + return nullptr; + } + virtual std::unique_ptr descriptionForValueSubtype( + v8::Local, v8::Local) { + return nullptr; + } + virtual bool isInspectableHeapObject(v8::Local) { return true; } + + virtual v8::Local ensureDefaultContextInGroup( + int contextGroupId) { + return v8::Local(); + } + virtual void beginEnsureAllContextsInGroup(int contextGroupId) {} + virtual void endEnsureAllContextsInGroup(int contextGroupId) {} + + virtual void installAdditionalCommandLineAPI(v8::Local, + v8::Local) {} + virtual void consoleAPIMessage(int contextGroupId, + v8::Isolate::MessageErrorLevel level, + const StringView& message, + const StringView& url, unsigned lineNumber, + unsigned columnNumber, V8StackTrace*) {} + virtual v8::MaybeLocal memoryInfo(v8::Isolate*, + v8::Local) { + return v8::MaybeLocal(); + } + + virtual void consoleTime(const StringView& title) {} + virtual void consoleTimeEnd(const StringView& title) {} + virtual void consoleTimeStamp(const StringView& title) {} + virtual void consoleClear(int contextGroupId) {} + virtual double currentTimeMS() { return 0; } + typedef void (*TimerCallback)(void*); + virtual void startRepeatingTimer(double, TimerCallback, void* data) {} + virtual void cancelTimer(void* data) {} + + // TODO(dgozman): this was added to support service worker shadow page. We + // should not connect at all. + virtual bool canExecuteScripts(int contextGroupId) { return true; } + + virtual void maxAsyncCallStackDepthChanged(int depth) {} + + virtual std::unique_ptr resourceNameToUrl( + const StringView& resourceName) { + return nullptr; + } + + // The caller would defer to generating a random 64 bit integer if + // this method returns 0. + virtual int64_t generateUniqueId() { return 0; } +}; + +// These stack trace ids are intended to be passed between debuggers and be +// resolved later. This allows to track cross-debugger calls and step between +// them if a single client connects to multiple debuggers. +struct V8_EXPORT V8StackTraceId { + uintptr_t id; + std::pair debugger_id; + bool should_pause = false; + + V8StackTraceId(); + V8StackTraceId(const V8StackTraceId&) = default; + V8StackTraceId(uintptr_t id, const std::pair debugger_id); + V8StackTraceId(uintptr_t id, const std::pair debugger_id, + bool should_pause); + explicit V8StackTraceId(StringView); + V8StackTraceId& operator=(const V8StackTraceId&) = default; + V8StackTraceId& operator=(V8StackTraceId&&) noexcept = default; + ~V8StackTraceId() = default; + + bool IsInvalid() const; + std::unique_ptr ToString(); +}; + +class V8_EXPORT V8Inspector { + public: + static std::unique_ptr create(v8::Isolate*, V8InspectorClient*); + virtual ~V8Inspector() = default; + + // Contexts instrumentation. + virtual void contextCreated(const V8ContextInfo&) = 0; + virtual void contextDestroyed(v8::Local) = 0; + virtual void resetContextGroup(int contextGroupId) = 0; + virtual v8::MaybeLocal contextById(int contextId) = 0; + + // Various instrumentation. + virtual void idleStarted() = 0; + virtual void idleFinished() = 0; + + // Async stack traces instrumentation. + virtual void asyncTaskScheduled(StringView taskName, void* task, + bool recurring) = 0; + virtual void asyncTaskCanceled(void* task) = 0; + virtual void asyncTaskStarted(void* task) = 0; + virtual void asyncTaskFinished(void* task) = 0; + virtual void allAsyncTasksCanceled() = 0; + + virtual V8StackTraceId storeCurrentStackTrace(StringView description) = 0; + virtual void externalAsyncTaskStarted(const V8StackTraceId& parent) = 0; + virtual void externalAsyncTaskFinished(const V8StackTraceId& parent) = 0; + + // Exceptions instrumentation. + virtual unsigned exceptionThrown(v8::Local, StringView message, + v8::Local exception, + StringView detailedMessage, StringView url, + unsigned lineNumber, unsigned columnNumber, + std::unique_ptr, + int scriptId) = 0; + virtual void exceptionRevoked(v8::Local, unsigned exceptionId, + StringView message) = 0; + virtual bool associateExceptionData(v8::Local, + v8::Local exception, + v8::Local key, + v8::Local value) = 0; + + // Connection. + class V8_EXPORT Channel { + public: + virtual ~Channel() = default; + virtual void sendResponse(int callId, + std::unique_ptr message) = 0; + virtual void sendNotification(std::unique_ptr message) = 0; + virtual void flushProtocolNotifications() = 0; + }; + virtual std::unique_ptr connect(int contextGroupId, + Channel*, + StringView state) = 0; + + // API methods. + virtual std::unique_ptr createStackTrace( + v8::Local) = 0; + virtual std::unique_ptr captureStackTrace(bool fullStack) = 0; + + // Performance counters. + class V8_EXPORT Counters : public std::enable_shared_from_this { + public: + explicit Counters(v8::Isolate* isolate); + ~Counters(); + const std::unordered_map& getCountersMap() const { + return m_countersMap; + } + + private: + static int* getCounterPtr(const char* name); + + v8::Isolate* m_isolate; + std::unordered_map m_countersMap; + }; + + virtual std::shared_ptr enableCounters() = 0; +}; + +} // namespace v8_inspector + +#endif // V8_V8_INSPECTOR_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-internal.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-internal.h new file mode 100644 index 00000000000..0b95c2cacf0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-internal.h @@ -0,0 +1,511 @@ +// Copyright 2018 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_V8_INTERNAL_H_ +#define INCLUDE_V8_INTERNAL_H_ + +#include +#include +#include +#include + +#include "v8-version.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) + +namespace v8 { + +class Array; +class Context; +class Data; +class Isolate; +template +class Local; + +namespace internal { + +class Isolate; + +typedef uintptr_t Address; +static const Address kNullAddress = 0; + +/** + * Configuration of tagging scheme. + */ +const int kApiSystemPointerSize = sizeof(void*); +const int kApiDoubleSize = sizeof(double); +const int kApiInt32Size = sizeof(int32_t); +const int kApiInt64Size = sizeof(int64_t); + +// Tag information for HeapObject. +const int kHeapObjectTag = 1; +const int kWeakHeapObjectTag = 3; +const int kHeapObjectTagSize = 2; +const intptr_t kHeapObjectTagMask = (1 << kHeapObjectTagSize) - 1; + +// Tag information for fowarding pointers stored in object headers. +// 0b00 at the lowest 2 bits in the header indicates that the map word is a +// forwarding pointer. +const int kForwardingTag = 0; +const int kForwardingTagSize = 2; +const intptr_t kForwardingTagMask = (1 << kForwardingTagSize) - 1; + +// Tag information for Smi. +const int kSmiTag = 0; +const int kSmiTagSize = 1; +const intptr_t kSmiTagMask = (1 << kSmiTagSize) - 1; + +template +struct SmiTagging; + +constexpr intptr_t kIntptrAllBitsSet = intptr_t{-1}; +constexpr uintptr_t kUintptrAllBitsSet = + static_cast(kIntptrAllBitsSet); + +// Smi constants for systems where tagged pointer is a 32-bit value. +template <> +struct SmiTagging<4> { + enum { kSmiShiftSize = 0, kSmiValueSize = 31 }; + + static constexpr intptr_t kSmiMinValue = + static_cast(kUintptrAllBitsSet << (kSmiValueSize - 1)); + static constexpr intptr_t kSmiMaxValue = -(kSmiMinValue + 1); + + V8_INLINE static int SmiToInt(const internal::Address value) { + int shift_bits = kSmiTagSize + kSmiShiftSize; + // Truncate and shift down (requires >> to be sign extending). + return static_cast(static_cast(value)) >> shift_bits; + } + V8_INLINE static constexpr bool IsValidSmi(intptr_t value) { + // Is value in range [kSmiMinValue, kSmiMaxValue]. + // Use unsigned operations in order to avoid undefined behaviour in case of + // signed integer overflow. + return (static_cast(value) - + static_cast(kSmiMinValue)) <= + (static_cast(kSmiMaxValue) - + static_cast(kSmiMinValue)); + } +}; + +// Smi constants for systems where tagged pointer is a 64-bit value. +template <> +struct SmiTagging<8> { + enum { kSmiShiftSize = 31, kSmiValueSize = 32 }; + + static constexpr intptr_t kSmiMinValue = + static_cast(kUintptrAllBitsSet << (kSmiValueSize - 1)); + static constexpr intptr_t kSmiMaxValue = -(kSmiMinValue + 1); + + V8_INLINE static int SmiToInt(const internal::Address value) { + int shift_bits = kSmiTagSize + kSmiShiftSize; + // Shift down and throw away top 32 bits. + return static_cast(static_cast(value) >> shift_bits); + } + V8_INLINE static constexpr bool IsValidSmi(intptr_t value) { + // To be representable as a long smi, the value must be a 32-bit integer. + return (value == static_cast(value)); + } +}; + +#ifdef V8_COMPRESS_POINTERS +static_assert( + kApiSystemPointerSize == kApiInt64Size, + "Pointer compression can be enabled only for 64-bit architectures"); +const int kApiTaggedSize = kApiInt32Size; +#else +const int kApiTaggedSize = kApiSystemPointerSize; +#endif + +constexpr bool PointerCompressionIsEnabled() { + return kApiTaggedSize != kApiSystemPointerSize; +} + +constexpr bool HeapSandboxIsEnabled() { +#ifdef V8_HEAP_SANDBOX + return true; +#else + return false; +#endif +} + +using ExternalPointer_t = Address; + +// If the heap sandbox is enabled, these tag values will be ORed with the +// external pointers in the external pointer table to prevent use of pointers of +// the wrong type. When a pointer is loaded, it is ANDed with the inverse of the +// expected type's tag. The tags are constructed in a way that guarantees that a +// failed type check will result in one or more of the top bits of the pointer +// to be set, rendering the pointer inacessible. This construction allows +// performing the type check and removing GC marking bits from the pointer at +// the same time. +enum ExternalPointerTag : uint64_t { + kExternalPointerNullTag = 0x0000000000000000, + kArrayBufferBackingStoreTag = 0x00ff000000000000, // 0b000000011111111 + kTypedArrayExternalPointerTag = 0x017f000000000000, // 0b000000101111111 + kDataViewDataPointerTag = 0x01bf000000000000, // 0b000000110111111 + kExternalStringResourceTag = 0x01df000000000000, // 0b000000111011111 + kExternalStringResourceDataTag = 0x01ef000000000000, // 0b000000111101111 + kForeignForeignAddressTag = 0x01f7000000000000, // 0b000000111110111 + kNativeContextMicrotaskQueueTag = 0x01fb000000000000, // 0b000000111111011 + kEmbedderDataSlotPayloadTag = 0x01fd000000000000, // 0b000000111111101 + kCodeEntryPointTag = 0x01fe000000000000, // 0b000000111111110 +}; + +constexpr uint64_t kExternalPointerTagMask = 0xffff000000000000; + +#ifdef V8_31BIT_SMIS_ON_64BIT_ARCH +using PlatformSmiTagging = SmiTagging; +#else +using PlatformSmiTagging = SmiTagging; +#endif + +// TODO(ishell): Consinder adding kSmiShiftBits = kSmiShiftSize + kSmiTagSize +// since it's used much more often than the inividual constants. +const int kSmiShiftSize = PlatformSmiTagging::kSmiShiftSize; +const int kSmiValueSize = PlatformSmiTagging::kSmiValueSize; +const int kSmiMinValue = static_cast(PlatformSmiTagging::kSmiMinValue); +const int kSmiMaxValue = static_cast(PlatformSmiTagging::kSmiMaxValue); +constexpr bool SmiValuesAre31Bits() { return kSmiValueSize == 31; } +constexpr bool SmiValuesAre32Bits() { return kSmiValueSize == 32; } + +V8_INLINE static constexpr internal::Address IntToSmi(int value) { + return (static_cast
      (value) << (kSmiTagSize + kSmiShiftSize)) | + kSmiTag; +} + +// Converts encoded external pointer to address. +V8_EXPORT Address DecodeExternalPointerImpl(const Isolate* isolate, + ExternalPointer_t pointer, + ExternalPointerTag tag); + +// {obj} must be the raw tagged pointer representation of a HeapObject +// that's guaranteed to never be in ReadOnlySpace. +V8_EXPORT internal::Isolate* IsolateFromNeverReadOnlySpaceObject(Address obj); + +// Returns if we need to throw when an error occurs. This infers the language +// mode based on the current context and the closure. This returns true if the +// language mode is strict. +V8_EXPORT bool ShouldThrowOnError(v8::internal::Isolate* isolate); + +/** + * This class exports constants and functionality from within v8 that + * is necessary to implement inline functions in the v8 api. Don't + * depend on functions and constants defined here. + */ +class Internals { +#ifdef V8_MAP_PACKING + V8_INLINE static constexpr internal::Address UnpackMapWord( + internal::Address mapword) { + // TODO(wenyuzhao): Clear header metadata. + return mapword ^ kMapWordXorMask; + } +#endif + + public: + // These values match non-compiler-dependent values defined within + // the implementation of v8. + static const int kHeapObjectMapOffset = 0; + static const int kMapInstanceTypeOffset = 1 * kApiTaggedSize + kApiInt32Size; + static const int kStringResourceOffset = + 1 * kApiTaggedSize + 2 * kApiInt32Size; + + static const int kOddballKindOffset = 4 * kApiTaggedSize + kApiDoubleSize; + static const int kJSObjectHeaderSize = 3 * kApiTaggedSize; + static const int kFixedArrayHeaderSize = 2 * kApiTaggedSize; + static const int kEmbedderDataArrayHeaderSize = 2 * kApiTaggedSize; + static const int kEmbedderDataSlotSize = kApiSystemPointerSize; +#ifdef V8_HEAP_SANDBOX + static const int kEmbedderDataSlotRawPayloadOffset = kApiTaggedSize; +#endif + static const int kNativeContextEmbedderDataOffset = 6 * kApiTaggedSize; + static const int kFullStringRepresentationMask = 0x0f; + static const int kStringEncodingMask = 0x8; + static const int kExternalTwoByteRepresentationTag = 0x02; + static const int kExternalOneByteRepresentationTag = 0x0a; + + static const uint32_t kNumIsolateDataSlots = 4; + + // IsolateData layout guarantees. + static const int kIsolateEmbedderDataOffset = 0; + static const int kIsolateFastCCallCallerFpOffset = + kNumIsolateDataSlots * kApiSystemPointerSize; + static const int kIsolateFastCCallCallerPcOffset = + kIsolateFastCCallCallerFpOffset + kApiSystemPointerSize; + static const int kIsolateFastApiCallTargetOffset = + kIsolateFastCCallCallerPcOffset + kApiSystemPointerSize; + static const int kIsolateStackGuardOffset = + kIsolateFastApiCallTargetOffset + kApiSystemPointerSize; + static const int kIsolateRootsOffset = + kIsolateStackGuardOffset + 7 * kApiSystemPointerSize; + + static const int kExternalPointerTableBufferOffset = 0; + static const int kExternalPointerTableLengthOffset = + kExternalPointerTableBufferOffset + kApiSystemPointerSize; + static const int kExternalPointerTableCapacityOffset = + kExternalPointerTableLengthOffset + kApiInt32Size; + + static const int kUndefinedValueRootIndex = 4; + static const int kTheHoleValueRootIndex = 5; + static const int kNullValueRootIndex = 6; + static const int kTrueValueRootIndex = 7; + static const int kFalseValueRootIndex = 8; + static const int kEmptyStringRootIndex = 9; + + static const int kNodeClassIdOffset = 1 * kApiSystemPointerSize; + static const int kNodeFlagsOffset = 1 * kApiSystemPointerSize + 3; + static const int kNodeStateMask = 0x7; + static const int kNodeStateIsWeakValue = 2; + static const int kNodeStateIsPendingValue = 3; + + static const int kFirstNonstringType = 0x40; + static const int kOddballType = 0x43; + static const int kForeignType = 0x46; + static const int kJSSpecialApiObjectType = 0x410; + static const int kJSApiObjectType = 0x420; + static const int kJSObjectType = 0x421; + + static const int kUndefinedOddballKind = 5; + static const int kNullOddballKind = 3; + + // Constants used by PropertyCallbackInfo to check if we should throw when an + // error occurs. + static const int kThrowOnError = 0; + static const int kDontThrow = 1; + static const int kInferShouldThrowMode = 2; + + // Soft limit for AdjustAmountofExternalAllocatedMemory. Trigger an + // incremental GC once the external memory reaches this limit. + static constexpr int kExternalAllocationSoftLimit = 64 * 1024 * 1024; + +#ifdef V8_MAP_PACKING + static const uintptr_t kMapWordMetadataMask = 0xffffULL << 48; + // The lowest two bits of mapwords are always `0b10` + static const uintptr_t kMapWordSignature = 0b10; + // XORing a (non-compressed) map with this mask ensures that the two + // low-order bits are 0b10. The 0 at the end makes this look like a Smi, + // although real Smis have all lower 32 bits unset. We only rely on these + // values passing as Smis in very few places. + static const int kMapWordXorMask = 0b11; +#endif + + V8_EXPORT static void CheckInitializedImpl(v8::Isolate* isolate); + V8_INLINE static void CheckInitialized(v8::Isolate* isolate) { +#ifdef V8_ENABLE_CHECKS + CheckInitializedImpl(isolate); +#endif + } + + V8_INLINE static bool HasHeapObjectTag(const internal::Address value) { + return (value & kHeapObjectTagMask) == static_cast
      (kHeapObjectTag); + } + + V8_INLINE static int SmiValue(const internal::Address value) { + return PlatformSmiTagging::SmiToInt(value); + } + + V8_INLINE static constexpr internal::Address IntToSmi(int value) { + return internal::IntToSmi(value); + } + + V8_INLINE static constexpr bool IsValidSmi(intptr_t value) { + return PlatformSmiTagging::IsValidSmi(value); + } + + V8_INLINE static int GetInstanceType(const internal::Address obj) { + typedef internal::Address A; + A map = ReadTaggedPointerField(obj, kHeapObjectMapOffset); +#ifdef V8_MAP_PACKING + map = UnpackMapWord(map); +#endif + return ReadRawField(map, kMapInstanceTypeOffset); + } + + V8_INLINE static int GetOddballKind(const internal::Address obj) { + return SmiValue(ReadTaggedSignedField(obj, kOddballKindOffset)); + } + + V8_INLINE static bool IsExternalTwoByteString(int instance_type) { + int representation = (instance_type & kFullStringRepresentationMask); + return representation == kExternalTwoByteRepresentationTag; + } + + V8_INLINE static uint8_t GetNodeFlag(internal::Address* obj, int shift) { + uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; + return *addr & static_cast(1U << shift); + } + + V8_INLINE static void UpdateNodeFlag(internal::Address* obj, bool value, + int shift) { + uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; + uint8_t mask = static_cast(1U << shift); + *addr = static_cast((*addr & ~mask) | (value << shift)); + } + + V8_INLINE static uint8_t GetNodeState(internal::Address* obj) { + uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; + return *addr & kNodeStateMask; + } + + V8_INLINE static void UpdateNodeState(internal::Address* obj, uint8_t value) { + uint8_t* addr = reinterpret_cast(obj) + kNodeFlagsOffset; + *addr = static_cast((*addr & ~kNodeStateMask) | value); + } + + V8_INLINE static void SetEmbedderData(v8::Isolate* isolate, uint32_t slot, + void* data) { + internal::Address addr = reinterpret_cast(isolate) + + kIsolateEmbedderDataOffset + + slot * kApiSystemPointerSize; + *reinterpret_cast(addr) = data; + } + + V8_INLINE static void* GetEmbedderData(const v8::Isolate* isolate, + uint32_t slot) { + internal::Address addr = reinterpret_cast(isolate) + + kIsolateEmbedderDataOffset + + slot * kApiSystemPointerSize; + return *reinterpret_cast(addr); + } + + V8_INLINE static internal::Address* GetRoot(v8::Isolate* isolate, int index) { + internal::Address addr = reinterpret_cast(isolate) + + kIsolateRootsOffset + + index * kApiSystemPointerSize; + return reinterpret_cast(addr); + } + + template + V8_INLINE static T ReadRawField(internal::Address heap_object_ptr, + int offset) { + internal::Address addr = heap_object_ptr + offset - kHeapObjectTag; +#ifdef V8_COMPRESS_POINTERS + if (sizeof(T) > kApiTaggedSize) { + // TODO(ishell, v8:8875): When pointer compression is enabled 8-byte size + // fields (external pointers, doubles and BigInt data) are only + // kTaggedSize aligned so we have to use unaligned pointer friendly way of + // accessing them in order to avoid undefined behavior in C++ code. + T r; + memcpy(&r, reinterpret_cast(addr), sizeof(T)); + return r; + } +#endif + return *reinterpret_cast(addr); + } + + V8_INLINE static internal::Address ReadTaggedPointerField( + internal::Address heap_object_ptr, int offset) { +#ifdef V8_COMPRESS_POINTERS + uint32_t value = ReadRawField(heap_object_ptr, offset); + internal::Address base = + GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr); + return base + static_cast(static_cast(value)); +#else + return ReadRawField(heap_object_ptr, offset); +#endif + } + + V8_INLINE static internal::Address ReadTaggedSignedField( + internal::Address heap_object_ptr, int offset) { +#ifdef V8_COMPRESS_POINTERS + uint32_t value = ReadRawField(heap_object_ptr, offset); + return static_cast(static_cast(value)); +#else + return ReadRawField(heap_object_ptr, offset); +#endif + } + + V8_INLINE static internal::Isolate* GetIsolateForHeapSandbox( + internal::Address obj) { +#ifdef V8_HEAP_SANDBOX + return internal::IsolateFromNeverReadOnlySpaceObject(obj); +#else + // Not used in non-sandbox mode. + return nullptr; +#endif + } + + V8_INLINE static Address DecodeExternalPointer( + const Isolate* isolate, ExternalPointer_t encoded_pointer, + ExternalPointerTag tag) { +#ifdef V8_HEAP_SANDBOX + return internal::DecodeExternalPointerImpl(isolate, encoded_pointer, tag); +#else + return encoded_pointer; +#endif + } + + V8_INLINE static internal::Address ReadExternalPointerField( + internal::Isolate* isolate, internal::Address heap_object_ptr, int offset, + ExternalPointerTag tag) { +#ifdef V8_HEAP_SANDBOX + internal::ExternalPointer_t encoded_value = + ReadRawField(heap_object_ptr, offset); + // We currently have to treat zero as nullptr in embedder slots. + return encoded_value ? DecodeExternalPointer(isolate, encoded_value, tag) + : 0; +#else + return ReadRawField
      (heap_object_ptr, offset); +#endif + } + +#ifdef V8_COMPRESS_POINTERS + // See v8:7703 or src/ptr-compr.* for details about pointer compression. + static constexpr size_t kPtrComprCageReservationSize = size_t{1} << 32; + static constexpr size_t kPtrComprCageBaseAlignment = size_t{1} << 32; + + V8_INLINE static internal::Address GetPtrComprCageBaseFromOnHeapAddress( + internal::Address addr) { + return addr & -static_cast(kPtrComprCageBaseAlignment); + } + + V8_INLINE static internal::Address DecompressTaggedAnyField( + internal::Address heap_object_ptr, uint32_t value) { + internal::Address base = + GetPtrComprCageBaseFromOnHeapAddress(heap_object_ptr); + return base + static_cast(static_cast(value)); + } + +#endif // V8_COMPRESS_POINTERS +}; + +// Only perform cast check for types derived from v8::Data since +// other types do not implement the Cast method. +template +struct CastCheck { + template + static void Perform(T* data); +}; + +template <> +template +void CastCheck::Perform(T* data) { + T::Cast(data); +} + +template <> +template +void CastCheck::Perform(T* data) {} + +template +V8_INLINE void PerformCastCheck(T* data) { + CastCheck::value && + !std::is_same>::value>::Perform(data); +} + +// A base class for backing stores, which is needed due to vagaries of +// how static casts work with std::shared_ptr. +class BackingStoreBase {}; + +} // namespace internal + +V8_EXPORT bool CopyAndConvertArrayToCppBufferInt32(Local src, + int32_t* dst, + uint32_t max_length); + +V8_EXPORT bool CopyAndConvertArrayToCppBufferFloat64(Local src, + double* dst, + uint32_t max_length); + +} // namespace v8 + +#endif // INCLUDE_V8_INTERNAL_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-metrics.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-metrics.h new file mode 100644 index 00000000000..498ee25f6d2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-metrics.h @@ -0,0 +1,202 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_METRICS_H_ +#define V8_METRICS_H_ + +#include "v8.h" // NOLINT(build/include_directory) + +namespace v8 { +namespace metrics { + +struct GarbageCollectionPhases { + int64_t compact_wall_clock_duration_in_us = -1; + int64_t mark_wall_clock_duration_in_us = -1; + int64_t sweep_wall_clock_duration_in_us = -1; + int64_t weak_wall_clock_duration_in_us = -1; +}; + +struct GarbageCollectionSizes { + int64_t bytes_before = -1; + int64_t bytes_after = -1; + int64_t bytes_freed = -1; +}; + +struct GarbageCollectionFullCycle { + GarbageCollectionPhases total; + GarbageCollectionPhases total_cpp; + GarbageCollectionPhases main_thread; + GarbageCollectionPhases main_thread_cpp; + GarbageCollectionPhases main_thread_atomic; + GarbageCollectionPhases main_thread_atomic_cpp; + GarbageCollectionPhases main_thread_incremental; + GarbageCollectionPhases main_thread_incremental_cpp; + GarbageCollectionSizes objects; + GarbageCollectionSizes objects_cpp; + GarbageCollectionSizes memory; + GarbageCollectionSizes memory_cpp; + double collection_rate_in_percent; + double collection_rate_cpp_in_percent; + double efficiency_in_bytes_per_us; + double efficiency_cpp_in_bytes_per_us; + double main_thread_efficiency_in_bytes_per_us; + double main_thread_efficiency_cpp_in_bytes_per_us; +}; + +struct GarbageCollectionFullMainThreadIncrementalMark { + int64_t wall_clock_duration_in_us = -1; + int64_t cpp_wall_clock_duration_in_us = -1; +}; + +struct GarbageCollectionFullMainThreadBatchedIncrementalMark { + std::vector events; +}; + +struct GarbageCollectionFullMainThreadIncrementalSweep { + int64_t wall_clock_duration_in_us = -1; + int64_t cpp_wall_clock_duration_in_us = -1; +}; + +struct GarbageCollectionFullMainThreadBatchedIncrementalSweep { + std::vector events; +}; + +struct GarbageCollectionYoungCycle { + int64_t total_wall_clock_duration_in_us = -1; + int64_t main_thread_wall_clock_duration_in_us = -1; + double collection_rate_in_percent; + double efficiency_in_bytes_per_us; + double main_thread_efficiency_in_bytes_per_us; +}; + +struct WasmModuleDecoded { + bool async = false; + bool streamed = false; + bool success = false; + size_t module_size_in_bytes = 0; + size_t function_count = 0; + int64_t wall_clock_duration_in_us = -1; + int64_t cpu_duration_in_us = -1; +}; + +struct WasmModuleCompiled { + bool async = false; + bool streamed = false; + bool cached = false; + bool deserialized = false; + bool lazy = false; + bool success = false; + size_t code_size_in_bytes = 0; + size_t liftoff_bailout_count = 0; + int64_t wall_clock_duration_in_us = -1; + int64_t cpu_duration_in_us = -1; +}; + +struct WasmModuleInstantiated { + bool async = false; + bool success = false; + size_t imported_function_count = 0; + int64_t wall_clock_duration_in_us = -1; +}; + +struct WasmModuleTieredUp { + bool lazy = false; + size_t code_size_in_bytes = 0; + int64_t wall_clock_duration_in_us = -1; + int64_t cpu_duration_in_us = -1; +}; + +struct WasmModulesPerIsolate { + size_t count = 0; +}; + +#define V8_MAIN_THREAD_METRICS_EVENTS(V) \ + V(GarbageCollectionFullCycle) \ + V(GarbageCollectionFullMainThreadIncrementalMark) \ + V(GarbageCollectionFullMainThreadBatchedIncrementalMark) \ + V(GarbageCollectionFullMainThreadIncrementalSweep) \ + V(GarbageCollectionFullMainThreadBatchedIncrementalSweep) \ + V(GarbageCollectionYoungCycle) \ + V(WasmModuleDecoded) \ + V(WasmModuleCompiled) \ + V(WasmModuleInstantiated) \ + V(WasmModuleTieredUp) + +#define V8_THREAD_SAFE_METRICS_EVENTS(V) V(WasmModulesPerIsolate) + +/** + * This class serves as a base class for recording event-based metrics in V8. + * There a two kinds of metrics, those which are expected to be thread-safe and + * whose implementation is required to fulfill this requirement and those whose + * implementation does not have that requirement and only needs to be + * executable on the main thread. If such an event is triggered from a + * background thread, it will be delayed and executed by the foreground task + * runner. + * + * The thread-safe events are listed in the V8_THREAD_SAFE_METRICS_EVENTS + * macro above while the main thread event are listed in + * V8_MAIN_THREAD_METRICS_EVENTS above. For the former, a virtual method + * AddMainThreadEvent(const E& event, v8::Context::Token token) will be + * generated and for the latter AddThreadSafeEvent(const E& event). + * + * Thread-safe events are not allowed to access the context and therefore do + * not carry a context ID with them. These IDs can be generated using + * Recorder::GetContextId() and the ID will be valid throughout the lifetime + * of the isolate. It is not guaranteed that the ID will still resolve to + * a valid context using Recorder::GetContext() at the time the metric is + * recorded. In this case, an empty handle will be returned. + * + * The embedder is expected to call v8::Isolate::SetMetricsRecorder() + * providing its implementation and have the virtual methods overwritten + * for the events it cares about. + */ +class V8_EXPORT Recorder { + public: + // A unique identifier for a context in this Isolate. + // It is guaranteed to not be reused throughout the lifetime of the Isolate. + class ContextId { + public: + ContextId() : id_(kEmptyId) {} + + bool IsEmpty() const { return id_ == kEmptyId; } + static const ContextId Empty() { return ContextId{kEmptyId}; } + + bool operator==(const ContextId& other) const { return id_ == other.id_; } + bool operator!=(const ContextId& other) const { return id_ != other.id_; } + + private: + friend class ::v8::Context; + friend class ::v8::internal::Isolate; + + explicit ContextId(uintptr_t id) : id_(id) {} + + static constexpr uintptr_t kEmptyId = 0; + uintptr_t id_; + }; + + virtual ~Recorder() = default; + +#define ADD_MAIN_THREAD_EVENT(E) \ + virtual void AddMainThreadEvent(const E& event, ContextId context_id) {} + V8_MAIN_THREAD_METRICS_EVENTS(ADD_MAIN_THREAD_EVENT) +#undef ADD_MAIN_THREAD_EVENT + +#define ADD_THREAD_SAFE_EVENT(E) \ + virtual void AddThreadSafeEvent(const E& event) {} + V8_THREAD_SAFE_METRICS_EVENTS(ADD_THREAD_SAFE_EVENT) +#undef ADD_THREAD_SAFE_EVENT + + virtual void NotifyIsolateDisposal() {} + + // Return the context with the given id or an empty handle if the context + // was already garbage collected. + static MaybeLocal GetContext(Isolate* isolate, ContextId id); + // Return the unique id corresponding to the given context. + static ContextId GetContextId(Local context); +}; + +} // namespace metrics +} // namespace v8 + +#endif // V8_METRICS_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-platform.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-platform.h new file mode 100644 index 00000000000..4c94d7fd392 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-platform.h @@ -0,0 +1,709 @@ +// Copyright 2013 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_V8_PLATFORM_H_ +#define V8_V8_PLATFORM_H_ + +#include +#include +#include // For abort. +#include +#include + +#include "v8config.h" // NOLINT(build/include_directory) + +namespace v8 { + +class Isolate; + +// Valid priorities supported by the task scheduling infrastructure. +enum class TaskPriority : uint8_t { + /** + * Best effort tasks are not critical for performance of the application. The + * platform implementation should preempt such tasks if higher priority tasks + * arrive. + */ + kBestEffort, + /** + * User visible tasks are long running background tasks that will + * improve performance and memory usage of the application upon completion. + * Example: background compilation and garbage collection. + */ + kUserVisible, + /** + * User blocking tasks are highest priority tasks that block the execution + * thread (e.g. major garbage collection). They must be finished as soon as + * possible. + */ + kUserBlocking, +}; + +/** + * A Task represents a unit of work. + */ +class Task { + public: + virtual ~Task() = default; + + virtual void Run() = 0; +}; + +/** + * An IdleTask represents a unit of work to be performed in idle time. + * The Run method is invoked with an argument that specifies the deadline in + * seconds returned by MonotonicallyIncreasingTime(). + * The idle task is expected to complete by this deadline. + */ +class IdleTask { + public: + virtual ~IdleTask() = default; + virtual void Run(double deadline_in_seconds) = 0; +}; + +/** + * A TaskRunner allows scheduling of tasks. The TaskRunner may still be used to + * post tasks after the isolate gets destructed, but these tasks may not get + * executed anymore. All tasks posted to a given TaskRunner will be invoked in + * sequence. Tasks can be posted from any thread. + */ +class TaskRunner { + public: + /** + * Schedules a task to be invoked by this TaskRunner. The TaskRunner + * implementation takes ownership of |task|. + */ + virtual void PostTask(std::unique_ptr task) = 0; + + /** + * Schedules a task to be invoked by this TaskRunner. The TaskRunner + * implementation takes ownership of |task|. The |task| cannot be nested + * within other task executions. + * + * Tasks which shouldn't be interleaved with JS execution must be posted with + * |PostNonNestableTask| or |PostNonNestableDelayedTask|. This is because the + * embedder may process tasks in a callback which is called during JS + * execution. + * + * In particular, tasks which execute JS must be non-nestable, since JS + * execution is not allowed to nest. + * + * Requires that |TaskRunner::NonNestableTasksEnabled()| is true. + */ + virtual void PostNonNestableTask(std::unique_ptr task) {} + + /** + * Schedules a task to be invoked by this TaskRunner. The task is scheduled + * after the given number of seconds |delay_in_seconds|. The TaskRunner + * implementation takes ownership of |task|. + */ + virtual void PostDelayedTask(std::unique_ptr task, + double delay_in_seconds) = 0; + + /** + * Schedules a task to be invoked by this TaskRunner. The task is scheduled + * after the given number of seconds |delay_in_seconds|. The TaskRunner + * implementation takes ownership of |task|. The |task| cannot be nested + * within other task executions. + * + * Tasks which shouldn't be interleaved with JS execution must be posted with + * |PostNonNestableTask| or |PostNonNestableDelayedTask|. This is because the + * embedder may process tasks in a callback which is called during JS + * execution. + * + * In particular, tasks which execute JS must be non-nestable, since JS + * execution is not allowed to nest. + * + * Requires that |TaskRunner::NonNestableDelayedTasksEnabled()| is true. + */ + virtual void PostNonNestableDelayedTask(std::unique_ptr task, + double delay_in_seconds) {} + + /** + * Schedules an idle task to be invoked by this TaskRunner. The task is + * scheduled when the embedder is idle. Requires that + * |TaskRunner::IdleTasksEnabled()| is true. Idle tasks may be reordered + * relative to other task types and may be starved for an arbitrarily long + * time if no idle time is available. The TaskRunner implementation takes + * ownership of |task|. + */ + virtual void PostIdleTask(std::unique_ptr task) = 0; + + /** + * Returns true if idle tasks are enabled for this TaskRunner. + */ + virtual bool IdleTasksEnabled() = 0; + + /** + * Returns true if non-nestable tasks are enabled for this TaskRunner. + */ + virtual bool NonNestableTasksEnabled() const { return false; } + + /** + * Returns true if non-nestable delayed tasks are enabled for this TaskRunner. + */ + virtual bool NonNestableDelayedTasksEnabled() const { return false; } + + TaskRunner() = default; + virtual ~TaskRunner() = default; + + TaskRunner(const TaskRunner&) = delete; + TaskRunner& operator=(const TaskRunner&) = delete; +}; + +/** + * Delegate that's passed to Job's worker task, providing an entry point to + * communicate with the scheduler. + */ +class JobDelegate { + public: + /** + * Returns true if this thread should return from the worker task on the + * current thread ASAP. Workers should periodically invoke ShouldYield (or + * YieldIfNeeded()) as often as is reasonable. + */ + virtual bool ShouldYield() = 0; + + /** + * Notifies the scheduler that max concurrency was increased, and the number + * of worker should be adjusted accordingly. See Platform::PostJob() for more + * details. + */ + virtual void NotifyConcurrencyIncrease() = 0; + + /** + * Returns a task_id unique among threads currently running this job, such + * that GetTaskId() < worker count. To achieve this, the same task_id may be + * reused by a different thread after a worker_task returns. + */ + virtual uint8_t GetTaskId() = 0; + + /** + * Returns true if the current task is called from the thread currently + * running JobHandle::Join(). + * TODO(etiennep): Make pure virtual once custom embedders implement it. + */ + virtual bool IsJoiningThread() const { return false; } +}; + +/** + * Handle returned when posting a Job. Provides methods to control execution of + * the posted Job. + */ +class JobHandle { + public: + virtual ~JobHandle() = default; + + /** + * Notifies the scheduler that max concurrency was increased, and the number + * of worker should be adjusted accordingly. See Platform::PostJob() for more + * details. + */ + virtual void NotifyConcurrencyIncrease() = 0; + + /** + * Contributes to the job on this thread. Doesn't return until all tasks have + * completed and max concurrency becomes 0. When Join() is called and max + * concurrency reaches 0, it should not increase again. This also promotes + * this Job's priority to be at least as high as the calling thread's + * priority. + */ + virtual void Join() = 0; + + /** + * Forces all existing workers to yield ASAP. Waits until they have all + * returned from the Job's callback before returning. + */ + virtual void Cancel() = 0; + + /* + * Forces all existing workers to yield ASAP but doesn’t wait for them. + * Warning, this is dangerous if the Job's callback is bound to or has access + * to state which may be deleted after this call. + * TODO(etiennep): Cleanup once implemented by all embedders. + */ + virtual void CancelAndDetach() { Cancel(); } + + /** + * Returns true if there's any work pending or any worker running. + */ + virtual bool IsActive() = 0; + + // TODO(etiennep): Clean up once all overrides are removed. + V8_DEPRECATED("Use !IsActive() instead.") + virtual bool IsCompleted() { return !IsActive(); } + + /** + * Returns true if associated with a Job and other methods may be called. + * Returns false after Join() or Cancel() was called. This may return true + * even if no workers are running and IsCompleted() returns true + */ + virtual bool IsValid() = 0; + + // TODO(etiennep): Clean up once all overrides are removed. + V8_DEPRECATED("Use IsValid() instead.") + virtual bool IsRunning() { return IsValid(); } + + /** + * Returns true if job priority can be changed. + */ + virtual bool UpdatePriorityEnabled() const { return false; } + + /** + * Update this Job's priority. + */ + virtual void UpdatePriority(TaskPriority new_priority) {} +}; + +/** + * A JobTask represents work to run in parallel from Platform::PostJob(). + */ +class JobTask { + public: + virtual ~JobTask() = default; + + virtual void Run(JobDelegate* delegate) = 0; + + /** + * Controls the maximum number of threads calling Run() concurrently, given + * the number of threads currently assigned to this job and executing Run(). + * Run() is only invoked if the number of threads previously running Run() was + * less than the value returned. Since GetMaxConcurrency() is a leaf function, + * it must not call back any JobHandle methods. + */ + virtual size_t GetMaxConcurrency(size_t worker_count) const = 0; + + // TODO(1114823): Clean up once all overrides are removed. + V8_DEPRECATED("Use the version that takes |worker_count|.") + virtual size_t GetMaxConcurrency() const { return 0; } +}; + +/** + * The interface represents complex arguments to trace events. + */ +class ConvertableToTraceFormat { + public: + virtual ~ConvertableToTraceFormat() = default; + + /** + * Append the class info to the provided |out| string. The appended + * data must be a valid JSON object. Strings must be properly quoted, and + * escaped. There is no processing applied to the content after it is + * appended. + */ + virtual void AppendAsTraceFormat(std::string* out) const = 0; +}; + +/** + * V8 Tracing controller. + * + * Can be implemented by an embedder to record trace events from V8. + */ +class TracingController { + public: + virtual ~TracingController() = default; + + // In Perfetto mode, trace events are written using Perfetto's Track Event + // API directly without going through the embedder. However, it is still + // possible to observe tracing being enabled and disabled. +#if !defined(V8_USE_PERFETTO) + /** + * Called by TRACE_EVENT* macros, don't call this directly. + * The name parameter is a category group for example: + * TRACE_EVENT0("v8,parse", "V8.Parse") + * The pointer returned points to a value with zero or more of the bits + * defined in CategoryGroupEnabledFlags. + **/ + virtual const uint8_t* GetCategoryGroupEnabled(const char* name) { + static uint8_t no = 0; + return &no; + } + + /** + * Adds a trace event to the platform tracing system. These function calls are + * usually the result of a TRACE_* macro from trace_event_common.h when + * tracing and the category of the particular trace are enabled. It is not + * advisable to call these functions on their own; they are really only meant + * to be used by the trace macros. The returned handle can be used by + * UpdateTraceEventDuration to update the duration of COMPLETE events. + */ + virtual uint64_t AddTraceEvent( + char phase, const uint8_t* category_enabled_flag, const char* name, + const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args, + const char** arg_names, const uint8_t* arg_types, + const uint64_t* arg_values, + std::unique_ptr* arg_convertables, + unsigned int flags) { + return 0; + } + virtual uint64_t AddTraceEventWithTimestamp( + char phase, const uint8_t* category_enabled_flag, const char* name, + const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args, + const char** arg_names, const uint8_t* arg_types, + const uint64_t* arg_values, + std::unique_ptr* arg_convertables, + unsigned int flags, int64_t timestamp) { + return 0; + } + + /** + * Sets the duration field of a COMPLETE trace event. It must be called with + * the handle returned from AddTraceEvent(). + **/ + virtual void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, + const char* name, uint64_t handle) {} +#endif // !defined(V8_USE_PERFETTO) + + class TraceStateObserver { + public: + virtual ~TraceStateObserver() = default; + virtual void OnTraceEnabled() = 0; + virtual void OnTraceDisabled() = 0; + }; + + /** Adds tracing state change observer. */ + virtual void AddTraceStateObserver(TraceStateObserver*) {} + + /** Removes tracing state change observer. */ + virtual void RemoveTraceStateObserver(TraceStateObserver*) {} +}; + +/** + * A V8 memory page allocator. + * + * Can be implemented by an embedder to manage large host OS allocations. + */ +class PageAllocator { + public: + virtual ~PageAllocator() = default; + + /** + * Gets the page granularity for AllocatePages and FreePages. Addresses and + * lengths for those calls should be multiples of AllocatePageSize(). + */ + virtual size_t AllocatePageSize() = 0; + + /** + * Gets the page granularity for SetPermissions and ReleasePages. Addresses + * and lengths for those calls should be multiples of CommitPageSize(). + */ + virtual size_t CommitPageSize() = 0; + + /** + * Sets the random seed so that GetRandomMmapAddr() will generate repeatable + * sequences of random mmap addresses. + */ + virtual void SetRandomMmapSeed(int64_t seed) = 0; + + /** + * Returns a randomized address, suitable for memory allocation under ASLR. + * The address will be aligned to AllocatePageSize. + */ + virtual void* GetRandomMmapAddr() = 0; + + /** + * Memory permissions. + */ + enum Permission { + kNoAccess, + kRead, + kReadWrite, + kReadWriteExecute, + kReadExecute, + // Set this when reserving memory that will later require kReadWriteExecute + // permissions. The resulting behavior is platform-specific, currently + // this is used to set the MAP_JIT flag on Apple Silicon. + // TODO(jkummerow): Remove this when Wasm has a platform-independent + // w^x implementation. + kNoAccessWillJitLater + }; + + /** + * Allocates memory in range with the given alignment and permission. + */ + virtual void* AllocatePages(void* address, size_t length, size_t alignment, + Permission permissions) = 0; + + /** + * Frees memory in a range that was allocated by a call to AllocatePages. + */ + virtual bool FreePages(void* address, size_t length) = 0; + + /** + * Releases memory in a range that was allocated by a call to AllocatePages. + */ + virtual bool ReleasePages(void* address, size_t length, + size_t new_length) = 0; + + /** + * Sets permissions on pages in an allocated range. + */ + virtual bool SetPermissions(void* address, size_t length, + Permission permissions) = 0; + + /** + * Frees memory in the given [address, address + size) range. address and size + * should be operating system page-aligned. The next write to this + * memory area brings the memory transparently back. + */ + virtual bool DiscardSystemPages(void* address, size_t size) { return true; } + + /** + * INTERNAL ONLY: This interface has not been stabilised and may change + * without notice from one release to another without being deprecated first. + */ + class SharedMemoryMapping { + public: + // Implementations are expected to free the shared memory mapping in the + // destructor. + virtual ~SharedMemoryMapping() = default; + virtual void* GetMemory() const = 0; + }; + + /** + * INTERNAL ONLY: This interface has not been stabilised and may change + * without notice from one release to another without being deprecated first. + */ + class SharedMemory { + public: + // Implementations are expected to free the shared memory in the destructor. + virtual ~SharedMemory() = default; + virtual std::unique_ptr RemapTo( + void* new_address) const = 0; + virtual void* GetMemory() const = 0; + virtual size_t GetSize() const = 0; + }; + + /** + * INTERNAL ONLY: This interface has not been stabilised and may change + * without notice from one release to another without being deprecated first. + * + * Reserve pages at a fixed address returning whether the reservation is + * possible. The reserved memory is detached from the PageAllocator and so + * should not be freed by it. It's intended for use with + * SharedMemory::RemapTo, where ~SharedMemoryMapping would free the memory. + */ + virtual bool ReserveForSharedMemoryMapping(void* address, size_t size) { + return false; + } + + /** + * INTERNAL ONLY: This interface has not been stabilised and may change + * without notice from one release to another without being deprecated first. + * + * Allocates shared memory pages. Not all PageAllocators need support this and + * so this method need not be overridden. + * Allocates a new read-only shared memory region of size |length| and copies + * the memory at |original_address| into it. + */ + virtual std::unique_ptr AllocateSharedPages( + size_t length, const void* original_address) { + return {}; + } + + /** + * INTERNAL ONLY: This interface has not been stabilised and may change + * without notice from one release to another without being deprecated first. + * + * If not overridden and changed to return true, V8 will not attempt to call + * AllocateSharedPages or RemapSharedPages. If overridden, AllocateSharedPages + * and RemapSharedPages must also be overridden. + */ + virtual bool CanAllocateSharedPages() { return false; } +}; + +/** + * V8 Platform abstraction layer. + * + * The embedder has to provide an implementation of this interface before + * initializing the rest of V8. + */ +class Platform { + public: + virtual ~Platform() = default; + + /** + * Allows the embedder to manage memory page allocations. + */ + virtual PageAllocator* GetPageAllocator() { + // TODO(bbudge) Make this abstract after all embedders implement this. + return nullptr; + } + + /** + * Enables the embedder to respond in cases where V8 can't allocate large + * blocks of memory. V8 retries the failed allocation once after calling this + * method. On success, execution continues; otherwise V8 exits with a fatal + * error. + * Embedder overrides of this function must NOT call back into V8. + */ + virtual void OnCriticalMemoryPressure() { + // TODO(bbudge) Remove this when embedders override the following method. + // See crbug.com/634547. + } + + /** + * Enables the embedder to respond in cases where V8 can't allocate large + * memory regions. The |length| parameter is the amount of memory needed. + * Returns true if memory is now available. Returns false if no memory could + * be made available. V8 will retry allocations until this method returns + * false. + * + * Embedder overrides of this function must NOT call back into V8. + */ + virtual bool OnCriticalMemoryPressure(size_t length) { return false; } + + /** + * Gets the number of worker threads used by + * Call(BlockingTask)OnWorkerThread(). This can be used to estimate the number + * of tasks a work package should be split into. A return value of 0 means + * that there are no worker threads available. Note that a value of 0 won't + * prohibit V8 from posting tasks using |CallOnWorkerThread|. + */ + virtual int NumberOfWorkerThreads() = 0; + + /** + * Returns a TaskRunner which can be used to post a task on the foreground. + * The TaskRunner's NonNestableTasksEnabled() must be true. This function + * should only be called from a foreground thread. + */ + virtual std::shared_ptr GetForegroundTaskRunner( + Isolate* isolate) = 0; + + /** + * Schedules a task to be invoked on a worker thread. + */ + virtual void CallOnWorkerThread(std::unique_ptr task) = 0; + + /** + * Schedules a task that blocks the main thread to be invoked with + * high-priority on a worker thread. + */ + virtual void CallBlockingTaskOnWorkerThread(std::unique_ptr task) { + // Embedders may optionally override this to process these tasks in a high + // priority pool. + CallOnWorkerThread(std::move(task)); + } + + /** + * Schedules a task to be invoked with low-priority on a worker thread. + */ + virtual void CallLowPriorityTaskOnWorkerThread(std::unique_ptr task) { + // Embedders may optionally override this to process these tasks in a low + // priority pool. + CallOnWorkerThread(std::move(task)); + } + + /** + * Schedules a task to be invoked on a worker thread after |delay_in_seconds| + * expires. + */ + virtual void CallDelayedOnWorkerThread(std::unique_ptr task, + double delay_in_seconds) = 0; + + /** + * Returns true if idle tasks are enabled for the given |isolate|. + */ + virtual bool IdleTasksEnabled(Isolate* isolate) { return false; } + + /** + * Posts |job_task| to run in parallel. Returns a JobHandle associated with + * the Job, which can be joined or canceled. + * This avoids degenerate cases: + * - Calling CallOnWorkerThread() for each work item, causing significant + * overhead. + * - Fixed number of CallOnWorkerThread() calls that split the work and might + * run for a long time. This is problematic when many components post + * "num cores" tasks and all expect to use all the cores. In these cases, + * the scheduler lacks context to be fair to multiple same-priority requests + * and/or ability to request lower priority work to yield when high priority + * work comes in. + * A canonical implementation of |job_task| looks like: + * class MyJobTask : public JobTask { + * public: + * MyJobTask(...) : worker_queue_(...) {} + * // JobTask: + * void Run(JobDelegate* delegate) override { + * while (!delegate->ShouldYield()) { + * // Smallest unit of work. + * auto work_item = worker_queue_.TakeWorkItem(); // Thread safe. + * if (!work_item) return; + * ProcessWork(work_item); + * } + * } + * + * size_t GetMaxConcurrency() const override { + * return worker_queue_.GetSize(); // Thread safe. + * } + * }; + * auto handle = PostJob(TaskPriority::kUserVisible, + * std::make_unique(...)); + * handle->Join(); + * + * PostJob() and methods of the returned JobHandle/JobDelegate, must never be + * called while holding a lock that could be acquired by JobTask::Run or + * JobTask::GetMaxConcurrency -- that could result in a deadlock. This is + * because [1] JobTask::GetMaxConcurrency may be invoked while holding + * internal lock (A), hence JobTask::GetMaxConcurrency can only use a lock (B) + * if that lock is *never* held while calling back into JobHandle from any + * thread (A=>B/B=>A deadlock) and [2] JobTask::Run or + * JobTask::GetMaxConcurrency may be invoked synchronously from JobHandle + * (B=>JobHandle::foo=>B deadlock). + * + * A sufficient PostJob() implementation that uses the default Job provided in + * libplatform looks like: + * std::unique_ptr PostJob( + * TaskPriority priority, std::unique_ptr job_task) override { + * return v8::platform::NewDefaultJobHandle( + * this, priority, std::move(job_task), NumberOfWorkerThreads()); + * } + */ + virtual std::unique_ptr PostJob( + TaskPriority priority, std::unique_ptr job_task) = 0; + + /** + * Monotonically increasing time in seconds from an arbitrary fixed point in + * the past. This function is expected to return at least + * millisecond-precision values. For this reason, + * it is recommended that the fixed point be no further in the past than + * the epoch. + **/ + virtual double MonotonicallyIncreasingTime() = 0; + + /** + * Current wall-clock time in milliseconds since epoch. + * This function is expected to return at least millisecond-precision values. + */ + virtual double CurrentClockTimeMillis() = 0; + + typedef void (*StackTracePrinter)(); + + /** + * Returns a function pointer that print a stack trace of the current stack + * on invocation. Disables printing of the stack trace if nullptr. + */ + virtual StackTracePrinter GetStackTracePrinter() { return nullptr; } + + /** + * Returns an instance of a v8::TracingController. This must be non-nullptr. + */ + virtual TracingController* GetTracingController() = 0; + + /** + * Tells the embedder to generate and upload a crashdump during an unexpected + * but non-critical scenario. + */ + virtual void DumpWithoutCrashing() {} + + protected: + /** + * Default implementation of current wall-clock time in milliseconds + * since epoch. Useful for implementing |CurrentClockTimeMillis| if + * nothing special needed. + */ + V8_EXPORT static double SystemClockTimeMillis(); +}; + +} // namespace v8 + +#endif // V8_V8_PLATFORM_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-profiler.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-profiler.h new file mode 100644 index 00000000000..49ada0a7bf6 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-profiler.h @@ -0,0 +1,1123 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_V8_PROFILER_H_ +#define V8_V8_PROFILER_H_ + +#include + +#include +#include +#include + +#include "v8.h" // NOLINT(build/include_directory) + +/** + * Profiler support for the V8 JavaScript engine. + */ +namespace v8 { + +class HeapGraphNode; +struct HeapStatsUpdate; + +using NativeObject = void*; +using SnapshotObjectId = uint32_t; + +struct CpuProfileDeoptFrame { + int script_id; + size_t position; +}; + +namespace internal { +class CpuProfile; +} // namespace internal + +} // namespace v8 + +#ifdef V8_OS_WIN +template class V8_EXPORT std::vector; +#endif + +namespace v8 { + +struct V8_EXPORT CpuProfileDeoptInfo { + /** A pointer to a static string owned by v8. */ + const char* deopt_reason; + std::vector stack; +}; + +} // namespace v8 + +#ifdef V8_OS_WIN +template class V8_EXPORT std::vector; +#endif + +namespace v8 { + +/** + * CpuProfileNode represents a node in a call graph. + */ +class V8_EXPORT CpuProfileNode { + public: + struct LineTick { + /** The 1-based number of the source line where the function originates. */ + int line; + + /** The count of samples associated with the source line. */ + unsigned int hit_count; + }; + + // An annotation hinting at the source of a CpuProfileNode. + enum SourceType { + // User-supplied script with associated resource information. + kScript = 0, + // Native scripts and provided builtins. + kBuiltin = 1, + // Callbacks into native code. + kCallback = 2, + // VM-internal functions or state. + kInternal = 3, + // A node that failed to symbolize. + kUnresolved = 4, + }; + + /** Returns function name (empty string for anonymous functions.) */ + Local GetFunctionName() const; + + /** + * Returns function name (empty string for anonymous functions.) + * The string ownership is *not* passed to the caller. It stays valid until + * profile is deleted. The function is thread safe. + */ + const char* GetFunctionNameStr() const; + + /** Returns id of the script where function is located. */ + int GetScriptId() const; + + /** Returns resource name for script from where the function originates. */ + Local GetScriptResourceName() const; + + /** + * Returns resource name for script from where the function originates. + * The string ownership is *not* passed to the caller. It stays valid until + * profile is deleted. The function is thread safe. + */ + const char* GetScriptResourceNameStr() const; + + /** + * Return true if the script from where the function originates is flagged as + * being shared cross-origin. + */ + bool IsScriptSharedCrossOrigin() const; + + /** + * Returns the number, 1-based, of the line where the function originates. + * kNoLineNumberInfo if no line number information is available. + */ + int GetLineNumber() const; + + /** + * Returns 1-based number of the column where the function originates. + * kNoColumnNumberInfo if no column number information is available. + */ + int GetColumnNumber() const; + + /** + * Returns the number of the function's source lines that collect the samples. + */ + unsigned int GetHitLineCount() const; + + /** Returns the set of source lines that collect the samples. + * The caller allocates buffer and responsible for releasing it. + * True if all available entries are copied, otherwise false. + * The function copies nothing if buffer is not large enough. + */ + bool GetLineTicks(LineTick* entries, unsigned int length) const; + + /** Returns bailout reason for the function + * if the optimization was disabled for it. + */ + const char* GetBailoutReason() const; + + /** + * Returns the count of samples where the function was currently executing. + */ + unsigned GetHitCount() const; + + /** Returns id of the node. The id is unique within the tree */ + unsigned GetNodeId() const; + + /** + * Gets the type of the source which the node was captured from. + */ + SourceType GetSourceType() const; + + /** Returns child nodes count of the node. */ + int GetChildrenCount() const; + + /** Retrieves a child node by index. */ + const CpuProfileNode* GetChild(int index) const; + + /** Retrieves the ancestor node, or null if the root. */ + const CpuProfileNode* GetParent() const; + + /** Retrieves deopt infos for the node. */ + const std::vector& GetDeoptInfos() const; + + static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; + static const int kNoColumnNumberInfo = Message::kNoColumnInfo; +}; + + +/** + * CpuProfile contains a CPU profile in a form of top-down call tree + * (from main() down to functions that do all the work). + */ +class V8_EXPORT CpuProfile { + public: + /** Returns CPU profile title. */ + Local GetTitle() const; + + /** Returns the root node of the top down call tree. */ + const CpuProfileNode* GetTopDownRoot() const; + + /** + * Returns number of samples recorded. The samples are not recorded unless + * |record_samples| parameter of CpuProfiler::StartCpuProfiling is true. + */ + int GetSamplesCount() const; + + /** + * Returns profile node corresponding to the top frame the sample at + * the given index. + */ + const CpuProfileNode* GetSample(int index) const; + + /** + * Returns the timestamp of the sample. The timestamp is the number of + * microseconds since some unspecified starting point. + * The point is equal to the starting point used by GetStartTime. + */ + int64_t GetSampleTimestamp(int index) const; + + /** + * Returns time when the profile recording was started (in microseconds) + * since some unspecified starting point. + */ + int64_t GetStartTime() const; + + /** + * Returns time when the profile recording was stopped (in microseconds) + * since some unspecified starting point. + * The point is equal to the starting point used by GetStartTime. + */ + int64_t GetEndTime() const; + + /** + * Deletes the profile and removes it from CpuProfiler's list. + * All pointers to nodes previously returned become invalid. + */ + void Delete(); +}; + +enum CpuProfilingMode { + // In the resulting CpuProfile tree, intermediate nodes in a stack trace + // (from the root to a leaf) will have line numbers that point to the start + // line of the function, rather than the line of the callsite of the child. + kLeafNodeLineNumbers, + // In the resulting CpuProfile tree, nodes are separated based on the line + // number of their callsite in their parent. + kCallerLineNumbers, +}; + +// Determines how names are derived for functions sampled. +enum CpuProfilingNamingMode { + // Use the immediate name of functions at compilation time. + kStandardNaming, + // Use more verbose naming for functions without names, inferred from scope + // where possible. + kDebugNaming, +}; + +enum CpuProfilingLoggingMode { + // Enables logging when a profile is active, and disables logging when all + // profiles are detached. + kLazyLogging, + // Enables logging for the lifetime of the CpuProfiler. Calls to + // StartRecording are faster, at the expense of runtime overhead. + kEagerLogging, +}; + +// Enum for returning profiling status. Once StartProfiling is called, +// we want to return to clients whether the profiling was able to start +// correctly, or return a descriptive error. +enum class CpuProfilingStatus { + kStarted, + kAlreadyStarted, + kErrorTooManyProfilers +}; + +/** + * Delegate for when max samples reached and samples are discarded. + */ +class V8_EXPORT DiscardedSamplesDelegate { + public: + DiscardedSamplesDelegate() {} + + virtual ~DiscardedSamplesDelegate() = default; + virtual void Notify() = 0; +}; + +/** + * Optional profiling attributes. + */ +class V8_EXPORT CpuProfilingOptions { + public: + // Indicates that the sample buffer size should not be explicitly limited. + static const unsigned kNoSampleLimit = UINT_MAX; + + /** + * \param mode Type of computation of stack frame line numbers. + * \param max_samples The maximum number of samples that should be recorded by + * the profiler. Samples obtained after this limit will be + * discarded. + * \param sampling_interval_us controls the profile-specific target + * sampling interval. The provided sampling + * interval will be snapped to the next lowest + * non-zero multiple of the profiler's sampling + * interval, set via SetSamplingInterval(). If + * zero, the sampling interval will be equal to + * the profiler's sampling interval. + * \param filter_context Deprecated option to filter by context, currently a + * no-op. + */ + CpuProfilingOptions( + CpuProfilingMode mode = kLeafNodeLineNumbers, + unsigned max_samples = kNoSampleLimit, int sampling_interval_us = 0, + MaybeLocal filter_context = MaybeLocal()); + + CpuProfilingMode mode() const { return mode_; } + unsigned max_samples() const { return max_samples_; } + int sampling_interval_us() const { return sampling_interval_us_; } + + private: + friend class internal::CpuProfile; + + CpuProfilingMode mode_; + unsigned max_samples_; + int sampling_interval_us_; +}; + +/** + * Interface for controlling CPU profiling. Instance of the + * profiler can be created using v8::CpuProfiler::New method. + */ +class V8_EXPORT CpuProfiler { + public: + /** + * Creates a new CPU profiler for the |isolate|. The isolate must be + * initialized. The profiler object must be disposed after use by calling + * |Dispose| method. + */ + static CpuProfiler* New(Isolate* isolate, + CpuProfilingNamingMode = kDebugNaming, + CpuProfilingLoggingMode = kLazyLogging); + + /** + * Synchronously collect current stack sample in all profilers attached to + * the |isolate|. The call does not affect number of ticks recorded for + * the current top node. + */ + static void CollectSample(Isolate* isolate); + + /** + * Disposes the CPU profiler object. + */ + void Dispose(); + + /** + * Changes default CPU profiler sampling interval to the specified number + * of microseconds. Default interval is 1000us. This method must be called + * when there are no profiles being recorded. + */ + void SetSamplingInterval(int us); + + /** + * Sets whether or not the profiler should prioritize consistency of sample + * periodicity on Windows. Disabling this can greatly reduce CPU usage, but + * may result in greater variance in sample timings from the platform's + * scheduler. Defaults to enabled. This method must be called when there are + * no profiles being recorded. + */ + void SetUsePreciseSampling(bool); + + /** + * Starts collecting a CPU profile. Title may be an empty string. Several + * profiles may be collected at once. Attempts to start collecting several + * profiles with the same title are silently ignored. + */ + CpuProfilingStatus StartProfiling( + Local title, CpuProfilingOptions options, + std::unique_ptr delegate = nullptr); + + /** + * Starts profiling with the same semantics as above, except with expanded + * parameters. + * + * |record_samples| parameter controls whether individual samples should + * be recorded in addition to the aggregated tree. + * + * |max_samples| controls the maximum number of samples that should be + * recorded by the profiler. Samples obtained after this limit will be + * discarded. + */ + CpuProfilingStatus StartProfiling( + Local title, CpuProfilingMode mode, bool record_samples = false, + unsigned max_samples = CpuProfilingOptions::kNoSampleLimit); + /** + * The same as StartProfiling above, but the CpuProfilingMode defaults to + * kLeafNodeLineNumbers mode, which was the previous default behavior of the + * profiler. + */ + CpuProfilingStatus StartProfiling(Local title, + bool record_samples = false); + + /** + * Stops collecting CPU profile with a given title and returns it. + * If the title given is empty, finishes the last profile started. + */ + CpuProfile* StopProfiling(Local title); + + /** + * Generate more detailed source positions to code objects. This results in + * better results when mapping profiling samples to script source. + */ + static void UseDetailedSourcePositionsForProfiling(Isolate* isolate); + + private: + CpuProfiler(); + ~CpuProfiler(); + CpuProfiler(const CpuProfiler&); + CpuProfiler& operator=(const CpuProfiler&); +}; + +/** + * HeapSnapshotEdge represents a directed connection between heap + * graph nodes: from retainers to retained nodes. + */ +class V8_EXPORT HeapGraphEdge { + public: + enum Type { + kContextVariable = 0, // A variable from a function context. + kElement = 1, // An element of an array. + kProperty = 2, // A named object property. + kInternal = 3, // A link that can't be accessed from JS, + // thus, its name isn't a real property name + // (e.g. parts of a ConsString). + kHidden = 4, // A link that is needed for proper sizes + // calculation, but may be hidden from user. + kShortcut = 5, // A link that must not be followed during + // sizes calculation. + kWeak = 6 // A weak reference (ignored by the GC). + }; + + /** Returns edge type (see HeapGraphEdge::Type). */ + Type GetType() const; + + /** + * Returns edge name. This can be a variable name, an element index, or + * a property name. + */ + Local GetName() const; + + /** Returns origin node. */ + const HeapGraphNode* GetFromNode() const; + + /** Returns destination node. */ + const HeapGraphNode* GetToNode() const; +}; + + +/** + * HeapGraphNode represents a node in a heap graph. + */ +class V8_EXPORT HeapGraphNode { + public: + enum Type { + kHidden = 0, // Hidden node, may be filtered when shown to user. + kArray = 1, // An array of elements. + kString = 2, // A string. + kObject = 3, // A JS object (except for arrays and strings). + kCode = 4, // Compiled code. + kClosure = 5, // Function closure. + kRegExp = 6, // RegExp. + kHeapNumber = 7, // Number stored in the heap. + kNative = 8, // Native object (not from V8 heap). + kSynthetic = 9, // Synthetic object, usually used for grouping + // snapshot items together. + kConsString = 10, // Concatenated string. A pair of pointers to strings. + kSlicedString = 11, // Sliced string. A fragment of another string. + kSymbol = 12, // A Symbol (ES6). + kBigInt = 13 // BigInt. + }; + + /** Returns node type (see HeapGraphNode::Type). */ + Type GetType() const; + + /** + * Returns node name. Depending on node's type this can be the name + * of the constructor (for objects), the name of the function (for + * closures), string value, or an empty string (for compiled code). + */ + Local GetName() const; + + /** + * Returns node id. For the same heap object, the id remains the same + * across all snapshots. + */ + SnapshotObjectId GetId() const; + + /** Returns node's own size, in bytes. */ + size_t GetShallowSize() const; + + /** Returns child nodes count of the node. */ + int GetChildrenCount() const; + + /** Retrieves a child by index. */ + const HeapGraphEdge* GetChild(int index) const; +}; + + +/** + * An interface for exporting data from V8, using "push" model. + */ +class V8_EXPORT OutputStream { + public: + enum WriteResult { + kContinue = 0, + kAbort = 1 + }; + virtual ~OutputStream() = default; + /** Notify about the end of stream. */ + virtual void EndOfStream() = 0; + /** Get preferred output chunk size. Called only once. */ + virtual int GetChunkSize() { return 1024; } + /** + * Writes the next chunk of snapshot data into the stream. Writing + * can be stopped by returning kAbort as function result. EndOfStream + * will not be called in case writing was aborted. + */ + virtual WriteResult WriteAsciiChunk(char* data, int size) = 0; + /** + * Writes the next chunk of heap stats data into the stream. Writing + * can be stopped by returning kAbort as function result. EndOfStream + * will not be called in case writing was aborted. + */ + virtual WriteResult WriteHeapStatsChunk(HeapStatsUpdate* data, int count) { + return kAbort; + } +}; + +/** + * HeapSnapshots record the state of the JS heap at some moment. + */ +class V8_EXPORT HeapSnapshot { + public: + enum SerializationFormat { + kJSON = 0 // See format description near 'Serialize' method. + }; + + /** Returns the root node of the heap graph. */ + const HeapGraphNode* GetRoot() const; + + /** Returns a node by its id. */ + const HeapGraphNode* GetNodeById(SnapshotObjectId id) const; + + /** Returns total nodes count in the snapshot. */ + int GetNodesCount() const; + + /** Returns a node by index. */ + const HeapGraphNode* GetNode(int index) const; + + /** Returns a max seen JS object Id. */ + SnapshotObjectId GetMaxSnapshotJSObjectId() const; + + /** + * Deletes the snapshot and removes it from HeapProfiler's list. + * All pointers to nodes, edges and paths previously returned become + * invalid. + */ + void Delete(); + + /** + * Prepare a serialized representation of the snapshot. The result + * is written into the stream provided in chunks of specified size. + * The total length of the serialized snapshot is unknown in + * advance, it can be roughly equal to JS heap size (that means, + * it can be really big - tens of megabytes). + * + * For the JSON format, heap contents are represented as an object + * with the following structure: + * + * { + * snapshot: { + * title: "...", + * uid: nnn, + * meta: { meta-info }, + * node_count: nnn, + * edge_count: nnn + * }, + * nodes: [nodes array], + * edges: [edges array], + * strings: [strings array] + * } + * + * Nodes reference strings, other nodes, and edges by their indexes + * in corresponding arrays. + */ + void Serialize(OutputStream* stream, + SerializationFormat format = kJSON) const; +}; + + +/** + * An interface for reporting progress and controlling long-running + * activities. + */ +class V8_EXPORT ActivityControl { + public: + enum ControlOption { + kContinue = 0, + kAbort = 1 + }; + virtual ~ActivityControl() = default; + /** + * Notify about current progress. The activity can be stopped by + * returning kAbort as the callback result. + */ + virtual ControlOption ReportProgressValue(int done, int total) = 0; +}; + +/** + * AllocationProfile is a sampled profile of allocations done by the program. + * This is structured as a call-graph. + */ +class V8_EXPORT AllocationProfile { + public: + struct Allocation { + /** + * Size of the sampled allocation object. + */ + size_t size; + + /** + * The number of objects of such size that were sampled. + */ + unsigned int count; + }; + + /** + * Represents a node in the call-graph. + */ + struct Node { + /** + * Name of the function. May be empty for anonymous functions or if the + * script corresponding to this function has been unloaded. + */ + Local name; + + /** + * Name of the script containing the function. May be empty if the script + * name is not available, or if the script has been unloaded. + */ + Local script_name; + + /** + * id of the script where the function is located. May be equal to + * v8::UnboundScript::kNoScriptId in cases where the script doesn't exist. + */ + int script_id; + + /** + * Start position of the function in the script. + */ + int start_position; + + /** + * 1-indexed line number where the function starts. May be + * kNoLineNumberInfo if no line number information is available. + */ + int line_number; + + /** + * 1-indexed column number where the function starts. May be + * kNoColumnNumberInfo if no line number information is available. + */ + int column_number; + + /** + * Unique id of the node. + */ + uint32_t node_id; + + /** + * List of callees called from this node for which we have sampled + * allocations. The lifetime of the children is scoped to the containing + * AllocationProfile. + */ + std::vector children; + + /** + * List of self allocations done by this node in the call-graph. + */ + std::vector allocations; + }; + + /** + * Represent a single sample recorded for an allocation. + */ + struct Sample { + /** + * id of the node in the profile tree. + */ + uint32_t node_id; + + /** + * Size of the sampled allocation object. + */ + size_t size; + + /** + * The number of objects of such size that were sampled. + */ + unsigned int count; + + /** + * Unique time-ordered id of the allocation sample. Can be used to track + * what samples were added or removed between two snapshots. + */ + uint64_t sample_id; + }; + + /** + * Returns the root node of the call-graph. The root node corresponds to an + * empty JS call-stack. The lifetime of the returned Node* is scoped to the + * containing AllocationProfile. + */ + virtual Node* GetRootNode() = 0; + virtual const std::vector& GetSamples() = 0; + + virtual ~AllocationProfile() = default; + + static const int kNoLineNumberInfo = Message::kNoLineNumberInfo; + static const int kNoColumnNumberInfo = Message::kNoColumnInfo; +}; + +/** + * An object graph consisting of embedder objects and V8 objects. + * Edges of the graph are strong references between the objects. + * The embedder can build this graph during heap snapshot generation + * to include the embedder objects in the heap snapshot. + * Usage: + * 1) Define derived class of EmbedderGraph::Node for embedder objects. + * 2) Set the build embedder graph callback on the heap profiler using + * HeapProfiler::AddBuildEmbedderGraphCallback. + * 3) In the callback use graph->AddEdge(node1, node2) to add an edge from + * node1 to node2. + * 4) To represent references from/to V8 object, construct V8 nodes using + * graph->V8Node(value). + */ +class V8_EXPORT EmbedderGraph { + public: + class Node { + public: + /** + * Detachedness specifies whether an object is attached or detached from the + * main application state. While unkown in general, there may be objects + * that specifically know their state. V8 passes this information along in + * the snapshot. Users of the snapshot may use it to annotate the object + * graph. + */ + enum class Detachedness : uint8_t { + kUnknown = 0, + kAttached = 1, + kDetached = 2, + }; + + Node() = default; + virtual ~Node() = default; + virtual const char* Name() = 0; + virtual size_t SizeInBytes() = 0; + /** + * The corresponding V8 wrapper node if not null. + * During heap snapshot generation the embedder node and the V8 wrapper + * node will be merged into one node to simplify retaining paths. + */ + virtual Node* WrapperNode() { return nullptr; } + virtual bool IsRootNode() { return false; } + /** Must return true for non-V8 nodes. */ + virtual bool IsEmbedderNode() { return true; } + /** + * Optional name prefix. It is used in Chrome for tagging detached nodes. + */ + virtual const char* NamePrefix() { return nullptr; } + + /** + * Returns the NativeObject that can be used for querying the + * |HeapSnapshot|. + */ + virtual NativeObject GetNativeObject() { return nullptr; } + + /** + * Detachedness state of a given object. While unkown in general, there may + * be objects that specifically know their state. V8 passes this information + * along in the snapshot. Users of the snapshot may use it to annotate the + * object graph. + */ + virtual Detachedness GetDetachedness() { return Detachedness::kUnknown; } + + Node(const Node&) = delete; + Node& operator=(const Node&) = delete; + }; + + /** + * Returns a node corresponding to the given V8 value. Ownership is not + * transferred. The result pointer is valid while the graph is alive. + */ + virtual Node* V8Node(const v8::Local& value) = 0; + + /** + * Adds the given node to the graph and takes ownership of the node. + * Returns a raw pointer to the node that is valid while the graph is alive. + */ + virtual Node* AddNode(std::unique_ptr node) = 0; + + /** + * Adds an edge that represents a strong reference from the given + * node |from| to the given node |to|. The nodes must be added to the graph + * before calling this function. + * + * If name is nullptr, the edge will have auto-increment indexes, otherwise + * it will be named accordingly. + */ + virtual void AddEdge(Node* from, Node* to, const char* name = nullptr) = 0; + + virtual ~EmbedderGraph() = default; +}; + +/** + * Interface for controlling heap profiling. Instance of the + * profiler can be retrieved using v8::Isolate::GetHeapProfiler. + */ +class V8_EXPORT HeapProfiler { + public: + enum SamplingFlags { + kSamplingNoFlags = 0, + kSamplingForceGC = 1 << 0, + }; + + /** + * Callback function invoked during heap snapshot generation to retrieve + * the embedder object graph. The callback should use graph->AddEdge(..) to + * add references between the objects. + * The callback must not trigger garbage collection in V8. + */ + typedef void (*BuildEmbedderGraphCallback)(v8::Isolate* isolate, + v8::EmbedderGraph* graph, + void* data); + + /** + * Callback function invoked during heap snapshot generation to retrieve + * the detachedness state of an object referenced by a TracedReference. + * + * The callback takes Local as parameter to allow the embedder to + * unpack the TracedReference into a Local and reuse that Local for different + * purposes. + */ + using GetDetachednessCallback = EmbedderGraph::Node::Detachedness (*)( + v8::Isolate* isolate, const v8::Local& v8_value, + uint16_t class_id, void* data); + + /** Returns the number of snapshots taken. */ + int GetSnapshotCount(); + + /** Returns a snapshot by index. */ + const HeapSnapshot* GetHeapSnapshot(int index); + + /** + * Returns SnapshotObjectId for a heap object referenced by |value| if + * it has been seen by the heap profiler, kUnknownObjectId otherwise. + */ + SnapshotObjectId GetObjectId(Local value); + + /** + * Returns SnapshotObjectId for a native object referenced by |value| if it + * has been seen by the heap profiler, kUnknownObjectId otherwise. + */ + SnapshotObjectId GetObjectId(NativeObject value); + + /** + * Returns heap object with given SnapshotObjectId if the object is alive, + * otherwise empty handle is returned. + */ + Local FindObjectById(SnapshotObjectId id); + + /** + * Clears internal map from SnapshotObjectId to heap object. The new objects + * will not be added into it unless a heap snapshot is taken or heap object + * tracking is kicked off. + */ + void ClearObjectIds(); + + /** + * A constant for invalid SnapshotObjectId. GetSnapshotObjectId will return + * it in case heap profiler cannot find id for the object passed as + * parameter. HeapSnapshot::GetNodeById will always return NULL for such id. + */ + static const SnapshotObjectId kUnknownObjectId = 0; + + /** + * Callback interface for retrieving user friendly names of global objects. + */ + class ObjectNameResolver { + public: + /** + * Returns name to be used in the heap snapshot for given node. Returned + * string must stay alive until snapshot collection is completed. + */ + virtual const char* GetName(Local object) = 0; + + protected: + virtual ~ObjectNameResolver() = default; + }; + + /** + * Takes a heap snapshot and returns it. + */ + const HeapSnapshot* TakeHeapSnapshot( + ActivityControl* control = nullptr, + ObjectNameResolver* global_object_name_resolver = nullptr, + bool treat_global_objects_as_roots = true); + + /** + * Takes a heap snapshot and returns it. + */ + const HeapSnapshot* TakeHeapSnapshotV8_92( + ActivityControl* control = nullptr, + ObjectNameResolver* global_object_name_resolver = nullptr, + bool treat_global_objects_as_roots = true, + bool capture_numeric_value = false); + + /** + * Starts tracking of heap objects population statistics. After calling + * this method, all heap objects relocations done by the garbage collector + * are being registered. + * + * |track_allocations| parameter controls whether stack trace of each + * allocation in the heap will be recorded and reported as part of + * HeapSnapshot. + */ + void StartTrackingHeapObjects(bool track_allocations = false); + + /** + * Adds a new time interval entry to the aggregated statistics array. The + * time interval entry contains information on the current heap objects + * population size. The method also updates aggregated statistics and + * reports updates for all previous time intervals via the OutputStream + * object. Updates on each time interval are provided as a stream of the + * HeapStatsUpdate structure instances. + * If |timestamp_us| is supplied, timestamp of the new entry will be written + * into it. The return value of the function is the last seen heap object Id. + * + * StartTrackingHeapObjects must be called before the first call to this + * method. + */ + SnapshotObjectId GetHeapStats(OutputStream* stream, + int64_t* timestamp_us = nullptr); + + /** + * Stops tracking of heap objects population statistics, cleans up all + * collected data. StartHeapObjectsTracking must be called again prior to + * calling GetHeapStats next time. + */ + void StopTrackingHeapObjects(); + + /** + * Starts gathering a sampling heap profile. A sampling heap profile is + * similar to tcmalloc's heap profiler and Go's mprof. It samples object + * allocations and builds an online 'sampling' heap profile. At any point in + * time, this profile is expected to be a representative sample of objects + * currently live in the system. Each sampled allocation includes the stack + * trace at the time of allocation, which makes this really useful for memory + * leak detection. + * + * This mechanism is intended to be cheap enough that it can be used in + * production with minimal performance overhead. + * + * Allocations are sampled using a randomized Poisson process. On average, one + * allocation will be sampled every |sample_interval| bytes allocated. The + * |stack_depth| parameter controls the maximum number of stack frames to be + * captured on each allocation. + * + * NOTE: This is a proof-of-concept at this point. Right now we only sample + * newspace allocations. Support for paged space allocation (e.g. pre-tenured + * objects, large objects, code objects, etc.) and native allocations + * doesn't exist yet, but is anticipated in the future. + * + * Objects allocated before the sampling is started will not be included in + * the profile. + * + * Returns false if a sampling heap profiler is already running. + */ + bool StartSamplingHeapProfiler(uint64_t sample_interval = 512 * 1024, + int stack_depth = 16, + SamplingFlags flags = kSamplingNoFlags); + + /** + * Stops the sampling heap profile and discards the current profile. + */ + void StopSamplingHeapProfiler(); + + /** + * Returns the sampled profile of allocations allocated (and still live) since + * StartSamplingHeapProfiler was called. The ownership of the pointer is + * transferred to the caller. Returns nullptr if sampling heap profiler is not + * active. + */ + AllocationProfile* GetAllocationProfile(); + + /** + * Deletes all snapshots taken. All previously returned pointers to + * snapshots and their contents become invalid after this call. + */ + void DeleteAllHeapSnapshots(); + + void AddBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback, + void* data); + void RemoveBuildEmbedderGraphCallback(BuildEmbedderGraphCallback callback, + void* data); + + void SetGetDetachednessCallback(GetDetachednessCallback callback, void* data); + + /** + * Default value of persistent handle class ID. Must not be used to + * define a class. Can be used to reset a class of a persistent + * handle. + */ + static const uint16_t kPersistentHandleNoClassId = 0; + + private: + HeapProfiler(); + ~HeapProfiler(); + HeapProfiler(const HeapProfiler&); + HeapProfiler& operator=(const HeapProfiler&); +}; + +/** + * A struct for exporting HeapStats data from V8, using "push" model. + * See HeapProfiler::GetHeapStats. + */ +struct HeapStatsUpdate { + HeapStatsUpdate(uint32_t index, uint32_t count, uint32_t size) + : index(index), count(count), size(size) { } + uint32_t index; // Index of the time interval that was changed. + uint32_t count; // New value of count field for the interval with this index. + uint32_t size; // New value of size field for the interval with this index. +}; + +#define CODE_EVENTS_LIST(V) \ + V(Builtin) \ + V(Callback) \ + V(Eval) \ + V(Function) \ + V(InterpretedFunction) \ + V(Handler) \ + V(BytecodeHandler) \ + V(LazyCompile) \ + V(RegExp) \ + V(Script) \ + V(Stub) \ + V(Relocation) + +/** + * Note that this enum may be extended in the future. Please include a default + * case if this enum is used in a switch statement. + */ +enum CodeEventType { + kUnknownType = 0 +#define V(Name) , k##Name##Type + CODE_EVENTS_LIST(V) +#undef V +}; + +/** + * Representation of a code creation event + */ +class V8_EXPORT CodeEvent { + public: + uintptr_t GetCodeStartAddress(); + size_t GetCodeSize(); + Local GetFunctionName(); + Local GetScriptName(); + int GetScriptLine(); + int GetScriptColumn(); + /** + * NOTE (mmarchini): We can't allocate objects in the heap when we collect + * existing code, and both the code type and the comment are not stored in the + * heap, so we return those as const char*. + */ + CodeEventType GetCodeType(); + const char* GetComment(); + + static const char* GetCodeEventTypeName(CodeEventType code_event_type); + + uintptr_t GetPreviousCodeStartAddress(); +}; + +/** + * Interface to listen to code creation and code relocation events. + */ +class V8_EXPORT CodeEventHandler { + public: + /** + * Creates a new listener for the |isolate|. The isolate must be initialized. + * The listener object must be disposed after use by calling |Dispose| method. + * Multiple listeners can be created for the same isolate. + */ + explicit CodeEventHandler(Isolate* isolate); + virtual ~CodeEventHandler(); + + /** + * Handle is called every time a code object is created or moved. Information + * about each code event will be available through the `code_event` + * parameter. + * + * When the CodeEventType is kRelocationType, the code for this CodeEvent has + * moved from `GetPreviousCodeStartAddress()` to `GetCodeStartAddress()`. + */ + virtual void Handle(CodeEvent* code_event) = 0; + + /** + * Call `Enable()` to starts listening to code creation and code relocation + * events. These events will be handled by `Handle()`. + */ + void Enable(); + + /** + * Call `Disable()` to stop listening to code creation and code relocation + * events. + */ + void Disable(); + + private: + CodeEventHandler(); + CodeEventHandler(const CodeEventHandler&); + CodeEventHandler& operator=(const CodeEventHandler&); + void* internal_listener_; +}; + +} // namespace v8 + + +#endif // V8_V8_PROFILER_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-unwinder-state.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-unwinder-state.h new file mode 100644 index 00000000000..00f8b8b176d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-unwinder-state.h @@ -0,0 +1,30 @@ +// Copyright 2020 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef INCLUDE_V8_UNWINDER_STATE_H_ +#define INCLUDE_V8_UNWINDER_STATE_H_ + +namespace v8 { + +#ifdef V8_TARGET_ARCH_ARM +struct CalleeSavedRegisters { + void* arm_r4; + void* arm_r5; + void* arm_r6; + void* arm_r7; + void* arm_r8; + void* arm_r9; + void* arm_r10; +}; +#elif V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32 || V8_TARGET_ARCH_ARM64 || \ + V8_TARGET_ARCH_MIPS || V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC || \ + V8_TARGET_ARCH_PPC64 || V8_TARGET_ARCH_RISCV64 || V8_TARGET_ARCH_S390 +struct CalleeSavedRegisters {}; +#else +#error Target architecture was not detected as supported by v8 +#endif + +} // namespace v8 + +#endif // INCLUDE_V8_UNWINDER _STATE_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-util.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-util.h new file mode 100644 index 00000000000..8e4d66153d1 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-util.h @@ -0,0 +1,652 @@ +// Copyright 2014 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_UTIL_H_ +#define V8_UTIL_H_ + +#include "v8.h" // NOLINT(build/include_directory) +#include +#include +#include + +/** + * Support for Persistent containers. + * + * C++11 embedders can use STL containers with Global values, + * but pre-C++11 does not support the required move semantic and hence + * may want these container classes. + */ +namespace v8 { + +typedef uintptr_t PersistentContainerValue; +static const uintptr_t kPersistentContainerNotFound = 0; +enum PersistentContainerCallbackType { + kNotWeak, + // These correspond to v8::WeakCallbackType + kWeakWithParameter, + kWeakWithInternalFields +}; + +/** + * A default trait implementation for PersistentValueMap which uses std::map + * as a backing map. + * + * Users will have to implement their own weak callbacks & dispose traits. + */ +template +class StdMapTraits { + public: + // STL map & related: + typedef std::map Impl; + typedef typename Impl::iterator Iterator; + + static bool Empty(Impl* impl) { return impl->empty(); } + static size_t Size(Impl* impl) { return impl->size(); } + static void Swap(Impl& a, Impl& b) { std::swap(a, b); } + static Iterator Begin(Impl* impl) { return impl->begin(); } + static Iterator End(Impl* impl) { return impl->end(); } + static K Key(Iterator it) { return it->first; } + static PersistentContainerValue Value(Iterator it) { return it->second; } + static PersistentContainerValue Set(Impl* impl, K key, + PersistentContainerValue value) { + std::pair res = impl->insert(std::make_pair(key, value)); + PersistentContainerValue old_value = kPersistentContainerNotFound; + if (!res.second) { + old_value = res.first->second; + res.first->second = value; + } + return old_value; + } + static PersistentContainerValue Get(Impl* impl, K key) { + Iterator it = impl->find(key); + if (it == impl->end()) return kPersistentContainerNotFound; + return it->second; + } + static PersistentContainerValue Remove(Impl* impl, K key) { + Iterator it = impl->find(key); + if (it == impl->end()) return kPersistentContainerNotFound; + PersistentContainerValue value = it->second; + impl->erase(it); + return value; + } +}; + + +/** + * A default trait implementation for PersistentValueMap, which inherits + * a std:map backing map from StdMapTraits and holds non-weak persistent + * objects and has no special Dispose handling. + * + * You should not derive from this class, since MapType depends on the + * surrounding class, and hence a subclass cannot simply inherit the methods. + */ +template +class DefaultPersistentValueMapTraits : public StdMapTraits { + public: + // Weak callback & friends: + static const PersistentContainerCallbackType kCallbackType = kNotWeak; + typedef PersistentValueMap > + MapType; + typedef void WeakCallbackDataType; + + static WeakCallbackDataType* WeakCallbackParameter( + MapType* map, const K& key, Local value) { + return nullptr; + } + static MapType* MapFromWeakCallbackInfo( + const WeakCallbackInfo& data) { + return nullptr; + } + static K KeyFromWeakCallbackInfo( + const WeakCallbackInfo& data) { + return K(); + } + static void DisposeCallbackData(WeakCallbackDataType* data) { } + static void Dispose(Isolate* isolate, Global value, K key) {} +}; + + +template +class DefaultGlobalMapTraits : public StdMapTraits { + private: + template + struct RemovePointer; + + public: + // Weak callback & friends: + static const PersistentContainerCallbackType kCallbackType = kNotWeak; + typedef GlobalValueMap > MapType; + typedef void WeakCallbackDataType; + + static WeakCallbackDataType* WeakCallbackParameter(MapType* map, const K& key, + Local value) { + return nullptr; + } + static MapType* MapFromWeakCallbackInfo( + const WeakCallbackInfo& data) { + return nullptr; + } + static K KeyFromWeakCallbackInfo( + const WeakCallbackInfo& data) { + return K(); + } + static void DisposeCallbackData(WeakCallbackDataType* data) {} + static void OnWeakCallback( + const WeakCallbackInfo& data) {} + static void Dispose(Isolate* isolate, Global value, K key) {} + // This is a second pass callback, so SetSecondPassCallback cannot be called. + static void DisposeWeak(const WeakCallbackInfo& data) {} + + private: + template + struct RemovePointer { + typedef T Type; + }; +}; + + +/** + * A map wrapper that allows using Global as a mapped value. + * C++11 embedders don't need this class, as they can use Global + * directly in std containers. + * + * The map relies on a backing map, whose type and accessors are described + * by the Traits class. The backing map will handle values of type + * PersistentContainerValue, with all conversion into and out of V8 + * handles being transparently handled by this class. + */ +template +class PersistentValueMapBase { + public: + Isolate* GetIsolate() { return isolate_; } + + /** + * Return size of the map. + */ + size_t Size() { return Traits::Size(&impl_); } + + /** + * Return whether the map holds weak persistents. + */ + bool IsWeak() { return Traits::kCallbackType != kNotWeak; } + + /** + * Get value stored in map. + */ + Local Get(const K& key) { + return Local::New(isolate_, FromVal(Traits::Get(&impl_, key))); + } + + /** + * Check whether a value is contained in the map. + */ + bool Contains(const K& key) { + return Traits::Get(&impl_, key) != kPersistentContainerNotFound; + } + + /** + * Get value stored in map and set it in returnValue. + * Return true if a value was found. + */ + bool SetReturnValue(const K& key, + ReturnValue returnValue) { + return SetReturnValueFromVal(&returnValue, Traits::Get(&impl_, key)); + } + + /** + * Return value for key and remove it from the map. + */ + Global Remove(const K& key) { + return Release(Traits::Remove(&impl_, key)).Pass(); + } + + /** + * Traverses the map repeatedly, + * in case side effects of disposal cause insertions. + **/ + void Clear() { + typedef typename Traits::Iterator It; + HandleScope handle_scope(isolate_); + // TODO(dcarney): figure out if this swap and loop is necessary. + while (!Traits::Empty(&impl_)) { + typename Traits::Impl impl; + Traits::Swap(impl_, impl); + for (It i = Traits::Begin(&impl); i != Traits::End(&impl); ++i) { + Traits::Dispose(isolate_, Release(Traits::Value(i)).Pass(), + Traits::Key(i)); + } + } + } + + /** + * Helper class for GetReference/SetWithReference. Do not use outside + * that context. + */ + class PersistentValueReference { + public: + PersistentValueReference() : value_(kPersistentContainerNotFound) { } + PersistentValueReference(const PersistentValueReference& other) + : value_(other.value_) { } + + Local NewLocal(Isolate* isolate) const { + return Local::New(isolate, FromVal(value_)); + } + bool IsEmpty() const { + return value_ == kPersistentContainerNotFound; + } + template + bool SetReturnValue(ReturnValue returnValue) { + return SetReturnValueFromVal(&returnValue, value_); + } + void Reset() { + value_ = kPersistentContainerNotFound; + } + void operator=(const PersistentValueReference& other) { + value_ = other.value_; + } + + private: + friend class PersistentValueMapBase; + friend class PersistentValueMap; + friend class GlobalValueMap; + + explicit PersistentValueReference(PersistentContainerValue value) + : value_(value) { } + + void operator=(PersistentContainerValue value) { + value_ = value; + } + + PersistentContainerValue value_; + }; + + /** + * Get a reference to a map value. This enables fast, repeated access + * to a value stored in the map while the map remains unchanged. + * + * Careful: This is potentially unsafe, so please use with care. + * The value will become invalid if the value for this key changes + * in the underlying map, as a result of Set or Remove for the same + * key; as a result of the weak callback for the same key; or as a + * result of calling Clear() or destruction of the map. + */ + PersistentValueReference GetReference(const K& key) { + return PersistentValueReference(Traits::Get(&impl_, key)); + } + + protected: + explicit PersistentValueMapBase(Isolate* isolate) + : isolate_(isolate), label_(nullptr) {} + PersistentValueMapBase(Isolate* isolate, const char* label) + : isolate_(isolate), label_(label) {} + + ~PersistentValueMapBase() { Clear(); } + + Isolate* isolate() { return isolate_; } + typename Traits::Impl* impl() { return &impl_; } + + static V* FromVal(PersistentContainerValue v) { + return reinterpret_cast(v); + } + + static PersistentContainerValue ClearAndLeak(Global* persistent) { + V* v = persistent->val_; + persistent->val_ = nullptr; + return reinterpret_cast(v); + } + + static PersistentContainerValue Leak(Global* persistent) { + return reinterpret_cast(persistent->val_); + } + + /** + * Return a container value as Global and make sure the weak + * callback is properly disposed of. All remove functionality should go + * through this. + */ + static Global Release(PersistentContainerValue v) { + Global p; + p.val_ = FromVal(v); + if (Traits::kCallbackType != kNotWeak && p.IsWeak()) { + Traits::DisposeCallbackData( + p.template ClearWeak()); + } + return p.Pass(); + } + + void RemoveWeak(const K& key) { + Global p; + p.val_ = FromVal(Traits::Remove(&impl_, key)); + p.Reset(); + } + + void AnnotateStrongRetainer(Global* persistent) { + persistent->AnnotateStrongRetainer(label_); + } + + private: + PersistentValueMapBase(PersistentValueMapBase&); + void operator=(PersistentValueMapBase&); + + static bool SetReturnValueFromVal(ReturnValue* returnValue, + PersistentContainerValue value) { + bool hasValue = value != kPersistentContainerNotFound; + if (hasValue) { + returnValue->SetInternal( + *reinterpret_cast(FromVal(value))); + } + return hasValue; + } + + Isolate* isolate_; + typename Traits::Impl impl_; + const char* label_; +}; + +template +class PersistentValueMap : public PersistentValueMapBase { + public: + explicit PersistentValueMap(Isolate* isolate) + : PersistentValueMapBase(isolate) {} + PersistentValueMap(Isolate* isolate, const char* label) + : PersistentValueMapBase(isolate, label) {} + + typedef + typename PersistentValueMapBase::PersistentValueReference + PersistentValueReference; + + /** + * Put value into map. Depending on Traits::kIsWeak, the value will be held + * by the map strongly or weakly. + * Returns old value as Global. + */ + Global Set(const K& key, Local value) { + Global persistent(this->isolate(), value); + return SetUnique(key, &persistent); + } + + /** + * Put value into map, like Set(const K&, Local). + */ + Global Set(const K& key, Global value) { + return SetUnique(key, &value); + } + + /** + * Put the value into the map, and set the 'weak' callback when demanded + * by the Traits class. + */ + Global SetUnique(const K& key, Global* persistent) { + if (Traits::kCallbackType == kNotWeak) { + this->AnnotateStrongRetainer(persistent); + } else { + WeakCallbackType callback_type = + Traits::kCallbackType == kWeakWithInternalFields + ? WeakCallbackType::kInternalFields + : WeakCallbackType::kParameter; + Local value(Local::New(this->isolate(), *persistent)); + persistent->template SetWeak( + Traits::WeakCallbackParameter(this, key, value), WeakCallback, + callback_type); + } + PersistentContainerValue old_value = + Traits::Set(this->impl(), key, this->ClearAndLeak(persistent)); + return this->Release(old_value).Pass(); + } + + /** + * Put a value into the map and update the reference. + * Restrictions of GetReference apply here as well. + */ + Global Set(const K& key, Global value, + PersistentValueReference* reference) { + *reference = this->Leak(&value); + return SetUnique(key, &value); + } + + private: + static void WeakCallback( + const WeakCallbackInfo& data) { + if (Traits::kCallbackType != kNotWeak) { + PersistentValueMap* persistentValueMap = + Traits::MapFromWeakCallbackInfo(data); + K key = Traits::KeyFromWeakCallbackInfo(data); + Traits::Dispose(data.GetIsolate(), + persistentValueMap->Remove(key).Pass(), key); + Traits::DisposeCallbackData(data.GetParameter()); + } + } +}; + + +template +class GlobalValueMap : public PersistentValueMapBase { + public: + explicit GlobalValueMap(Isolate* isolate) + : PersistentValueMapBase(isolate) {} + GlobalValueMap(Isolate* isolate, const char* label) + : PersistentValueMapBase(isolate, label) {} + + typedef + typename PersistentValueMapBase::PersistentValueReference + PersistentValueReference; + + /** + * Put value into map. Depending on Traits::kIsWeak, the value will be held + * by the map strongly or weakly. + * Returns old value as Global. + */ + Global Set(const K& key, Local value) { + Global persistent(this->isolate(), value); + return SetUnique(key, &persistent); + } + + /** + * Put value into map, like Set(const K&, Local). + */ + Global Set(const K& key, Global value) { + return SetUnique(key, &value); + } + + /** + * Put the value into the map, and set the 'weak' callback when demanded + * by the Traits class. + */ + Global SetUnique(const K& key, Global* persistent) { + if (Traits::kCallbackType == kNotWeak) { + this->AnnotateStrongRetainer(persistent); + } else { + WeakCallbackType callback_type = + Traits::kCallbackType == kWeakWithInternalFields + ? WeakCallbackType::kInternalFields + : WeakCallbackType::kParameter; + Local value(Local::New(this->isolate(), *persistent)); + persistent->template SetWeak( + Traits::WeakCallbackParameter(this, key, value), OnWeakCallback, + callback_type); + } + PersistentContainerValue old_value = + Traits::Set(this->impl(), key, this->ClearAndLeak(persistent)); + return this->Release(old_value).Pass(); + } + + /** + * Put a value into the map and update the reference. + * Restrictions of GetReference apply here as well. + */ + Global Set(const K& key, Global value, + PersistentValueReference* reference) { + *reference = this->Leak(&value); + return SetUnique(key, &value); + } + + private: + static void OnWeakCallback( + const WeakCallbackInfo& data) { + if (Traits::kCallbackType != kNotWeak) { + auto map = Traits::MapFromWeakCallbackInfo(data); + K key = Traits::KeyFromWeakCallbackInfo(data); + map->RemoveWeak(key); + Traits::OnWeakCallback(data); + data.SetSecondPassCallback(SecondWeakCallback); + } + } + + static void SecondWeakCallback( + const WeakCallbackInfo& data) { + Traits::DisposeWeak(data); + } +}; + + +/** + * A map that uses Global as value and std::map as the backing + * implementation. Persistents are held non-weak. + * + * C++11 embedders don't need this class, as they can use + * Global directly in std containers. + */ +template > +class StdPersistentValueMap : public PersistentValueMap { + public: + explicit StdPersistentValueMap(Isolate* isolate) + : PersistentValueMap(isolate) {} +}; + + +/** + * A map that uses Global as value and std::map as the backing + * implementation. Globals are held non-weak. + * + * C++11 embedders don't need this class, as they can use + * Global directly in std containers. + */ +template > +class StdGlobalValueMap : public GlobalValueMap { + public: + explicit StdGlobalValueMap(Isolate* isolate) + : GlobalValueMap(isolate) {} +}; + + +class DefaultPersistentValueVectorTraits { + public: + typedef std::vector Impl; + + static void Append(Impl* impl, PersistentContainerValue value) { + impl->push_back(value); + } + static bool IsEmpty(const Impl* impl) { + return impl->empty(); + } + static size_t Size(const Impl* impl) { + return impl->size(); + } + static PersistentContainerValue Get(const Impl* impl, size_t i) { + return (i < impl->size()) ? impl->at(i) : kPersistentContainerNotFound; + } + static void ReserveCapacity(Impl* impl, size_t capacity) { + impl->reserve(capacity); + } + static void Clear(Impl* impl) { + impl->clear(); + } +}; + + +/** + * A vector wrapper that safely stores Global values. + * C++11 embedders don't need this class, as they can use Global + * directly in std containers. + * + * This class relies on a backing vector implementation, whose type and methods + * are described by the Traits class. The backing map will handle values of type + * PersistentContainerValue, with all conversion into and out of V8 + * handles being transparently handled by this class. + */ +template +class PersistentValueVector { + public: + explicit PersistentValueVector(Isolate* isolate) : isolate_(isolate) { } + + ~PersistentValueVector() { + Clear(); + } + + /** + * Append a value to the vector. + */ + void Append(Local value) { + Global persistent(isolate_, value); + Traits::Append(&impl_, ClearAndLeak(&persistent)); + } + + /** + * Append a persistent's value to the vector. + */ + void Append(Global persistent) { + Traits::Append(&impl_, ClearAndLeak(&persistent)); + } + + /** + * Are there any values in the vector? + */ + bool IsEmpty() const { + return Traits::IsEmpty(&impl_); + } + + /** + * How many elements are in the vector? + */ + size_t Size() const { + return Traits::Size(&impl_); + } + + /** + * Retrieve the i-th value in the vector. + */ + Local Get(size_t index) const { + return Local::New(isolate_, FromVal(Traits::Get(&impl_, index))); + } + + /** + * Remove all elements from the vector. + */ + void Clear() { + size_t length = Traits::Size(&impl_); + for (size_t i = 0; i < length; i++) { + Global p; + p.val_ = FromVal(Traits::Get(&impl_, i)); + } + Traits::Clear(&impl_); + } + + /** + * Reserve capacity in the vector. + * (Efficiency gains depend on the backing implementation.) + */ + void ReserveCapacity(size_t capacity) { + Traits::ReserveCapacity(&impl_, capacity); + } + + private: + static PersistentContainerValue ClearAndLeak(Global* persistent) { + V* v = persistent->val_; + persistent->val_ = nullptr; + return reinterpret_cast(v); + } + + static V* FromVal(PersistentContainerValue v) { + return reinterpret_cast(v); + } + + Isolate* isolate_; + typename Traits::Impl impl_; +}; + +} // namespace v8 + +#endif // V8_UTIL_H diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-value-serializer-version.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-value-serializer-version.h new file mode 100644 index 00000000000..c72911c64dc --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-value-serializer-version.h @@ -0,0 +1,24 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** + * Compile-time constants. + * + * This header provides access to information about the value serializer at + * compile time, without declaring or defining any symbols that require linking + * to V8. + */ + +#ifndef INCLUDE_V8_VALUE_SERIALIZER_VERSION_H_ +#define INCLUDE_V8_VALUE_SERIALIZER_VERSION_H_ + +#include + +namespace v8 { + +constexpr uint32_t CurrentValueSerializerFormatVersion() { return 13; } + +} // namespace v8 + +#endif // INCLUDE_V8_VALUE_SERIALIZER_VERSION_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-version-string.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-version-string.h new file mode 100644 index 00000000000..8faed2a7405 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-version-string.h @@ -0,0 +1,38 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_VERSION_STRING_H_ +#define V8_VERSION_STRING_H_ + +#include "v8-version.h" // NOLINT(build/include_directory) + +// This is here rather than v8-version.h to keep that file simple and +// machine-processable. + +#if V8_IS_CANDIDATE_VERSION +#define V8_CANDIDATE_STRING " (candidate)" +#else +#define V8_CANDIDATE_STRING "" +#endif + +#ifndef V8_EMBEDDER_STRING +#define V8_EMBEDDER_STRING "" +#endif + +#define V8_SX(x) #x +#define V8_S(x) V8_SX(x) + +#if V8_PATCH_LEVEL > 0 +#define V8_VERSION_STRING \ + V8_S(V8_MAJOR_VERSION) \ + "." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) "." V8_S( \ + V8_PATCH_LEVEL) V8_EMBEDDER_STRING V8_CANDIDATE_STRING +#else +#define V8_VERSION_STRING \ + V8_S(V8_MAJOR_VERSION) \ + "." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) \ + V8_EMBEDDER_STRING V8_CANDIDATE_STRING +#endif + +#endif // V8_VERSION_STRING_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-version.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-version.h new file mode 100644 index 00000000000..7f77900fb9b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-version.h @@ -0,0 +1,20 @@ +// Copyright 2015 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_INCLUDE_VERSION_H_ // V8_VERSION_H_ conflicts with src/version.h +#define V8_INCLUDE_VERSION_H_ + +// These macros define the version number for the current version. +// NOTE these macros are used by some of the tool scripts and the build +// system so their names cannot be changed without changing the scripts. +#define V8_MAJOR_VERSION 9 +#define V8_MINOR_VERSION 4 +#define V8_BUILD_NUMBER 146 +#define V8_PATCH_LEVEL 26 + +// Use 1 for candidates and 0 otherwise. +// (Boolean macro values are not supported by all preprocessors.) +#define V8_IS_CANDIDATE_VERSION 0 + +#endif // V8_INCLUDE_VERSION_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-wasm-trap-handler-posix.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-wasm-trap-handler-posix.h new file mode 100644 index 00000000000..9b8e8a5b496 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-wasm-trap-handler-posix.h @@ -0,0 +1,31 @@ +// Copyright 2018 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_WASM_TRAP_HANDLER_POSIX_H_ +#define V8_WASM_TRAP_HANDLER_POSIX_H_ + +#include + +#include "v8config.h" // NOLINT(build/include_directory) + +namespace v8 { +/** + * This function determines whether a memory access violation has been an + * out-of-bounds memory access in WebAssembly. If so, it will modify the context + * parameter and add a return address where the execution can continue after the + * signal handling, and return true. Otherwise, false will be returned. + * + * The parameters to this function correspond to those passed to a Posix signal + * handler. Use this function only on Linux and Mac. + * + * \param sig_code The signal code, e.g. SIGSEGV. + * \param info A pointer to the siginfo_t struct provided to the signal handler. + * \param context A pointer to a ucontext_t struct provided to the signal + * handler. + */ +V8_EXPORT bool TryHandleWebAssemblyTrapPosix(int sig_code, siginfo_t* info, + void* context); + +} // namespace v8 +#endif // V8_WASM_TRAP_HANDLER_POSIX_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-wasm-trap-handler-win.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-wasm-trap-handler-win.h new file mode 100644 index 00000000000..9d3cad58483 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8-wasm-trap-handler-win.h @@ -0,0 +1,28 @@ +// Copyright 2018 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_WASM_TRAP_HANDLER_WIN_H_ +#define V8_WASM_TRAP_HANDLER_WIN_H_ + +#include + +#include "v8config.h" // NOLINT(build/include_directory) + +namespace v8 { +/** + * This function determines whether a memory access violation has been an + * out-of-bounds memory access in WebAssembly. If so, it will modify the + * exception parameter and add a return address where the execution can continue + * after the exception handling, and return true. Otherwise the return value + * will be false. + * + * The parameter to this function corresponds to the one passed to a Windows + * vectored exception handler. Use this function only on Windows. + * + * \param exception An EXCEPTION_POINTERS* as provided to the exception handler. + */ +V8_EXPORT bool TryHandleWebAssemblyTrapWindows(EXCEPTION_POINTERS* exception); + +} // namespace v8 +#endif // V8_WASM_TRAP_HANDLER_WIN_H_ diff --git a/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8.h b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8.h new file mode 100644 index 00000000000..eacdaae7f56 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/libv8-node-16.19.0.1-arm64-darwin/vendor/v8/include/v8.h @@ -0,0 +1,12652 @@ +// Copyright 2012 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/** \mainpage V8 API Reference Guide + * + * V8 is Google's open source JavaScript engine. + * + * This set of documents provides reference material generated from the + * V8 header file, include/v8.h. + * + * For other documentation see https://v8.dev/. + */ + +#ifndef INCLUDE_V8_H_ +#define INCLUDE_V8_H_ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "cppgc/common.h" +#include "v8-internal.h" // NOLINT(build/include_directory) +#include "v8-version.h" // NOLINT(build/include_directory) +#include "v8config.h" // NOLINT(build/include_directory) + +// We reserve the V8_* prefix for macros defined in V8 public API and +// assume there are no name conflicts with the embedder's code. + +/** + * The v8 JavaScript engine. + */ +namespace v8 { + +class AccessorSignature; +class Array; +class ArrayBuffer; +class BigInt; +class BigIntObject; +class Boolean; +class BooleanObject; +class CFunction; +class CallHandlerHelper; +class Context; +class CppHeap; +class CTypeInfo; +class Data; +class Date; +class EscapableHandleScope; +class External; +class Function; +class FunctionTemplate; +class HeapProfiler; +class ImplementationUtilities; +class Int32; +class Integer; +class Isolate; +class Isolate; +class MicrotaskQueue; +class Name; +class Number; +class NumberObject; +class Object; +class ObjectOperationDescriptor; +class ObjectTemplate; +class Platform; +class Primitive; +class PrimitiveArray; +class Private; +class Promise; +class PropertyDescriptor; +class Proxy; +class RawOperationDescriptor; +class Script; +class SharedArrayBuffer; +class Signature; +class StackFrame; +class StackTrace; +class StartupData; +class String; +class StringObject; +class Symbol; +class SymbolObject; +class TracedReferenceBase; +class Uint32; +class Utils; +class Value; +class WasmMemoryObject; +class WasmModuleObject; +template +class GlobalValueMap; +template +class PersistentValueMapBase; +template class NonCopyablePersistentTraits; +template > +class Persistent; +template +class BasicTracedReference; +template +class Eternal; +template +class Global; +template +class Local; +template +class Maybe; +template +class MaybeLocal; +template +class TracedGlobal; +template +class TracedReference; +template class PersistentValueMap; +template class WeakCallbackObject; +template +class PersistentBase; +template +class PersistentValueVector; +template class FunctionCallbackInfo; +template class PropertyCallbackInfo; +template class ReturnValue; + +namespace internal { +class BasicTracedReferenceExtractor; +class ExternalString; +class FunctionCallbackArguments; +class GlobalHandles; +class Heap; +class HeapObject; +class Isolate; +class LocalEmbedderHeapTracer; +class MicrotaskQueue; +class PropertyCallbackArguments; +class ReadOnlyHeap; +class ScopedExternalStringLock; +class ThreadLocalTop; +struct ScriptStreamingData; +enum class ArgumentsType; +template +class Arguments; +template +class CustomArguments; + +namespace wasm { +class NativeModule; +class StreamingDecoder; +} // namespace wasm + +} // namespace internal + +namespace metrics { +class Recorder; +} // namespace metrics + +namespace debug { +class ConsoleCallArguments; +} // namespace debug + +// --- Handles --- + +/** + * An object reference managed by the v8 garbage collector. + * + * All objects returned from v8 have to be tracked by the garbage + * collector so that it knows that the objects are still alive. Also, + * because the garbage collector may move objects, it is unsafe to + * point directly to an object. Instead, all objects are stored in + * handles which are known by the garbage collector and updated + * whenever an object moves. Handles should always be passed by value + * (except in cases like out-parameters) and they should never be + * allocated on the heap. + * + * There are two types of handles: local and persistent handles. + * + * Local handles are light-weight and transient and typically used in + * local operations. They are managed by HandleScopes. That means that a + * HandleScope must exist on the stack when they are created and that they are + * only valid inside of the HandleScope active during their creation. + * For passing a local handle to an outer HandleScope, an EscapableHandleScope + * and its Escape() method must be used. + * + * Persistent handles can be used when storing objects across several + * independent operations and have to be explicitly deallocated when they're no + * longer used. + * + * It is safe to extract the object stored in the handle by + * dereferencing the handle (for instance, to extract the Object* from + * a Local); the value will still be governed by a handle + * behind the scenes and the same rules apply to these values as to + * their handles. + */ +template +class Local { + public: + V8_INLINE Local() : val_(nullptr) {} + template + V8_INLINE Local(Local that) + : val_(reinterpret_cast(*that)) { + /** + * This check fails when trying to convert between incompatible + * handles. For example, converting from a Local to a + * Local. + */ + static_assert(std::is_base_of::value, "type check"); + } + + /** + * Returns true if the handle is empty. + */ + V8_INLINE bool IsEmpty() const { return val_ == nullptr; } + + /** + * Sets the handle to be empty. IsEmpty() will then return true. + */ + V8_INLINE void Clear() { val_ = nullptr; } + + V8_INLINE T* operator->() const { return val_; } + + V8_INLINE T* operator*() const { return val_; } + + /** + * Checks whether two handles are the same. + * Returns true if both are empty, or if the objects to which they refer + * are identical. + * + * If both handles refer to JS objects, this is the same as strict equality. + * For primitives, such as numbers or strings, a `false` return value does not + * indicate that the values aren't equal in the JavaScript sense. + * Use `Value::StrictEquals()` to check primitives for equality. + */ + template + V8_INLINE bool operator==(const Local& that) const { + internal::Address* a = reinterpret_cast(this->val_); + internal::Address* b = reinterpret_cast(that.val_); + if (a == nullptr) return b == nullptr; + if (b == nullptr) return false; + return *a == *b; + } + + template V8_INLINE bool operator==( + const PersistentBase& that) const { + internal::Address* a = reinterpret_cast(this->val_); + internal::Address* b = reinterpret_cast(that.val_); + if (a == nullptr) return b == nullptr; + if (b == nullptr) return false; + return *a == *b; + } + + /** + * Checks whether two handles are different. + * Returns true if only one of the handles is empty, or if + * the objects to which they refer are different. + * + * If both handles refer to JS objects, this is the same as strict + * non-equality. For primitives, such as numbers or strings, a `true` return + * value does not indicate that the values aren't equal in the JavaScript + * sense. Use `Value::StrictEquals()` to check primitives for equality. + */ + template + V8_INLINE bool operator!=(const Local& that) const { + return !operator==(that); + } + + template V8_INLINE bool operator!=( + const Persistent& that) const { + return !operator==(that); + } + + /** + * Cast a handle to a subclass, e.g. Local to Local. + * This is only valid if the handle actually refers to a value of the + * target type. + */ + template V8_INLINE static Local Cast(Local that) { +#ifdef V8_ENABLE_CHECKS + // If we're going to perform the type check then we have to check + // that the handle isn't empty before doing the checked cast. + if (that.IsEmpty()) return Local(); +#endif + return Local(T::Cast(*that)); + } + + /** + * Calling this is equivalent to Local::Cast(). + * In particular, this is only valid if the handle actually refers to a value + * of the target type. + */ + template + V8_INLINE Local As() const { + return Local::Cast(*this); + } + + /** + * Create a local handle for the content of another handle. + * The referee is kept alive by the local handle even when + * the original handle is destroyed/disposed. + */ + V8_INLINE static Local New(Isolate* isolate, Local that); + V8_INLINE static Local New(Isolate* isolate, + const PersistentBase& that); + V8_INLINE static Local New(Isolate* isolate, + const BasicTracedReference& that); + + private: + friend class TracedReferenceBase; + friend class Utils; + template friend class Eternal; + template friend class PersistentBase; + template friend class Persistent; + template friend class Local; + template + friend class MaybeLocal; + template friend class FunctionCallbackInfo; + template friend class PropertyCallbackInfo; + friend class String; + friend class Object; + friend class Context; + friend class Isolate; + friend class Private; + template friend class internal::CustomArguments; + friend Local Undefined(Isolate* isolate); + friend Local Null(Isolate* isolate); + friend Local True(Isolate* isolate); + friend Local False(Isolate* isolate); + friend class HandleScope; + friend class EscapableHandleScope; + template + friend class PersistentValueMapBase; + template friend class PersistentValueVector; + template + friend class ReturnValue; + template + friend class Traced; + template + friend class TracedGlobal; + template + friend class BasicTracedReference; + template + friend class TracedReference; + + explicit V8_INLINE Local(T* that) : val_(that) {} + V8_INLINE static Local New(Isolate* isolate, T* that); + T* val_; +}; + + +#if !defined(V8_IMMINENT_DEPRECATION_WARNINGS) +// Handle is an alias for Local for historical reasons. +template +using Handle = Local; +#endif + + +/** + * A MaybeLocal<> is a wrapper around Local<> that enforces a check whether + * the Local<> is empty before it can be used. + * + * If an API method returns a MaybeLocal<>, the API method can potentially fail + * either because an exception is thrown, or because an exception is pending, + * e.g. because a previous API call threw an exception that hasn't been caught + * yet, or because a TerminateExecution exception was thrown. In that case, an + * empty MaybeLocal is returned. + */ +template +class MaybeLocal { + public: + V8_INLINE MaybeLocal() : val_(nullptr) {} + template + V8_INLINE MaybeLocal(Local that) + : val_(reinterpret_cast(*that)) { + static_assert(std::is_base_of::value, "type check"); + } + + V8_INLINE bool IsEmpty() const { return val_ == nullptr; } + + /** + * Converts this MaybeLocal<> to a Local<>. If this MaybeLocal<> is empty, + * |false| is returned and |out| is left untouched. + */ + template + V8_WARN_UNUSED_RESULT V8_INLINE bool ToLocal(Local* out) const { + out->val_ = IsEmpty() ? nullptr : this->val_; + return !IsEmpty(); + } + + /** + * Converts this MaybeLocal<> to a Local<>. If this MaybeLocal<> is empty, + * V8 will crash the process. + */ + V8_INLINE Local ToLocalChecked(); + + /** + * Converts this MaybeLocal<> to a Local<>, using a default value if this + * MaybeLocal<> is empty. + */ + template + V8_INLINE Local FromMaybe(Local default_value) const { + return IsEmpty() ? default_value : Local(val_); + } + + private: + T* val_; +}; + +/** + * Eternal handles are set-once handles that live for the lifetime of the + * isolate. + */ +template class Eternal { + public: + V8_INLINE Eternal() : val_(nullptr) {} + template + V8_INLINE Eternal(Isolate* isolate, Local handle) : val_(nullptr) { + Set(isolate, handle); + } + // Can only be safely called if already set. + V8_INLINE Local Get(Isolate* isolate) const; + V8_INLINE bool IsEmpty() const { return val_ == nullptr; } + template V8_INLINE void Set(Isolate* isolate, Local handle); + + private: + T* val_; +}; + + +static const int kInternalFieldsInWeakCallback = 2; +static const int kEmbedderFieldsInWeakCallback = 2; + +template +class WeakCallbackInfo { + public: + using Callback = void (*)(const WeakCallbackInfo& data); + + WeakCallbackInfo(Isolate* isolate, T* parameter, + void* embedder_fields[kEmbedderFieldsInWeakCallback], + Callback* callback) + : isolate_(isolate), parameter_(parameter), callback_(callback) { + for (int i = 0; i < kEmbedderFieldsInWeakCallback; ++i) { + embedder_fields_[i] = embedder_fields[i]; + } + } + + V8_INLINE Isolate* GetIsolate() const { return isolate_; } + V8_INLINE T* GetParameter() const { return parameter_; } + V8_INLINE void* GetInternalField(int index) const; + + // When first called, the embedder MUST Reset() the Global which triggered the + // callback. The Global itself is unusable for anything else. No v8 other api + // calls may be called in the first callback. Should additional work be + // required, the embedder must set a second pass callback, which will be + // called after all the initial callbacks are processed. + // Calling SetSecondPassCallback on the second pass will immediately crash. + void SetSecondPassCallback(Callback callback) const { *callback_ = callback; } + + private: + Isolate* isolate_; + T* parameter_; + Callback* callback_; + void* embedder_fields_[kEmbedderFieldsInWeakCallback]; +}; + + +// kParameter will pass a void* parameter back to the callback, kInternalFields +// will pass the first two internal fields back to the callback, kFinalizer +// will pass a void* parameter back, but is invoked before the object is +// actually collected, so it can be resurrected. In the last case, it is not +// possible to request a second pass callback. +enum class WeakCallbackType { kParameter, kInternalFields, kFinalizer }; + +/** + * An object reference that is independent of any handle scope. Where + * a Local handle only lives as long as the HandleScope in which it was + * allocated, a PersistentBase handle remains valid until it is explicitly + * disposed using Reset(). + * + * A persistent handle contains a reference to a storage cell within + * the V8 engine which holds an object value and which is updated by + * the garbage collector whenever the object is moved. A new storage + * cell can be created using the constructor or PersistentBase::Reset and + * existing handles can be disposed using PersistentBase::Reset. + * + */ +template class PersistentBase { + public: + /** + * If non-empty, destroy the underlying storage cell + * IsEmpty() will return true after this call. + */ + V8_INLINE void Reset(); + /** + * If non-empty, destroy the underlying storage cell + * and create a new one with the contents of other if other is non empty + */ + template + V8_INLINE void Reset(Isolate* isolate, const Local& other); + + /** + * If non-empty, destroy the underlying storage cell + * and create a new one with the contents of other if other is non empty + */ + template + V8_INLINE void Reset(Isolate* isolate, const PersistentBase& other); + + V8_INLINE bool IsEmpty() const { return val_ == nullptr; } + V8_INLINE void Empty() { val_ = 0; } + + V8_INLINE Local Get(Isolate* isolate) const { + return Local::New(isolate, *this); + } + + template + V8_INLINE bool operator==(const PersistentBase& that) const { + internal::Address* a = reinterpret_cast(this->val_); + internal::Address* b = reinterpret_cast(that.val_); + if (a == nullptr) return b == nullptr; + if (b == nullptr) return false; + return *a == *b; + } + + template + V8_INLINE bool operator==(const Local& that) const { + internal::Address* a = reinterpret_cast(this->val_); + internal::Address* b = reinterpret_cast(that.val_); + if (a == nullptr) return b == nullptr; + if (b == nullptr) return false; + return *a == *b; + } + + template + V8_INLINE bool operator!=(const PersistentBase& that) const { + return !operator==(that); + } + + template + V8_INLINE bool operator!=(const Local& that) const { + return !operator==(that); + } + + /** + * Install a finalization callback on this object. + * NOTE: There is no guarantee as to *when* or even *if* the callback is + * invoked. The invocation is performed solely on a best effort basis. + * As always, GC-based finalization should *not* be relied upon for any + * critical form of resource management! + * + * The callback is supposed to reset the handle. No further V8 API may be + * called in this callback. In case additional work involving V8 needs to be + * done, a second callback can be scheduled using + * WeakCallbackInfo::SetSecondPassCallback. + */ + template + V8_INLINE void SetWeak(P* parameter, + typename WeakCallbackInfo

      ::Callback callback, + WeakCallbackType type); + + /** + * Turns this handle into a weak phantom handle without finalization callback. + * The handle will be reset automatically when the garbage collector detects + * that the object is no longer reachable. + * A related function Isolate::NumberOfPhantomHandleResetsSinceLastCall + * returns how many phantom handles were reset by the garbage collector. + */ + V8_INLINE void SetWeak(); + + template + V8_INLINE P* ClearWeak(); + + // TODO(dcarney): remove this. + V8_INLINE void ClearWeak() { ClearWeak(); } + + /** + * Annotates the strong handle with the given label, which is then used by the + * heap snapshot generator as a name of the edge from the root to the handle. + * The function does not take ownership of the label and assumes that the + * label is valid as long as the handle is valid. + */ + V8_INLINE void AnnotateStrongRetainer(const char* label); + + /** Returns true if the handle's reference is weak. */ + V8_INLINE bool IsWeak() const; + + /** + * Assigns a wrapper class ID to the handle. + */ + V8_INLINE void SetWrapperClassId(uint16_t class_id); + + /** + * Returns the class ID previously assigned to this handle or 0 if no class ID + * was previously assigned. + */ + V8_INLINE uint16_t WrapperClassId() const; + + PersistentBase(const PersistentBase& other) = delete; + void operator=(const PersistentBase&) = delete; + + private: + friend class Isolate; + friend class Utils; + template friend class Local; + template friend class Persistent; + template + friend class Global; + template friend class PersistentBase; + template friend class ReturnValue; + template + friend class PersistentValueMapBase; + template friend class PersistentValueVector; + friend class Object; + + explicit V8_INLINE PersistentBase(T* val) : val_(val) {} + V8_INLINE static T* New(Isolate* isolate, T* that); + + T* val_; +}; + + +/** + * Default traits for Persistent. This class does not allow + * use of the copy constructor or assignment operator. + * At present kResetInDestructor is not set, but that will change in a future + * version. + */ +template +class NonCopyablePersistentTraits { + public: + using NonCopyablePersistent = Persistent>; + static const bool kResetInDestructor = false; + template + V8_INLINE static void Copy(const Persistent& source, + NonCopyablePersistent* dest) { + static_assert(sizeof(S) < 0, + "NonCopyablePersistentTraits::Copy is not instantiable"); + } +}; + + +/** + * Helper class traits to allow copying and assignment of Persistent. + * This will clone the contents of storage cell, but not any of the flags, etc. + */ +template +struct CopyablePersistentTraits { + using CopyablePersistent = Persistent>; + static const bool kResetInDestructor = true; + template + static V8_INLINE void Copy(const Persistent& source, + CopyablePersistent* dest) { + // do nothing, just allow copy + } +}; + + +/** + * A PersistentBase which allows copy and assignment. + * + * Copy, assignment and destructor behavior is controlled by the traits + * class M. + * + * Note: Persistent class hierarchy is subject to future changes. + */ +template class Persistent : public PersistentBase { + public: + /** + * A Persistent with no storage cell. + */ + V8_INLINE Persistent() : PersistentBase(nullptr) {} + /** + * Construct a Persistent from a Local. + * When the Local is non-empty, a new storage cell is created + * pointing to the same object, and no flags are set. + */ + template + V8_INLINE Persistent(Isolate* isolate, Local that) + : PersistentBase(PersistentBase::New(isolate, *that)) { + static_assert(std::is_base_of::value, "type check"); + } + /** + * Construct a Persistent from a Persistent. + * When the Persistent is non-empty, a new storage cell is created + * pointing to the same object, and no flags are set. + */ + template + V8_INLINE Persistent(Isolate* isolate, const Persistent& that) + : PersistentBase(PersistentBase::New(isolate, *that)) { + static_assert(std::is_base_of::value, "type check"); + } + /** + * The copy constructors and assignment operator create a Persistent + * exactly as the Persistent constructor, but the Copy function from the + * traits class is called, allowing the setting of flags based on the + * copied Persistent. + */ + V8_INLINE Persistent(const Persistent& that) : PersistentBase(nullptr) { + Copy(that); + } + template + V8_INLINE Persistent(const Persistent& that) : PersistentBase(0) { + Copy(that); + } + V8_INLINE Persistent& operator=(const Persistent& that) { + Copy(that); + return *this; + } + template + V8_INLINE Persistent& operator=(const Persistent& that) { + Copy(that); + return *this; + } + /** + * The destructor will dispose the Persistent based on the + * kResetInDestructor flags in the traits class. Since not calling dispose + * can result in a memory leak, it is recommended to always set this flag. + */ + V8_INLINE ~Persistent() { + if (M::kResetInDestructor) this->Reset(); + } + + // TODO(dcarney): this is pretty useless, fix or remove + template + V8_INLINE static Persistent& Cast(const Persistent& that) { +#ifdef V8_ENABLE_CHECKS + // If we're going to perform the type check then we have to check + // that the handle isn't empty before doing the checked cast. + if (!that.IsEmpty()) T::Cast(*that); +#endif + return reinterpret_cast&>(const_cast&>(that)); + } + + // TODO(dcarney): this is pretty useless, fix or remove + template + V8_INLINE Persistent& As() const { + return Persistent::Cast(*this); + } + + private: + friend class Isolate; + friend class Utils; + template friend class Local; + template friend class Persistent; + template friend class ReturnValue; + + explicit V8_INLINE Persistent(T* that) : PersistentBase(that) {} + V8_INLINE T* operator*() const { return this->val_; } + template + V8_INLINE void Copy(const Persistent& that); +}; + + +/** + * A PersistentBase which has move semantics. + * + * Note: Persistent class hierarchy is subject to future changes. + */ +template +class Global : public PersistentBase { + public: + /** + * A Global with no storage cell. + */ + V8_INLINE Global() : PersistentBase(nullptr) {} + + /** + * Construct a Global from a Local. + * When the Local is non-empty, a new storage cell is created + * pointing to the same object, and no flags are set. + */ + template + V8_INLINE Global(Isolate* isolate, Local that) + : PersistentBase(PersistentBase::New(isolate, *that)) { + static_assert(std::is_base_of::value, "type check"); + } + + /** + * Construct a Global from a PersistentBase. + * When the Persistent is non-empty, a new storage cell is created + * pointing to the same object, and no flags are set. + */ + template + V8_INLINE Global(Isolate* isolate, const PersistentBase& that) + : PersistentBase(PersistentBase::New(isolate, that.val_)) { + static_assert(std::is_base_of::value, "type check"); + } + + /** + * Move constructor. + */ + V8_INLINE Global(Global&& other); + + V8_INLINE ~Global() { this->Reset(); } + + /** + * Move via assignment. + */ + template + V8_INLINE Global& operator=(Global&& rhs); + + /** + * Pass allows returning uniques from functions, etc. + */ + Global Pass() { return static_cast(*this); } + + /* + * For compatibility with Chromium's base::Bind (base::Passed). + */ + using MoveOnlyTypeForCPP03 = void; + + Global(const Global&) = delete; + void operator=(const Global&) = delete; + + private: + template + friend class ReturnValue; + V8_INLINE T* operator*() const { return this->val_; } +}; + + +// UniquePersistent is an alias for Global for historical reason. +template +using UniquePersistent = Global; + +/** + * Deprecated. Use |TracedReference| instead. + */ +template +struct TracedGlobalTrait {}; + +class TracedReferenceBase { + public: + /** + * Returns true if the reference is empty, i.e., has not been assigned + * object. + */ + bool IsEmpty() const { return val_ == nullptr; } + + /** + * If non-empty, destroy the underlying storage cell. |IsEmpty| will return + * true after this call. + */ + V8_INLINE void Reset(); + + /** + * Construct a Local from this handle. + */ + V8_INLINE v8::Local Get(v8::Isolate* isolate) const; + + /** + * Returns true if this TracedReference is empty, i.e., has not been + * assigned an object. This version of IsEmpty is thread-safe. + */ + bool IsEmptyThreadSafe() const { + return this->GetSlotThreadSafe() == nullptr; + } + + /** + * Assigns a wrapper class ID to the handle. + */ + V8_INLINE void SetWrapperClassId(uint16_t class_id); + + /** + * Returns the class ID previously assigned to this handle or 0 if no class ID + * was previously assigned. + */ + V8_INLINE uint16_t WrapperClassId() const; + + protected: + /** + * Update this reference in a thread-safe way. + */ + void SetSlotThreadSafe(void* new_val) { + reinterpret_cast*>(&val_)->store( + new_val, std::memory_order_relaxed); + } + + /** + * Get this reference in a thread-safe way + */ + const void* GetSlotThreadSafe() const { + return reinterpret_cast const*>(&val_)->load( + std::memory_order_relaxed); + } + + V8_EXPORT void CheckValue() const; + + // val_ points to a GlobalHandles node. + internal::Address* val_ = nullptr; + + friend class internal::BasicTracedReferenceExtractor; + template + friend class Local; + template + friend bool operator==(const TracedReferenceBase&, const Local&); + friend bool operator==(const TracedReferenceBase&, + const TracedReferenceBase&); +}; + +/** + * A traced handle with copy and move semantics. The handle is to be used + * together with |v8::EmbedderHeapTracer| or as part of GarbageCollected objects + * (see v8-cppgc.h) and specifies edges from C++ objects to JavaScript. + * + * The exact semantics are: + * - Tracing garbage collections use |v8::EmbedderHeapTracer| or cppgc. + * - Non-tracing garbage collections refer to + * |v8::EmbedderRootsHandler::IsRoot()| whether the handle should + * be treated as root or not. + * + * Note that the base class cannot be instantiated itself. Choose from + * - TracedGlobal + * - TracedReference + */ +template +class BasicTracedReference : public TracedReferenceBase { + public: + /** + * Construct a Local from this handle. + */ + Local Get(Isolate* isolate) const { return Local::New(isolate, *this); } + + template + V8_INLINE BasicTracedReference& As() const { + return reinterpret_cast&>( + const_cast&>(*this)); + } + + T* operator->() const { +#ifdef V8_ENABLE_CHECKS + CheckValue(); +#endif // V8_ENABLE_CHECKS + return reinterpret_cast(val_); + } + T* operator*() const { +#ifdef V8_ENABLE_CHECKS + CheckValue(); +#endif // V8_ENABLE_CHECKS + return reinterpret_cast(val_); + } + + private: + enum DestructionMode { kWithDestructor, kWithoutDestructor }; + + /** + * An empty BasicTracedReference without storage cell. + */ + BasicTracedReference() = default; + + V8_INLINE static internal::Address* New(Isolate* isolate, T* that, void* slot, + DestructionMode destruction_mode); + + friend class EmbedderHeapTracer; + template + friend class Local; + friend class Object; + template + friend class TracedGlobal; + template + friend class TracedReference; + template + friend class BasicTracedReference; + template + friend class ReturnValue; +}; + +/** + * A traced handle with destructor that clears the handle. For more details see + * BasicTracedReference. + */ +template +class TracedGlobal : public BasicTracedReference { + public: + using BasicTracedReference::Reset; + + /** + * Destructor resetting the handle.Is + */ + ~TracedGlobal() { this->Reset(); } + + /** + * An empty TracedGlobal without storage cell. + */ + TracedGlobal() : BasicTracedReference() {} + + /** + * Construct a TracedGlobal from a Local. + * + * When the Local is non-empty, a new storage cell is created + * pointing to the same object. + */ + template + TracedGlobal(Isolate* isolate, Local that) : BasicTracedReference() { + this->val_ = this->New(isolate, that.val_, &this->val_, + BasicTracedReference::kWithDestructor); + static_assert(std::is_base_of::value, "type check"); + } + + /** + * Move constructor initializing TracedGlobal from an existing one. + */ + V8_INLINE TracedGlobal(TracedGlobal&& other) { + // Forward to operator=. + *this = std::move(other); + } + + /** + * Move constructor initializing TracedGlobal from an existing one. + */ + template + V8_INLINE TracedGlobal(TracedGlobal&& other) { + // Forward to operator=. + *this = std::move(other); + } + + /** + * Copy constructor initializing TracedGlobal from an existing one. + */ + V8_INLINE TracedGlobal(const TracedGlobal& other) { + // Forward to operator=; + *this = other; + } + + /** + * Copy constructor initializing TracedGlobal from an existing one. + */ + template + V8_INLINE TracedGlobal(const TracedGlobal& other) { + // Forward to operator=; + *this = other; + } + + /** + * Move assignment operator initializing TracedGlobal from an existing one. + */ + V8_INLINE TracedGlobal& operator=(TracedGlobal&& rhs); + + /** + * Move assignment operator initializing TracedGlobal from an existing one. + */ + template + V8_INLINE TracedGlobal& operator=(TracedGlobal&& rhs); + + /** + * Copy assignment operator initializing TracedGlobal from an existing one. + * + * Note: Prohibited when |other| has a finalization callback set through + * |SetFinalizationCallback|. + */ + V8_INLINE TracedGlobal& operator=(const TracedGlobal& rhs); + + /** + * Copy assignment operator initializing TracedGlobal from an existing one. + * + * Note: Prohibited when |other| has a finalization callback set through + * |SetFinalizationCallback|. + */ + template + V8_INLINE TracedGlobal& operator=(const TracedGlobal& rhs); + + /** + * If non-empty, destroy the underlying storage cell and create a new one with + * the contents of other if other is non empty + */ + template + V8_INLINE void Reset(Isolate* isolate, const Local& other); + + template + V8_INLINE TracedGlobal& As() const { + return reinterpret_cast&>( + const_cast&>(*this)); + } + + /** + * Adds a finalization callback to the handle. The type of this callback is + * similar to WeakCallbackType::kInternalFields, i.e., it will pass the + * parameter and the first two internal fields of the object. + * + * The callback is then supposed to reset the handle in the callback. No + * further V8 API may be called in this callback. In case additional work + * involving V8 needs to be done, a second callback can be scheduled using + * WeakCallbackInfo::SetSecondPassCallback. + */ + V8_INLINE void SetFinalizationCallback( + void* parameter, WeakCallbackInfo::Callback callback); +}; + +/** + * A traced handle without destructor that clears the handle. The embedder needs + * to ensure that the handle is not accessed once the V8 object has been + * reclaimed. This can happen when the handle is not passed through the + * EmbedderHeapTracer. For more details see BasicTracedReference. + * + * The reference assumes the embedder has precise knowledge about references at + * all times. In case V8 needs to separately handle on-stack references, the + * embedder is required to set the stack start through + * |EmbedderHeapTracer::SetStackStart|. + */ +template +class TracedReference : public BasicTracedReference { + public: + using BasicTracedReference::Reset; + + /** + * An empty TracedReference without storage cell. + */ + TracedReference() : BasicTracedReference() {} + + /** + * Construct a TracedReference from a Local. + * + * When the Local is non-empty, a new storage cell is created + * pointing to the same object. + */ + template + TracedReference(Isolate* isolate, Local that) : BasicTracedReference() { + this->val_ = this->New(isolate, that.val_, &this->val_, + BasicTracedReference::kWithoutDestructor); + static_assert(std::is_base_of::value, "type check"); + } + + /** + * Move constructor initializing TracedReference from an + * existing one. + */ + V8_INLINE TracedReference(TracedReference&& other) { + // Forward to operator=. + *this = std::move(other); + } + + /** + * Move constructor initializing TracedReference from an + * existing one. + */ + template + V8_INLINE TracedReference(TracedReference&& other) { + // Forward to operator=. + *this = std::move(other); + } + + /** + * Copy constructor initializing TracedReference from an + * existing one. + */ + V8_INLINE TracedReference(const TracedReference& other) { + // Forward to operator=; + *this = other; + } + + /** + * Copy constructor initializing TracedReference from an + * existing one. + */ + template + V8_INLINE TracedReference(const TracedReference& other) { + // Forward to operator=; + *this = other; + } + + /** + * Move assignment operator initializing TracedGlobal from an existing one. + */ + V8_INLINE TracedReference& operator=(TracedReference&& rhs); + + /** + * Move assignment operator initializing TracedGlobal from an existing one. + */ + template + V8_INLINE TracedReference& operator=(TracedReference&& rhs); + + /** + * Copy assignment operator initializing TracedGlobal from an existing one. + */ + V8_INLINE TracedReference& operator=(const TracedReference& rhs); + + /** + * Copy assignment operator initializing TracedGlobal from an existing one. + */ + template + V8_INLINE TracedReference& operator=(const TracedReference& rhs); + + /** + * If non-empty, destroy the underlying storage cell and create a new one with + * the contents of other if other is non empty + */ + template + V8_INLINE void Reset(Isolate* isolate, const Local& other); + + template + V8_INLINE TracedReference& As() const { + return reinterpret_cast&>( + const_cast&>(*this)); + } +}; + + /** + * A stack-allocated class that governs a number of local handles. + * After a handle scope has been created, all local handles will be + * allocated within that handle scope until either the handle scope is + * deleted or another handle scope is created. If there is already a + * handle scope and a new one is created, all allocations will take + * place in the new handle scope until it is deleted. After that, + * new handles will again be allocated in the original handle scope. + * + * After the handle scope of a local handle has been deleted the + * garbage collector will no longer track the object stored in the + * handle and may deallocate it. The behavior of accessing a handle + * for which the handle scope has been deleted is undefined. + */ +class V8_EXPORT V8_NODISCARD HandleScope { + public: + explicit HandleScope(Isolate* isolate); + + ~HandleScope(); + + /** + * Counts the number of allocated handles. + */ + static int NumberOfHandles(Isolate* isolate); + + V8_INLINE Isolate* GetIsolate() const { + return reinterpret_cast(isolate_); + } + + HandleScope(const HandleScope&) = delete; + void operator=(const HandleScope&) = delete; + + protected: + V8_INLINE HandleScope() = default; + + void Initialize(Isolate* isolate); + + static internal::Address* CreateHandle(internal::Isolate* isolate, + internal::Address value); + + private: + // Declaring operator new and delete as deleted is not spec compliant. + // Therefore declare them private instead to disable dynamic alloc + void* operator new(size_t size); + void* operator new[](size_t size); + void operator delete(void*, size_t); + void operator delete[](void*, size_t); + + internal::Isolate* isolate_; + internal::Address* prev_next_; + internal::Address* prev_limit_; + + // Local::New uses CreateHandle with an Isolate* parameter. + template friend class Local; + + // Object::GetInternalField and Context::GetEmbedderData use CreateHandle with + // a HeapObject in their shortcuts. + friend class Object; + friend class Context; +}; + +/** + * A HandleScope which first allocates a handle in the current scope + * which will be later filled with the escape value. + */ +class V8_EXPORT V8_NODISCARD EscapableHandleScope : public HandleScope { + public: + explicit EscapableHandleScope(Isolate* isolate); + V8_INLINE ~EscapableHandleScope() = default; + + /** + * Pushes the value into the previous scope and returns a handle to it. + * Cannot be called twice. + */ + template + V8_INLINE Local Escape(Local value) { + internal::Address* slot = + Escape(reinterpret_cast(*value)); + return Local(reinterpret_cast(slot)); + } + + template + V8_INLINE MaybeLocal EscapeMaybe(MaybeLocal value) { + return Escape(value.FromMaybe(Local())); + } + + EscapableHandleScope(const EscapableHandleScope&) = delete; + void operator=(const EscapableHandleScope&) = delete; + + private: + // Declaring operator new and delete as deleted is not spec compliant. + // Therefore declare them private instead to disable dynamic alloc + void* operator new(size_t size); + void* operator new[](size_t size); + void operator delete(void*, size_t); + void operator delete[](void*, size_t); + + internal::Address* Escape(internal::Address* escape_value); + internal::Address* escape_slot_; +}; + +/** + * A SealHandleScope acts like a handle scope in which no handle allocations + * are allowed. It can be useful for debugging handle leaks. + * Handles can be allocated within inner normal HandleScopes. + */ +class V8_EXPORT V8_NODISCARD SealHandleScope { + public: + explicit SealHandleScope(Isolate* isolate); + ~SealHandleScope(); + + SealHandleScope(const SealHandleScope&) = delete; + void operator=(const SealHandleScope&) = delete; + + private: + // Declaring operator new and delete as deleted is not spec compliant. + // Therefore declare them private instead to disable dynamic alloc + void* operator new(size_t size); + void* operator new[](size_t size); + void operator delete(void*, size_t); + void operator delete[](void*, size_t); + + internal::Isolate* const isolate_; + internal::Address* prev_limit_; + int prev_sealed_level_; +}; + +// --- Special objects --- + +/** + * The superclass of objects that can reside on V8's heap. + */ +class V8_EXPORT Data { + public: + /** + * Returns true if this data is a |v8::Value|. + */ + bool IsValue() const; + + /** + * Returns true if this data is a |v8::Module|. + */ + bool IsModule() const; + + /** + * Returns true if this data is a |v8::Private|. + */ + bool IsPrivate() const; + + /** + * Returns true if this data is a |v8::ObjectTemplate|. + */ + bool IsObjectTemplate() const; + + /** + * Returns true if this data is a |v8::FunctionTemplate|. + */ + bool IsFunctionTemplate() const; + + /** + * Returns true if this data is a |v8::Context|. + */ + bool IsContext() const; + + private: + Data(); +}; + +/** + * A container type that holds relevant metadata for module loading. + * + * This is passed back to the embedder as part of + * HostImportModuleDynamicallyCallback for module loading. + */ +class V8_EXPORT ScriptOrModule { + public: + /** + * The name that was passed by the embedder as ResourceName to the + * ScriptOrigin. This can be either a v8::String or v8::Undefined. + */ + Local GetResourceName(); + + /** + * The options that were passed by the embedder as HostDefinedOptions to + * the ScriptOrigin. + */ + Local GetHostDefinedOptions(); +}; + +/** + * An array to hold Primitive values. This is used by the embedder to + * pass host defined options to the ScriptOptions during compilation. + * + * This is passed back to the embedder as part of + * HostImportModuleDynamicallyCallback for module loading. + * + */ +class V8_EXPORT PrimitiveArray { + public: + static Local New(Isolate* isolate, int length); + int Length() const; + void Set(Isolate* isolate, int index, Local item); + Local Get(Isolate* isolate, int index); +}; + +/** + * The optional attributes of ScriptOrigin. + */ +class ScriptOriginOptions { + public: + V8_INLINE ScriptOriginOptions(bool is_shared_cross_origin = false, + bool is_opaque = false, bool is_wasm = false, + bool is_module = false) + : flags_((is_shared_cross_origin ? kIsSharedCrossOrigin : 0) | + (is_wasm ? kIsWasm : 0) | (is_opaque ? kIsOpaque : 0) | + (is_module ? kIsModule : 0)) {} + V8_INLINE ScriptOriginOptions(int flags) + : flags_(flags & + (kIsSharedCrossOrigin | kIsOpaque | kIsWasm | kIsModule)) {} + + bool IsSharedCrossOrigin() const { + return (flags_ & kIsSharedCrossOrigin) != 0; + } + bool IsOpaque() const { return (flags_ & kIsOpaque) != 0; } + bool IsWasm() const { return (flags_ & kIsWasm) != 0; } + bool IsModule() const { return (flags_ & kIsModule) != 0; } + + int Flags() const { return flags_; } + + private: + enum { + kIsSharedCrossOrigin = 1, + kIsOpaque = 1 << 1, + kIsWasm = 1 << 2, + kIsModule = 1 << 3 + }; + const int flags_; +}; + +/** + * The origin, within a file, of a script. + */ +class ScriptOrigin { + public: +#if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */ + V8_DEPRECATED("Use constructor with primitive C++ types") +#endif + V8_INLINE explicit ScriptOrigin( + Local resource_name, Local resource_line_offset, + Local resource_column_offset, + Local resource_is_shared_cross_origin = Local(), + Local script_id = Local(), + Local source_map_url = Local(), + Local resource_is_opaque = Local(), + Local is_wasm = Local(), + Local is_module = Local(), + Local host_defined_options = Local()); +#if defined(_MSC_VER) && _MSC_VER >= 1910 /* Disable on VS2015 */ + V8_DEPRECATED("Use constructor that takes an isolate") +#endif + V8_INLINE explicit ScriptOrigin( + Local resource_name, int resource_line_offset = 0, + int resource_column_offset = 0, + bool resource_is_shared_cross_origin = false, int script_id = -1, + Local source_map_url = Local(), + bool resource_is_opaque = false, bool is_wasm = false, + bool is_module = false, + Local host_defined_options = Local()); + V8_INLINE explicit ScriptOrigin( + Isolate* isolate, Local resource_name, + int resource_line_offset = 0, int resource_column_offset = 0, + bool resource_is_shared_cross_origin = false, int script_id = -1, + Local source_map_url = Local(), + bool resource_is_opaque = false, bool is_wasm = false, + bool is_module = false, + Local host_defined_options = Local()); + + V8_INLINE Local ResourceName() const; + V8_DEPRECATED("Use getter with primitvie C++ types.") + V8_INLINE Local ResourceLineOffset() const; + V8_DEPRECATED("Use getter with primitvie C++ types.") + V8_INLINE Local ResourceColumnOffset() const; + V8_DEPRECATED("Use getter with primitvie C++ types.") + V8_INLINE Local ScriptID() const; + V8_INLINE int LineOffset() const; + V8_INLINE int ColumnOffset() const; + V8_INLINE int ScriptId() const; + V8_INLINE Local SourceMapUrl() const; + V8_INLINE Local HostDefinedOptions() const; + V8_INLINE ScriptOriginOptions Options() const { return options_; } + + private: + Isolate* isolate_; + Local resource_name_; + int resource_line_offset_; + int resource_column_offset_; + ScriptOriginOptions options_; + int script_id_; + Local source_map_url_; + Local host_defined_options_; +}; + +/** + * A compiled JavaScript script, not yet tied to a Context. + */ +class V8_EXPORT UnboundScript { + public: + /** + * Binds the script to the currently entered context. + */ + Local + + + + """ + + Scenario: Rendering inline js with a passthrough minifier + Given a fixture app "passthrough-app" + And a file named "config.rb" with: + """ + module ::PassThrough + def self.compress(data) + data + end + end + + activate :minify_javascript, inline: true, compressor: ::PassThrough + + page "/inline-js.html", layout: false + """ + And the Server is running at "passthrough-app" + When I go to "/inline-js.html" + Then I should see: + """ + + + + + """ + + Scenario: Rendering inline JS with a passthrough minifier using activate-style compressor + Given a fixture app "passthrough-app" + And a file named "config.rb" with: + """ + module ::HelloCompressor + def self.compress(data) + "Hello" + end + end + + activate :minify_javascript, inline: true, compressor: ::HelloCompressor + + page "/inline-js.html", layout: false + """ + And the Server is running at "passthrough-app" + When I go to "/inline-js.html" + Then I should see: + """ + + + + + """ + + Scenario: Rendering inline js with the feature enabled + Given a fixture app "minify-js-app" + And a file named "config.rb" with: + """ + activate :minify_javascript, inline: true + """ + And the Server is running at "minify-js-app" + When I go to "/inline-js.html" + Then I should see: + """ + + + + + """ + + Scenario: Rendering inline js in a PHP document + Given a fixture app "minify-js-app" + And a file named "config.rb" with: + """ + activate :minify_javascript, inline: true + """ + And the Server is running at "minify-js-app" + When I go to "/inline-js.php" + Then I should see: + """ + + + + + + """ + + Scenario: Rendering inline js in a proxied resource + Given a fixture app "minify-js-app" + And a file named "config.rb" with: + """ + activate :minify_javascript, inline: true + proxy '/inline-js-proxy', '/inline-js.html', ignore: true + """ + And the Server is running at "minify-js-app" + When I go to "/inline-js-proxy" + Then I should see "14" lines + + Scenario: Rendering external js with the feature enabled + Given a fixture app "minify-js-app" + And a file named "config.rb" with: + """ + activate :minify_javascript + """ + And the Server is running at "minify-js-app" + When I go to "/javascripts/js_test.js" + Then I should see "1" lines + When I go to "/more-js/other.js" + Then I should see "1" lines + + Scenario: Rendering external js in a proxied resource + Given a fixture app "minify-js-app" + And a file named "config.rb" with: + """ + activate :minify_javascript + proxy '/js-proxy', '/javascripts/js_test.js', ignore: true + """ + And the Server is running at "minify-js-app" + When I go to "/js-proxy" + Then I should see "1" lines + + Scenario: Rendering external js with a passthrough minifier + And the Server is running at "passthrough-app" + When I go to "/javascripts/js_test.js" + Then I should see "8" lines + + Scenario: Rendering inline js (coffeescript) with the feature enabled + Given a fixture app "minify-js-app" + And a file named "config.rb" with: + """ + activate :minify_javascript, inline: true + """ + And the Server is running at "minify-js-app" + When I go to "/inline-coffeescript.html" + Then I should see "3" lines + + Scenario: Rendering external js (coffeescript) with the feature enabled + Given a fixture app "minify-js-app" + And a file named "config.rb" with: + """ + activate :minify_javascript + """ + And the Server is running at "minify-js-app" + When I go to "/javascripts/coffee_test.js" + Then I should see "1" lines + + Scenario: Rendering inline js (coffeescript) with a passthrough minifier + Given a fixture app "passthrough-app" + And a file named "config.rb" with: + """ + module ::PassThrough + def self.compress(data) + data + end + end + + activate :minify_javascript, inline: true, compressor: ::PassThrough + + page "/inline-coffeescript.html", layout: false + """ + And the Server is running at "passthrough-app" + When I go to "/inline-coffeescript.html" + Then I should see "13" lines + + Scenario: Rendering external js (coffeescript) with a passthrough minifier + Given a fixture app "passthrough-app" + And a file named "config.rb" with: + """ + module ::PassThrough + def self.compress(data) + data + end + end + + activate :minify_javascript, compressor: ::PassThrough + """ + And the Server is running at "passthrough-app" + When I go to "/javascripts/coffee_test.js" + Then I should see "11" lines + diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/missing-tilt-lib.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/missing-tilt-lib.feature new file mode 100644 index 00000000000..95b7ba5acef --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/missing-tilt-lib.feature @@ -0,0 +1,20 @@ +Feature: Tilt missing support libraries + + Scenario: Rendering Textile and Wiki files + Given the Server is running at "missing-tilt-library-app" + When I go to "/danger-zone/more-wiki.html.wiki" + Then I should see "File Not Found" + When I go to "/danger-zone/more-wiki.html" + Then I should see "File Not Found" + When I go to "/safe-zone/my-wiki.html.wiki" + Then I should see "Safe" + When I go to "/safe-zone/my-wiki.html" + Then I should see "File Not Found" + When I go to "/textile-source.html.textile" + Then I should see "File Not Found" + When I go to "/textile-source.html" + Then I should see "File Not Found" + When I go to "/wiki-source.html.wiki" + Then I should see "Hola" + When I go to "/wiki-source.html" + Then I should see "File Not Found" \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-clean_build.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-clean_build.feature new file mode 100644 index 00000000000..a7a0b84c9dd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-clean_build.feature @@ -0,0 +1,14 @@ +Feature: Build Clean + + Scenario: Clean an app with directory indexes + Given a successfully built app at "clean-dir-app" with flags "--no-clean" + Then the following files should exist: + | build/about/index.html | + Given a successfully built app at "clean-dir-app" + Then the following files should exist: + | build/about/index.html | + + Scenario: Clean build an app that's never been built + Given a successfully built app at "clean-dir-app" + Then the following files should exist: + | build/about/index.html | \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-extensionless_text_files.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-extensionless_text_files.feature new file mode 100644 index 00000000000..c1550be4a5a --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-extensionless_text_files.feature @@ -0,0 +1,28 @@ +Feature: Text Files Without Extensions Should Build and Preview + + Scenario: Building Text Files with directory indexes + Given a successfully built app at "more-extensionless-text-files-app" + When I cd to "build" + Then the following files should exist: + | CNAME | + | LICENSE | + | README | + Then the following files should not exist: + | CNAME/index.html | + | LICENSE/index.html | + | README/index.html | + + Scenario: Previewing Text Files + Given the Server is running at "more-extensionless-text-files-app" + When I go to "/CNAME" + Then I should see "test.github.com" + When I go to "/LICENSE" + Then I should see "You have the right to remain classy." + When I go to "/README" + Then I should see "Bork bork bork" + # When I go to "/CNAME/index.html" + # Then I should see "File Not Found" + # When I go to "/LICENSE/index.html" + # Then I should see "File Not Found" + # When I go to "/README/index.html" + # Then I should see "File Not Found" \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-frontmatter_page_settings.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-frontmatter_page_settings.feature new file mode 100644 index 00000000000..2bb289c511c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-frontmatter_page_settings.feature @@ -0,0 +1,42 @@ +Feature: Setting page settings through frontmatter + Scenario: Setting layout, ignoring, and disabling directory indexes through frontmatter (build) + Given a successfully built app at "more-frontmatter-settings-app" + Then the following files should exist: + | build/proxied/index.html | + | build/no_index.html | + And the file "build/alternate_layout/index.html" should contain "Alternate layout" + And the following files should not exist: + | build/ignored/index.html | + | build/no_index/index.html | + + + Scenario: Setting layout, ignoring, and disabling directory indexes through frontmatter (preview) + Given the Server is running at "more-frontmatter-settings-app" + # When I go to "/proxied/" + # Then I should not see "File Not Found" + When I go to "/no_index.html" + Then I should not see "File Not Found" + When I go to "/alternate_layout/" + Then I should not see "File Not Found" + And I should see "Alternate layout" + When I go to "/ignored.html" + Then I should see "File Not Found" + When I go to "/ignored/index.html" + Then I should see "File Not Found" + When I go to "/no_index/index.html" + Then I should see "File Not Found" + + Scenario: Changing frontmatter in preview server + Given the Server is running at "more-frontmatter-settings-app" + When I go to "/ignored/index.html" + Then I should see "File Not Found" + And the file "source/ignored.html.erb" has the contents + """ + --- + ignored: false + --- + + This file is no longer ignored. + """ + When I go to "/ignored/index.html" + Then I should see "This file is no longer ignored." \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-ignore.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-ignore.feature new file mode 100644 index 00000000000..74eeaa71d8b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-ignore.feature @@ -0,0 +1,62 @@ +Feature: Ignoring paths + Scenario: Ignore with directory indexes (source file, build) + Given a fixture app "more-ignore-app" + And a file named "config.rb" with: + """ + activate :directory_indexes + ignore 'about.html.erb' + ignore 'plain.html' + """ + And a successfully built app at "more-ignore-app" + Then the following files should exist: + | build/index.html | + And the following files should not exist: + | build/about/index.html | + | build/plain/index.html | + + Scenario: Ignore with directory indexes (source file, server) + Given a fixture app "more-ignore-app" + And a file named "config.rb" with: + """ + activate :directory_indexes + ignore 'about.html.erb' + ignore 'plain.html' + """ + And the Server is running + When I go to "/index.html" + Then I should not see "File Not Found" + When I go to "/about/index.html" + Then I should see "File Not Found" + When I go to "/plain/index.html" + Then I should see "File Not Found" + + Scenario: Ignore with directory indexes (output path splat, build) + Given a fixture app "more-ignore-app" + And a file named "config.rb" with: + """ + activate :directory_indexes + ignore 'about*' + ignore 'plain*' + """ + And a successfully built app at "more-ignore-app" + Then the following files should exist: + | build/index.html | + And the following files should not exist: + | build/about/index.html | + | build/plain/index.html | + + Scenario: Ignore with directory indexes (output path splat, server) + Given a fixture app "more-ignore-app" + And a file named "config.rb" with: + """ + activate :directory_indexes + ignore 'about*' + ignore 'plain*' + """ + And the Server is running + When I go to "/index.html" + Then I should not see "File Not Found" + When I go to "/about/index.html" + Then I should see "File Not Found" + When I go to "/plain/index.html" + Then I should see "File Not Found" \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-sitemap_traversal.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-sitemap_traversal.feature new file mode 100644 index 00000000000..f935fbf0f38 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-sitemap_traversal.feature @@ -0,0 +1,83 @@ +Feature: Step through sitemap as a tree (more) + + Scenario: Root + Given the Server is running at "more-traversal-app" + When I go to "/index.html" + Then I should see "Path: index.html" + Then I should not see "Parent: index.html" + Then I should see "Child: sub/index.html" + Then I should see "Child: root.html" + Then I should not see "Child: proxied.html" + + Scenario: Directories have children and a parent + Given the Server is running at "more-traversal-app" + When I go to "/sub/index.html" + Then I should see "Path: sub/index.html" + Then I should see "Parent: index.html" + Then I should see "Child: sub/fake.html" + Then I should see "Child: sub/fake2.html" + Then I should see "Child: sub/sibling.html" + Then I should see "Child: sub/sibling2.html" + Then I should see "Child: sub/sub2/index.html" + Then I should see "Sibling: root.html" + + Scenario: Directory accessed without index.html + Given the Server is running at "more-traversal-app" + When I go to "/sub/" + Then I should see "Path: sub/index.html" + Then I should see "Parent: index.html" + Then I should see "Child: sub/fake.html" + Then I should see "Child: sub/fake2.html" + Then I should see "Child: sub/sibling.html" + Then I should see "Child: sub/sibling2.html" + Then I should see "Child: sub/sub2/index.html" + Then I should see "Sibling: root.html" + + Scenario: Page has siblings, parent, and source file + Given the Server is running at "more-traversal-app" + When I go to "/sub/sibling/" + Then I should see "Parent: sub/index.html" + Then I should see "Sibling: sub/fake.html" + Then I should see "Sibling: sub/fake2.html" + Then I should see "Sibling: sub/sibling2.html" + Then I should see "Sibling: sub/sub2/index.html" + Then I should see "Source: source/sub/sibling.html.erb" + + Scenario: Proxied page has siblings, parent, and source file + Given the Server is running at "more-traversal-app" + When I go to "/sub/fake/" + Then I should see "Path: sub/fake.html" + Then I should see "Parent: sub/index.html" + Then I should see "Sibling: sub/fake2.html" + Then I should see "Sibling: sub/sibling.html" + Then I should see "Sibling: sub/sibling2.html" + Then I should see "Sibling: sub/sub2/index.html" + Then I should see "Source: source/proxied.html.erb" + + Scenario: Child pages have data + Given the Server is running at "more-traversal-app" + When I go to "/directory-indexed" + Then I should see "Title of Sibling One" + Then I should see "Title of Sibling Two" + + Scenario: When directory_index extension is active, child pages are found in named directory + Given the Server is running at "more-traversal-app" + When I go to "/directory-indexed" + Then I should see "Path: directory-indexed.html" + Then I should see "Parent: index.html" + Then I should see "Child: directory-indexed/fake.html" + Then I should see "Child: directory-indexed/fake2.html" + Then I should see "Child: directory-indexed/sibling.html" + Then I should see "Child: directory-indexed/sibling2.html" + Then I should see "Child: directory-indexed/sub2/index.html" + Then I should see "Sibling: root.html" + + Scenario: Child pages can see their parent and siblings too in named directory + Given the Server is running at "more-traversal-app" + When I go to "/directory-indexed/sibling" + Then I should see "Path: directory-indexed/sibling.html" + Then I should see "Parent: directory-indexed.html" + Then I should see "Sibling: directory-indexed/fake.html" + Then I should see "Sibling: directory-indexed/fake2.html" + Then I should see "Sibling: directory-indexed/sibling2.html" + Then I should see "Sibling: directory-indexed/sub2/index.html" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-wildcard_page_helper.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-wildcard_page_helper.feature new file mode 100644 index 00000000000..caf056f6b32 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/more-wildcard_page_helper.feature @@ -0,0 +1,10 @@ +Feature: Wildcards in Page helper + + Scenario: Setting the layout for a folder + Given the Server is running at "wildcard-directory-index-app" + When I go to "/" + Then I should see "Normal Layout" + When I go to "/admin/" + Then I should see "Admin Layout" + When I go to "/admin/page/" + Then I should see "Admin Layout" \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/mount_rack.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/mount_rack.feature new file mode 100644 index 00000000000..dcb83146ed0 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/mount_rack.feature @@ -0,0 +1,65 @@ +Feature: Support Rack apps mounted using map + + Scenario: Mounted Rack App at /sinatra + Given the Server is running at "sinatra-app" + When I go to "/" + Then I should see "Hello World (Middleman)" + When I go to "/sinatra/" + Then I should see "Hello World (Sinatra)" + + Scenario: Built Mounted Rack App at /sinatra + Given a successfully built app at "sinatra-app" + When I cd to "build" + Then the following files should exist: + | index.html | + Then the following files should not exist: + | sinatra/index.html | + | sinatra/index2.html | + + Scenario: Static Ruby Endpoints + Given a fixture app "sinatra-app" + And a file named "config.rb" with: + """ + endpoint "hello.html" do + "world" + end + """ + And the Server is running at "sinatra-app" + When I go to "/hello.html" + Then I should see "world" + + Scenario: Built Mounted Rack App at /sinatra (including rack endpoints) + Given a fixture app "sinatra-app" + And a file named "config.rb" with: + """ + require "sinatra" + + class MySinatra < Sinatra::Base + get "/" do + "Hello World (Sinatra)" + end + get "/derp.html" do + "De doo" + end + end + + map "/sinatra" do + run MySinatra + end + + endpoint "sinatra/index2.html", path: "/sinatra/" + + endpoint "dedoo.html", path: "/sinatra/derp.html" + + endpoint "hello.html" do + "world" + end + """ + And a successfully built app at "sinatra-app" + When I cd to "build" + Then the following files should exist: + | index.html | + | sinatra/index2.html | + | dedoo.html | + And the file "sinatra/index2.html" should contain 'Hello World (Sinatra)' + And the file "dedoo.html" should contain 'De doo' \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/move_files.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/move_files.feature new file mode 100644 index 00000000000..a6b1e975999 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/move_files.feature @@ -0,0 +1,44 @@ +Feature: Move files + + Scenario: Move one path to another + Given a fixture app "large-build-app" + And a file named "config.rb" with: + """ + move_file "/static.html", "/static2.html" + """ + And the Server is running at "large-build-app" + When I go to "/static.html" + Then I should see 'Not Found' + When I go to "/static2.html" + Then I should see 'Static, no code!' + + Scenario: Move one path to another with directory indexes + Given a fixture app "large-build-app" + And a file named "config.rb" with: + """ + activate :directory_indexes + move_file "/static.html", "/static2.html" + """ + And the Server is running at "large-build-app" + When I go to "/static.html" + Then I should see 'Not Found' + When I go to "/static/index.html" + Then I should see 'Not Found' + When I go to "/static2.html" + Then I should see 'Static, no code!' + + Scenario: Move one path to another with directory indexes (using dest path) + Given a fixture app "large-build-app" + And a file named "config.rb" with: + """ + activate :directory_indexes + move_file "/static/index.html", "/static2.html" + """ + And the Server is running at "large-build-app" + When I go to "/static.html" + Then I should see 'Not Found' + When I go to "/static/index.html" + Then I should see 'Not Found' + When I go to "/static2.html" + Then I should see 'Static, no code!' + diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/multiple-sources.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/multiple-sources.feature new file mode 100644 index 00000000000..4f23474a1a8 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/multiple-sources.feature @@ -0,0 +1,35 @@ +Feature: Allow multiple sources to be setup. + + Scenario: Three source directories. + Given the Server is running at "multiple-sources-app" + When I go to "/index.html" + Then I should see "Default Source" + + When I go to "/index1.html" + Then I should see "Source 1" + + When I go to "/index2.html" + Then I should see "Source 2" + + When I go to "/override-in-two.html" + Then I should see "Overridden 2" + + When I go to "/override-in-one.html" + Then I should see "Opposite 2" + + Scenario: Three data directories. + Given the Server is running at "multiple-data-sources-app" + When I go to "/index.html" + Then I should see "Default: Data Default" + Then I should see "Data 1: Data 1" + Then I should see "Data 2: Data 2" + Then I should see "Override in Two: Overridden 2" + Then I should see "Override in One: Opposite 2" + + Scenario: Set source with destination_dir + Given the Server is running at "multiple-sources-with-duplicate-file-names-app" + When I go to "/index.html" + Then I should see "Default Source" + + When I go to "/source2/index.html" + Then I should see "Second Source" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/nested_layouts.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/nested_layouts.feature new file mode 100644 index 00000000000..f51831fb150 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/nested_layouts.feature @@ -0,0 +1,58 @@ +Feature: Allow nesting of layouts + + Scenario: A page uses an inner layout when uses an outer layout + Given the Server is running at "nested-layout-app" + When I go to "/index.html" + Then I should see: + """ + Master Erb +

      Index Title

      + I am Outer + I am Inner + Template + + """ + When I go to "/another.html" + Then I should see: + """ + Master Erb +

      New Article Title

      + I am Outer + I am Inner +

      The Article Content

      + """ + + Scenario: A page uses an inner layout when uses an outer layout (slim) + Given the Server is running at "nested-layout-app" + When I go to "/slim-test.html" + Then I should see "

      Master Slim

      New Article Title

      I am Outer

      I am Inner

      The Article Content

      " + + Scenario: A page uses an inner layout when uses an outer layout (haml) + Given the Server is running at "nested-layout-app" + When I go to "/haml-test.html" + Then I should see: + """ + Master Haml +

      New Article Title

      + I am Outer + I am Inner +

      The Article Content

      + """ + + Scenario: YAML Front Matter isn't clobbered with nested layouts + Given the Server is running at "nested-layout-app" + When I go to "/data-one.html" + Then I should see "Page Number One" + And I should see "Page #1" + And I should see "I am Inner" + And I should see "I am Outer" + And I should see "Master Erb" + When I go to "/data-two.html" + Then I should see "Page Number Two" + And I should not see "I am Inner" + When I go to "/data-one.html" + Then I should see "Page Number One" + And I should see "I am Inner" + When I go to "/data-two.html" + Then I should see "Page Number Two" + And I should not see "I am Inner" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/page-id.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/page-id.feature new file mode 100644 index 00000000000..b67d76596ce --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/page-id.feature @@ -0,0 +1,74 @@ +Feature: Page IDs + + Scenario: link_to works with blocks (erb) + Given the Server is running at "page-id-app" + When I go to "/index.html" + Then I should see "I am: index" + And I should see "URL1: /fm.html" + And I should see "URL2: /2.html" + And I should see 'URL3: Hi' + And I should see 'URL4: Sym' + And I should see 'URL5: Imp' + And I should see 'URL6: Foldern' + And I should see 'URL7: Feed' + And I should see "URL8: /fourty-two.html" + + When I go to "/fm.html" + Then I should see "I am: frontmatter" + When I go to "/implicit.html" + Then I should see "I am: implicit" + When I go to "/feed.xml" + Then I should see "I am: feed.xml" + When I go to "/folder/foldern.html" + Then I should see "I am: folder/foldern" + + When I go to "/1.html" + Then I should see "I am: page1" + When I go to "/2.html" + Then I should see "I am: page2" + When I go to "/3.html" + Then I should see "I am: page3" + + When I go to "/overwrites/from-default.html" + Then I should see "I am: something-else" + + When I go to "/overwrites/from-frontmatter.html" + Then I should see "I am: from_frontmatter" + + Scenario: Override page ID derivation with a proc + Given a fixture app "page-id-app" + And app "page-id-app" is using config "proc" + And the Server is running at "page-id-app" + + When I go to "/index.html" + Then I should see "I am: index.html-foo" + And I should see "URL1: /fm.html" + And I should see "URL2: /2.html" + And I should see 'URL3: Hi' + And I should see 'URL4: Sym' + And I should see "URL8: /fourty-two.html" + And I should see 'URL9: Imp' + And I should see 'URL10: Foldern' + And I should see 'URL11: Feed' + + When I go to "/fm.html" + Then I should see "I am: frontmatter" + When I go to "/implicit.html" + Then I should see "I am: implicit.html-foo" + When I go to "/feed.xml" + Then I should see "I am: feed.xml-foo" + When I go to "/folder/foldern.html" + Then I should see "I am: folder/foldern.html-foo" + + When I go to "/1.html" + Then I should see "I am: page1" + When I go to "/2.html" + Then I should see "I am: page2" + When I go to "/3.html" + Then I should see "I am: page3" + + When I go to "/overwrites/from-default.html" + Then I should see "I am: something-else" + + When I go to "/overwrites/from-frontmatter.html" + Then I should see "I am: from_frontmatter" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/paginate.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/paginate.feature new file mode 100644 index 00000000000..9338e019004 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/paginate.feature @@ -0,0 +1,204 @@ +Feature: Pagination + Scenario: Basic configuration + Given a fixture app "paginate-app" + And a file named "config.rb" with: + """ + articles = resources.select { |r| + matcher = ::Middleman::Util::UriTemplates.uri_template('blog/2011-{remaining}') + ::Middleman::Util::UriTemplates.extract_params(matcher, ::Middleman::Util.normalize_path(r.url)) + } + + articles.sort { |a, b| + b.data.date <=> a.data.date + }.per_page(5) do |items, num, meta, is_last| + page_path = num == 1 ? '/2011/index.html' : "/2011/page/#{num}.html" + + prev_page = case num + when 1 + nil + when 2 + '/2011/index.html' + when 3 + "/2011/page/#{num-1}.html" + end + + next_page = is_last ? nil : "/2011/page/#{num+1}.html" + + proxy page_path, "/archive/2011/index.html", locals: { + items: items, + pagination: meta, + prev_page: prev_page, + next_page: next_page + } + end + + def get_tags(resource) + if resource.data.tags.is_a? String + resource.data.tags.split(',').map(&:strip) + else + resource.data.tags + end + end + + def group_lookup(resource, sum) + results = Array(get_tags(resource)).map(&:to_s).map(&:to_sym) + + results.each do |k| + sum[k] ||= [] + sum[k] << resource + end + end + + tags = articles + .select { |resource| resource.data.tags } + .each_with_object({}, &method(:group_lookup)) + + tags.each do |k, articles_in_tag| + articles_in_tag.sort { |a, b| + b.data.date <=> a.data.date + }.per_page(2).each do |items, num, meta, is_last| + page_path = num == 1 ? "/tags/#{k}.html" : "/tags/#{k}/page/#{num}.html" + + prev_page = case num + when 1 + nil + when 2 + "/tags/#{k}.html" + when 3 + "/tags/#{k}/page/#{num-1}.html" + end + + next_page = is_last ? nil : "/tags/#{k}/page/#{num+1}.html" + + proxy page_path, "/archive/2011/index.html", locals: { + items: items, + pagination: meta, + prev_page: prev_page, + next_page: next_page + } + end + end + """ + And the Server is running + When I go to "/2011/index.html" + Then I should see "Paginate: true" + Then I should see "Article Count: 5" + Then I should see "Page Num: 1" + Then I should see "Num Pages: 2" + Then I should see "Per Page: 5" + Then I should see "Page Start: 1" + Then I should see "Page End: 5" + Then I should see "Next Page: '/2011/page/2.html'" + Then I should see "Prev Page: ''" + Then I should not see "/blog/2011-01-01-test-article.html" + Then I should not see "/blog/2011-01-02-test-article.html" + Then I should see "/blog/2011-01-03-test-article.html" + Then I should see "/blog/2011-01-04-test-article.html" + Then I should see "/blog/2011-01-05-test-article.html" + Then I should see "/blog/2011-02-01-test-article.html" + Then I should see "/blog/2011-02-02-test-article.html" + + When I go to "/2011/page/2.html" + Then I should see "Article Count: 2" + Then I should see "Page Num: 2" + Then I should see "Page Start: 6" + Then I should see "Page End: 7" + Then I should see "Next Page: ''" + Then I should see "Prev Page: '/2011/'" + Then I should see "/2011-01-01-test-article.html" + Then I should see "/2011-01-02-test-article.html" + Then I should not see "/2011-01-03-test-article.html" + Then I should not see "/2011-01-04-test-article.html" + Then I should not see "/2011-01-05-test-article.html" + Then I should not see "/2011-02-01-test-article.html" + Then I should not see "/2011-02-02-test-article.html" + + When I go to "/tags/bar.html" + Then I should see "Paginate: true" + Then I should see "Article Count: 2" + Then I should see "Page Num: 1" + Then I should see "Num Pages: 3" + Then I should see "Per Page: 2" + Then I should see "Page Start: 1" + Then I should see "Page End: 2" + Then I should see "Next Page: '/tags/bar/page/2.html'" + Then I should see "Prev Page: ''" + Then I should see "/2011-02-02-test-article.html" + Then I should see "/2011-02-01-test-article.html" + Then I should not see "/2011-02-05-test-article.html" + Then I should not see "/2011-01-04-test-article.html" + Then I should not see "/2011-01-03-test-article.html" + + Scenario: Custom pager method + Given a fixture app "paginate-app" + And a file named "config.rb" with: + """ + def items_per_page(all_items) + [ + all_items.shift(2), + all_items + ] + end + + articles = resources.select { |r| + matcher = ::Middleman::Util::UriTemplates.uri_template('blog/2011-{remaining}') + ::Middleman::Util::UriTemplates.extract_params(matcher, ::Middleman::Util.normalize_path(r.url)) + } + + articles.sort { |a, b| + b.data.date <=> a.data.date + }.per_page(method(:items_per_page).to_proc).each do |items, num, meta, is_last| + page_path = num == 1 ? '/2011/index.html' : "/2011/page/#{num}.html" + + prev_page = case num + when 1 + nil + when 2 + '/2011/index.html' + when 3 + "/2011/page/#{num-1}.html" + end + + next_page = is_last ? nil : "/2011/page/#{num+1}.html" + + proxy page_path, "/archive/2011/index.html", locals: { + items: items, + pagination: meta, + prev_page: prev_page, + next_page: next_page + } + end + """ + And the Server is running + When I go to "/2011/index.html" + Then I should see "Paginate: true" + Then I should see "Article Count: 2" + Then I should see "Page Num: 1" + Then I should see "Num Pages: 2" + Then I should see "Per Page: 2" + Then I should see "Page Start: 1" + Then I should see "Page End: 2" + Then I should see "Next Page: '/2011/page/2.html'" + Then I should see "Prev Page: ''" + Then I should not see "/blog/2011-01-01-test-article.html" + Then I should not see "/blog/2011-01-02-test-article.html" + Then I should not see "/blog/2011-01-03-test-article.html" + Then I should not see "/blog/2011-01-04-test-article.html" + Then I should not see "/blog/2011-01-05-test-article.html" + Then I should see "/blog/2011-02-01-test-article.html" + Then I should see "/blog/2011-02-02-test-article.html" + + When I go to "/2011/page/2.html" + Then I should see "Article Count: 5" + Then I should see "Page Num: 2" + Then I should see "Page Start: 3" + Then I should see "Page End: 7" + Then I should see "Next Page: ''" + Then I should see "Prev Page: '/2011/'" + Then I should see "/2011-01-01-test-article.html" + Then I should see "/2011-01-02-test-article.html" + Then I should see "/2011-01-03-test-article.html" + Then I should see "/2011-01-04-test-article.html" + Then I should see "/2011-01-05-test-article.html" + Then I should not see "/2011-02-01-test-article.html" + Then I should not see "/2011-02-02-test-article.html" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/partials.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/partials.feature new file mode 100644 index 00000000000..8a0154c2b4f --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/partials.feature @@ -0,0 +1,64 @@ +Feature: Provide Sane Defaults for Partial Behavior + + Scenario: Finds shared partials relative to the root + Given the Server is running at "partials-app" + When I go to "/index.html" + Then I should see "Header" + And I should see "Footer" + + Scenario: Finds shared partials relative to the root (sub) + Given the Server is running at "partials-app" + When I go to "/sub/index.html" + Then I should see "Header" + And I should see "Footer" + + Scenario: Flags error when partial is not found + Given the Server is running at "partials-app" + When I go to "/index_missing.html" + Then I should see "Error: Could not locate partial" + + Scenario: Prefers partials of the same engine type + Given the Server is running at "partials-app" + When I go to "/index.html" + Then I should see "ERb Main" + + Scenario: Prefers partials of the same engine type + Given the Server is running at "partials-app" + When I go to "/second.html" + Then I should see "Str Main" + And I should see "Header" + And I should see "Footer" + + Scenario: Finds partial relative to template + Given the Server is running at "partials-app" + When I go to "/sub/index.html" + Then I should see "Local Partial" + + Scenario: Partials can be passed locals + Given the Server is running at "partials-app" + When I go to "/locals.html" + Then I should see "Local var is bar" + + Scenario: Partial and Layout use different engines + Given the Server is running at "different-engine-partial" + When I go to "/index.html" + Then I should see "ERb Header" + And I should see "Str Footer" + + Scenario: Works with non-template content (svg) + Given the Server is running at "partials-app" + When I go to "/svg.html" + Then I should see "Hello World

      " + When I go to "/code_snippet.html" + Then I should see "File Not Found" + When I go to "/_code_snippet.html" + Then I should see "File Not Found" + +Scenario: Works with blocks + Given the Server is running at "partials-app" + When I go to "/block.html" + Then I should see "Start" + And I should see "Contents" + And I should see "End" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/preview_changes.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/preview_changes.feature new file mode 100644 index 00000000000..054ef2ed9f4 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/preview_changes.feature @@ -0,0 +1,29 @@ +Feature: Preview Changes + In order to run quickly, we should update internal caches on file changes + + Scenario: A template changes contents during preview + Given the Server is running at "preview-app" + And the file "source/content.html.erb" has the contents + """ + Hello World + """ + When I go to "/content.html" + Then I should see "Hello World" + And the file "source/content.html.erb" has the contents + """ + Hola Mundo + """ + When I go to "/content.html" + Then I should see "Hola Mundo" + + Scenario: A template is removed during preview + Given the Server is running at "preview-app" + And the file "source/a-page.html.erb" has the contents + """ + Hello World + """ + When I go to "/a-page.html" + Then I should see "Hello World" + And the file "source/a-page.html.erb" is removed + When I go to "/a-page.html" + Then I should see "File Not Found" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/proxy_pages.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/proxy_pages.feature new file mode 100644 index 00000000000..4a22727ccf1 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/proxy_pages.feature @@ -0,0 +1,84 @@ +Feature: Proxy Pages (using proxy rather than page) + In order to use a single view to generate multiple output files + + Scenario: Checking built folder for content + Given a successfully built app at "proxy-pages-app" + When I cd to "build" + Then the following files should exist: + | fake.html | + | fake2.html | + | fake3.html | + | fake4.html | + | fake/one.html | + | fake/two.html | + | fake2/one.html | + | fake2/two.html | + | fake3/one.html | + | fake3/two.html | + | target_ignore.html | + | target_ignore2.html | + | target_ignore3.html | + | target_ignore4.html | + | 明日がある.html | + Then the following files should not exist: + | should_be_ignored6.html | + | should_be_ignored7.html | + | should_be_ignored8.html | + + Scenario: Preview basic proxy + Given the Server is running at "proxy-pages-app" + When I go to "/fake.html" + Then I should see "I am real" + When I go to "/fake2.html" + Then I should see "I am real" + When I go to "/fake3.html" + Then I should see "I am real" + + Scenario: Preview proxy with variable one + Given the Server is running at "proxy-pages-app" + When I go to "/fake/one.html" + Then I should see "I am real: one" + + When I go to "/fake2/one.html" + Then I should see "I am real: one" + + When I go to "/fake3/one.html" + Then I should see "I am real: one" + + Scenario: Preview proxy with variable two + Given the Server is running at "proxy-pages-app" + When I go to "/fake/two.html" + Then I should see "I am real: two" + + When I go to "/fake2/two.html" + Then I should see "I am real: two" + + When I go to "/fake3/two.html" + Then I should see "I am real: two" + + Scenario: Build proxy with variable one + Given a successfully built app at "proxy-pages-app" + When I cd to "build" + Then the file "fake/one.html" should contain "I am real: one" + Then the file "fake2/one.html" should contain "I am real: one" + Then the file "fake3/one.html" should contain "I am real: one" + + Scenario: Target ignore + Given the Server is running at "proxy-pages-app" + When I go to "/target_ignore.html" + Then I should see "Ignore me! 3" + When I go to "/target_ignore2.html" + Then I should see "Ignore me! 6" + When I go to "/target_ignore3.html" + Then I should see "Ignore me! 7" + When I go to "/target_ignore4.html" + Then I should see "Ignore me! 8" + + Scenario: Preview ignored paths + Given the Server is running at "proxy-pages-app" + When I go to "/should_be_ignored6.html" + Then I should see "File Not Found" + When I go to "/should_be_ignored7.html" + Then I should see "File Not Found" + When I go to "/should_be_ignored8.html" + Then I should see "File Not Found" \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/redirects.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/redirects.feature new file mode 100644 index 00000000000..c15491280f9 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/redirects.feature @@ -0,0 +1,61 @@ +Feature: Meta redirects + + Scenario: Redirect to unknown file + Given a fixture app "large-build-app" + And a file named "config.rb" with: + """ + redirect "hello.html", to: "world.html" + """ + And the Server is running at "large-build-app" + When I go to "/hello.html" + Then I should see ' + """ + And the Server is running at "relative-assets-app" + When I go to "/sub/image_tag.html" + Then I should see ' + """ + And the Server is running at "relative-assets-app" + When I go to "/sub/image_tag.html" + Then I should see '' + + Scenario: URLs are not rewritten for rewrite ignored paths + Given a fixture app "relative-assets-app" + And a file named "config.rb" with: + """ + activate :relative_assets, rewrite_ignore: [ + '/stylesheets/fonts.css', + ] + """ + And the Server is running at "relative-assets-app" + When I go to "/stylesheets/relative_assets.css" + Then I should see 'url("../images/blank.gif' + When I go to "/stylesheets/fonts.css" + Then I should see 'url(/fonts/roboto/roboto-regular-webfont.eot' diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/relative_assets_helpers_only.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/relative_assets_helpers_only.feature new file mode 100644 index 00000000000..194c8b37db9 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/relative_assets_helpers_only.feature @@ -0,0 +1,123 @@ +Feature: Relative Assets (Helpers Only) + + Scenario: Rendering css with the feature enabled + Given a fixture app "relative-assets-app" + And a file named "config.rb" with: + """ + activate :relative_assets, helpers_only: true + """ + And a file named "source/stylesheets/relative_assets.css.sass.erb" with: + """ + h1 + background: url("http://github.com/%3C%=%20asset_url('images/blank.gif') %>") + h2 + background: url("http://github.com/%3C%=%20asset_url('/images/blank2.gif') %>") + """ + And a file named "source/javascripts/application.js.erb" with: + """ + function foo() { + var img = document.createElement('img'); + img.src = '<%= asset_url("http://github.com/images/100px.jpg") %>'; + var body = document.getElementsByTagName('body')[0]; + body.insertBefore(img, body.firstChild); + } + + window.onload = foo; + """ + And a file named "source/stylesheets/fonts3.css.erb" with: + """ + @font-face { + font-family: 'Roboto2'; + src: url(http://github.com/%3C%=%20asset_url(%22/fonts/roboto/roboto-regular-webfont.eot") %>); + src: url(http://github.com/%3C%=%20asset_url(%22/fonts/roboto/roboto-regular-webfont.eot?#iefix") %>) format('embedded-opentype'), + url(http://github.com/%3C%=%20asset_url(%22/fonts/roboto/roboto-regular-webfont.woff") %>) format('woff'), + url(http://github.com/%3C%=%20asset_url(%22/fonts/roboto/roboto-regular-webfont.ttf") %>) format('truetype'), + url(http://github.com/%3C%=%20asset_url(%22/fonts/roboto/roboto-regular-webfont.svg#robotoregular") %>) format('svg'); + font-weight: normal; + font-style: normal; + } + """ + And the Server is running at "relative-assets-app" + When I go to "/stylesheets/relative_assets.css" + Then I should see 'url("../images/blank.gif' + And I should see 'url("../images/blank2.gif' + When I go to "/javascripts/application.js" + Then I should not see "../" + When I go to "/stylesheets/fonts3.css" + Then I should see 'url(../fonts/roboto/roboto-regular-webfont.eot' + And I should see 'url(../fonts/roboto/roboto-regular-webfont.woff' + And I should see 'url(../fonts/roboto/roboto-regular-webfont.ttf' + And I should see 'url(../fonts/roboto/roboto-regular-webfont.svg' + + Scenario: Relative css reference with directory indexes + Given a fixture app "relative-assets-app" + And a file named "config.rb" with: + """ + activate :directory_indexes + activate :relative_assets, helpers_only: true + """ + And the Server is running at "relative-assets-app" + When I go to "/relative_image/index.html" + Then I should see "../stylesheets/relative_assets.css" + + Scenario: Relative assets via image_tag + Given a fixture app "relative-assets-app" + And a file named "config.rb" with: + """ + activate :relative_assets, helpers_only: true + """ + And a file named "source/sub/image_tag.html.erb" with: + """ + <%= image_tag '/img/blank.gif' %> + """ + And the Server is running at "relative-assets-app" + When I go to "/sub/image_tag.html" + Then I should see ' + """ + And the Server is running at "relative-assets-app" + When I go to "/sub/image_tag.html" + Then I should see '' + + Scenario: URLs are not rewritten for rewrite ignored paths + Given a fixture app "relative-assets-app" + And a file named "config.rb" with: + """ + activate :relative_assets, rewrite_ignore: [ + '/stylesheets/fonts3.css', + ], helpers_only: true + """ + And a file named "source/stylesheets/relative_assets.css.sass.erb" with: + """ + h1 + background: url("http://github.com/%3C%=%20asset_url('images/blank.gif') %>") + h2 + background: url("http://github.com/%3C%=%20asset_url('/images/blank2.gif') %>") + """ + And a file named "source/stylesheets/fonts3.css.erb" with: + """ + @font-face { + font-family: 'Roboto2'; + src: url(http://github.com/%3C%=%20asset_url(%22/fonts/roboto/roboto-regular-webfont.eot") %>); + src: url(http://github.com/%3C%=%20asset_url(%22/fonts/roboto/roboto-regular-webfont.eot?#iefix") %>) format('embedded-opentype'), + url(http://github.com/%3C%=%20asset_url(%22/fonts/roboto/roboto-regular-webfont.woff") %>) format('woff'), + url(http://github.com/%3C%=%20asset_url(%22/fonts/roboto/roboto-regular-webfont.ttf") %>) format('truetype'), + url(http://github.com/%3C%=%20asset_url(%22/fonts/roboto/roboto-regular-webfont.svg#robotoregular") %>) format('svg'); + font-weight: normal; + font-style: normal; + } + """ + And the Server is running at "relative-assets-app" + When I go to "/stylesheets/relative_assets.css" + Then I should see 'url("../images/blank.gif' + When I go to "/stylesheets/fonts3.css" + Then I should see 'url(/fonts/roboto/roboto-regular-webfont.eot' diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sass-assets-paths.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sass-assets-paths.feature new file mode 100644 index 00000000000..834fe74a64b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sass-assets-paths.feature @@ -0,0 +1,11 @@ +Feature: Support SASS assets paths + In order to import common shared assets when writing Sass + + Scenario: Importing assets from 'assets/stylesheets/' directory in app root + Given the Server is running at "sass-assets-path-app" + When I go to "/stylesheets/plain.css" + Then I should see "color: green;" + Then I should see "/* Works with shared SCSS assets from APPROOT/assets/stylesheets/_shared-asset.scss */" + Then I should see "/* Works with shared SASS assets from APPROOT/assets/stylesheets/_shared-asset-sass.sass */" + Then I should see "font-size: 18px" + Then I should see "/* Works with shared SASS assets from external source directory */" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sass_in_slim.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sass_in_slim.feature new file mode 100644 index 00000000000..d04055e49ed --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sass_in_slim.feature @@ -0,0 +1,40 @@ +Feature: Sass/SCSS support in Slim + In order to test support of the Slim sass and scss filters + + Scenario: Sass filter in Slim works + Given a fixture app "sass-in-slim-app" + And a file named "config.rb" with: + """ + activate :directory_indexes + """ + And a file named "source/sass_filter.html.slim" with: + """ + sass: + .sass + margin: 0 + """ + Given the Server is running at "sass-in-slim-app" + When I go to "/sass_filter/" + Then I should see "text/css" + Then I should see ".sass" + Then I should see "margin:0" + + + Scenario: SCSS filter in Slim works + Given a fixture app "sass-in-slim-app" + And a file named "config.rb" with: + """ + activate :directory_indexes + """ + And a file named "source/scss_filter.html.slim" with: + """ + scss: + .scss { + margin: 0; + } + """ + Given the Server is running at "sass-in-slim-app" + When I go to "/scss_filter/" + Then I should see "text/css" + Then I should see ".scss" + Then I should see "margin:0" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sass_partials.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sass_partials.feature new file mode 100644 index 00000000000..d6bce56a1b6 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sass_partials.feature @@ -0,0 +1,54 @@ +Feature: Sass Updates and Partials + Scenario: The preview server should update stylesheets when Sass changes + Given the Server is running at "more-preview-app" + And the file "source/stylesheets/plain.css.sass" has the contents + """ + red + color: red + """ + When I go to "/stylesheets/plain.css" + Then I should see "color: red;" + And the file "source/stylesheets/plain.css.sass" has the contents + """ + red + color: blue + """ + When I go to "/stylesheets/plain.css" + Then I should see "color: blue;" + + Scenario: The preview server should update stylesheets when Sass partials change + Given the Server is running at "more-preview-app" + And the file "source/stylesheets/main.css.sass" has the contents + """ + @import partial.sass + + red + color: red + """ + And the file "source/stylesheets/_partial.sass" has the contents + """ + body + font-size: 14px + """ + When I go to "/stylesheets/main.css" + Then I should see "color: red;" + And I should see "font-size: 14px;" + And the file "source/stylesheets/main.css.sass" has the contents + """ + @import partial.sass + + red + color: blue + """ + And the file "source/stylesheets/_partial.sass" has the contents + """ + body + font-size: 18px + """ + When I go to "/stylesheets/main.css" + Then I should see "color: blue;" + And I should see "font-size: 18px" + + Scenario: Sass partials should work when building + Given a successfully built app at "more-preview-app" + Then the file "build/stylesheets/main.css" should contain "font-size: 18px" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/scss-support.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/scss-support.feature new file mode 100644 index 00000000000..0b380f06fa7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/scss-support.feature @@ -0,0 +1,12 @@ +Feature: Support SCSS Syntax + In order to offer an alternative when writing Sass + + Scenario: Rendering scss + Given the Server is running at "scss-app" + When I go to "/stylesheets/site_scss.css" + Then I should see "html" + + Scenario: Rendering scss + Given the Server is running at "scss-app" + When I go to "/stylesheets/layout.css" + Then I should see "html" \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sitemap_traversal.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sitemap_traversal.feature new file mode 100644 index 00000000000..d2fe581ca6e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/sitemap_traversal.feature @@ -0,0 +1,83 @@ +Feature: Step through sitemap as a tree + + Scenario: Root + Given the Server is running at "traversal-app" + When I go to "/index.html" + Then I should see "Path: index.html" + Then I should not see "Parent: index.html" + Then I should see "Child: sub/index.html" + Then I should see "Child: root.html" + Then I should not see "Child: proxied.html" + + Scenario: Directories have children and a parent + Given the Server is running at "traversal-app" + When I go to "/sub/index.html" + Then I should see "Path: sub/index.html" + Then I should see "Parent: index.html" + Then I should see "Child: sub/fake.html" + Then I should see "Child: sub/fake2.html" + Then I should see "Child: sub/sibling.html" + Then I should see "Child: sub/sibling2.html" + Then I should see "Child: sub/sub2/index.html" + Then I should see "Sibling: root.html" + + Scenario: Directory accessed without index.html + Given the Server is running at "traversal-app" + When I go to "/sub/" + Then I should see "Path: sub/index.html" + Then I should see "Parent: index.html" + Then I should see "Child: sub/fake.html" + Then I should see "Child: sub/fake2.html" + Then I should see "Child: sub/sibling.html" + Then I should see "Child: sub/sibling2.html" + Then I should see "Child: sub/sub2/index.html" + Then I should see "Sibling: root.html" + + Scenario: Page has siblings, parent, and source file + Given the Server is running at "traversal-app" + When I go to "/sub/sibling.html" + Then I should see "Parent: sub/index.html" + Then I should see "Sibling: sub/fake.html" + Then I should see "Sibling: sub/fake2.html" + Then I should see "Sibling: sub/sibling2.html" + Then I should see "Sibling: sub/sub2/index.html" + Then I should see "Source: source/sub/sibling.html.erb" + + Scenario: Proxied page has siblings, parent, and source file + Given the Server is running at "traversal-app" + When I go to "/sub/fake.html" + Then I should see "Path: sub/fake.html" + Then I should see "Parent: sub/index.html" + Then I should see "Sibling: sub/fake2.html" + Then I should see "Sibling: sub/sibling.html" + Then I should see "Sibling: sub/sibling2.html" + Then I should see "Sibling: sub/sub2/index.html" + Then I should see "Source: source/proxied.html.erb" + + Scenario: Child pages have data + Given the Server is running at "traversal-app" + When I go to "/directory-indexed.html" + Then I should see "Title of Sibling One" + Then I should see "Title of Sibling Two" + + Scenario: When directory_index extension is inactive, child pages are found in named directory + Given the Server is running at "traversal-app" + When I go to "/directory-indexed.html" + Then I should see "Path: directory-indexed.html" + Then I should see "Parent: index.html" + Then I should see "Child: directory-indexed/fake.html" + Then I should see "Child: directory-indexed/fake2.html" + Then I should see "Child: directory-indexed/sibling.html" + Then I should see "Child: directory-indexed/sibling2.html" + Then I should see "Child: directory-indexed/sub2/index.html" + Then I should see "Sibling: root.html" + + Scenario: Child pages can see their parent and siblings too in named directory + Given the Server is running at "traversal-app" + When I go to "/directory-indexed/sibling.html" + Then I should see "Path: directory-indexed/sibling.html" + Then I should see "Parent: directory-indexed.html" + Then I should see "Sibling: directory-indexed/fake.html" + Then I should see "Sibling: directory-indexed/fake2.html" + Then I should see "Sibling: directory-indexed/sibling2.html" + Then I should see "Sibling: directory-indexed/sub2/index.html" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/slim.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/slim.feature new file mode 100644 index 00000000000..031120f3aae --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/slim.feature @@ -0,0 +1,81 @@ +Feature: Support slim templating language + In order to offer an alternative to Haml + + Scenario: Rendering Slim + Given an empty app + And a file named "config.rb" with: + """ + """ + And a file named "source/slim.html.slim" with: + """ + doctype 5 + html lang='en' + head + meta charset="utf-8" + + body + h1 Welcome to Slim + """ + And the Server is running at "empty_app" + When I go to "/slim.html" + Then I should see "

      Welcome to Slim

      " + + Scenario: Slim Content For + Given the Server is running at "slim-content-for-app" + When I go to "/index.html" + Then I should not see "Content AContent B" + Then I should see "Content for A:Content A" + Then I should see "Content for main:Content Main" + Then I should see "Content for B:Content B" + + Scenario: Rendering Scss in a Slim filter + Given an empty app + And a file named "config.rb" with: + """ + """ + And a file named "source/scss.html.slim" with: + """ + doctype 5 + html lang='en' + head + meta charset="utf-8" + scss: + @mixin global-reset { + html, body, div { + padding: 0; + } + } + @include global-reset; + body + h1 Welcome to Slim + """ + And a file named "source/sass.html.slim" with: + """ + doctype 5 + html lang='en' + head + meta charset="utf-8" + sass: + html, body, div + padding: 0 + body + h1 Welcome to Slim + """ + And a file named "source/error.html.slim" with: + """ + doctype 5 + html lang='en' + head + meta charset="utf-8" + scss: + +global-reset2 + body + h1 Welcome to Slim + """ + And the Server is running at "empty_app" + When I go to "/scss.html" + Then I should see "html,body,div" + When I go to "/sass.html" + Then I should see "html,body,div" + When I go to "/error.html" + Then I should see "Error:" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/strip_url.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/strip_url.feature new file mode 100644 index 00000000000..8a332d04bf7 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/strip_url.feature @@ -0,0 +1,40 @@ +Feature: Strip the index_file from urls + + Scenario: Default behaviour, strip with trailing slash + Given the Server is running at "strip-url-app" + When I go to "/" + Then I should see "URL: '/'" + When I go to "/index.html" + Then I should see "URL: '/'" + When I go to "/other.html" + Then I should see "URL: '/other.html'" + When I go to "/subdir/index.html" + Then I should see "URL: '/subdir/'" + + Scenario: Trailing slash off + Given a fixture app "strip-url-app" + And a file named "config.rb" with: + """ + set :trailing_slash, false + """ + And the Server is running + When I go to "/" + Then I should see "URL: '/'" + When I go to "/other.html" + Then I should see "URL: '/other.html'" + When I go to "/subdir/index.html" + Then I should see "URL: '/subdir'" + + Scenario: Strip index off + Given a fixture app "strip-url-app" + And a file named "config.rb" with: + """ + set :strip_index_file, false + """ + And the Server is running + When I go to "/" + Then I should see "URL: '/index.html'" + When I go to "/other.html" + Then I should see "URL: '/other.html'" + When I go to "/subdir/index.html" + Then I should see "URL: '/subdir/index.html'" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/stylus.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/stylus.feature new file mode 100644 index 00000000000..15b44f181d3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/stylus.feature @@ -0,0 +1,54 @@ +Feature: Stylus Updates and Partials + Scenario: The preview server should update stylesheets when Stylus changes + Given the Server is running at "stylus-preview-app" + And the file "source/stylesheets/plain.css.styl" has the contents + """ + red + color: #f0f0f0 + """ + When I go to "/stylesheets/plain.css" + Then I should see "color: #f0f0f0;" + And the file "source/stylesheets/plain.css.styl" has the contents + """ + red + color: #0f0f0f + """ + When I go to "/stylesheets/plain.css" + Then I should see "color: #0f0f0f;" + + Scenario: The preview server should update stylesheets when Stylus partials change + Given the Server is running at "stylus-preview-app" + And the file "source/stylesheets/main.css.styl" has the contents + """ + @import 'http://github.com/_partial' + + red + color: #f0f0f0 + """ + And the file "source/stylesheets/_partial.styl" has the contents + """ + body + font-size: 14px + """ + When I go to "/stylesheets/main.css" + Then I should see "color: #f0f0f0;" + And I should see "font-size: 14px;" + And the file "source/stylesheets/main.css.styl" has the contents + """ + @import 'http://github.com/_partial' + + red + color: #0f0f0f + """ + And the file "source/stylesheets/_partial.styl" has the contents + """ + body + font-size: 18px + """ + When I go to "/stylesheets/main.css" + Then I should see "color: #0f0f0f;" + And I should see "font-size: 18px" + + Scenario: Stylus partials should work when building + Given a successfully built app at "stylus-preview-app" + Then the file "build/stylesheets/main.css" should contain "font-size: 18px" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/support/env.rb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/support/env.rb new file mode 100644 index 00000000000..77cfbb06573 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/support/env.rb @@ -0,0 +1,19 @@ +ENV["TEST"] = "true" + +require 'sassc' + +require 'simplecov' +SimpleCov.root(File.expand_path(File.dirname(__FILE__) + '/../..')) + +require 'phantomjs/poltergeist' +Capybara.javascript_driver = :poltergeist + +require 'coveralls' +Coveralls.wear! + +require 'codeclimate-test-reporter' +CodeClimate::TestReporter.start + +PROJECT_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__))) +require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-core') +require File.join(PROJECT_ROOT_PATH, 'lib', 'middleman-core', 'step_definitions') diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/support/preserve_mime_types.rb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/support/preserve_mime_types.rb new file mode 100644 index 00000000000..a791e49cb44 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/support/preserve_mime_types.rb @@ -0,0 +1,7 @@ +Around('@preserve_mime_types') do |_scenario, block| + mime_types = ::Rack::Mime::MIME_TYPES.clone + + block.call + + ::Rack::Mime::MIME_TYPES.replace mime_types +end diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/template-key-collision.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/template-key-collision.feature new file mode 100644 index 00000000000..9e530dc1e4d --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/template-key-collision.feature @@ -0,0 +1,26 @@ +Feature: Don't allow template locals to overwrite template helpers + + Scenario: Normal Template + Given an empty app + And a file named "config.rb" with: + """ + class TestExt < ::Middleman::Extension + expose_to_template foo: :foo + + def foo + "bar" + end + end + + ::Middleman::Extensions.register :test, TestExt + + activate :test + + page "/index.html", locals: { foo: false } + """ + And a file named "source/index.html.erb" with: + """ + <%= foo %> + """ + Given a built app at "empty_app" + Then the exit status should be 1 diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/tilde_directories.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/tilde_directories.feature new file mode 100644 index 00000000000..0a9f18ea45b --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/tilde_directories.feature @@ -0,0 +1,14 @@ +@encoding + +Feature: Tilde directories + In order to support ~ characters in directories + + Scenario: Build directories with containing ~ characters in their name + Given a fixture app "empty-app" + And a file named "source/~notexistinguser/index.html" with: + """ + It works! + """ + And the Server is running + When I go to "/~notexistinguser/index.html" + Then I should see "It works!" diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/unicode_filecontents.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/unicode_filecontents.feature new file mode 100644 index 00000000000..80b676a3adf --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/unicode_filecontents.feature @@ -0,0 +1,13 @@ +Feature: Unicode filecontents + In order to support non-ASCII characters in file contents + + Scenario: Rebuild with files containing unicode characters in their name + Given a fixture app "clean-app" + And a file named "source/index.html.erb" with: + """ + 你好 + """ + And a successfully built app at "clean-app" + And a modification time for a file named "build/index.html" + And a successfully built app at "clean-app" + Then the file "build/index.html" should not have been updated diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/unicode_filenames.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/unicode_filenames.feature new file mode 100644 index 00000000000..cf592e415c3 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/unicode_filenames.feature @@ -0,0 +1,36 @@ +@encoding @travishatesme @wip + +Feature: Unicode filenames + In order to support non-ASCII characters in filenames + + Scenario: Build with files containing unicode characters in their name + Given a fixture app "empty-app" + And a file named "config.rb" with: + """ + """ + And a file named "source/snowmen-rule-☃.html" with: + """ + Snowman! +
      + ☃ +
      + """ + And a successfully built app at "empty-app" + When I cd to "build" + Then the file "snowmen-rule-☃.html" should contain "☃" + + Scenario: Preview with files containing unicode characters in their name + Given a fixture app "empty-app" + And a file named "config.rb" with: + """ + """ + And a file named "source/snowmen-rule-☃.html" with: + """ + Snowman! +
      + ☃ +
      + """ + And the Server is running + When I go to "/snowmen-rule-☃.html" + Then I should see "Snowman!" \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/v4_extension_callbacks.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/v4_extension_callbacks.feature new file mode 100644 index 00000000000..6ce04b1e8b8 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/v4_extension_callbacks.feature @@ -0,0 +1,8 @@ +Feature: v4 Extensions should have after_activated hooks + + Scenario: Hello Helper + Given the Server is running at "v4-extension-callbacks" + Then going to "/index.html" should not raise an exception + And I should see "Extension One: true" + And I should see "Extension Two: true" + \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/wildcard_page_helper.feature b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/wildcard_page_helper.feature new file mode 100644 index 00000000000..9dd21b2b1c5 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/features/wildcard_page_helper.feature @@ -0,0 +1,10 @@ +Feature: Wildcards in Page helper + + Scenario: Setting the layout for a folder + Given the Server is running at "wildcard-app" + When I go to "/index.html" + Then I should see "Normal Layout" + When I go to "/admin/index.html" + Then I should see "Admin Layout" + When I go to "/admin/page.html" + Then I should see "Admin Layout" \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/config.rb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/config.rb new file mode 100644 index 00000000000..1327d8f0747 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/config.rb @@ -0,0 +1,6 @@ + +activate :asset_hash + +activate :relative_assets + +activate :directory_indexes diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/lib/middleware.rb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/lib/middleware.rb new file mode 100644 index 00000000000..8ee825fde20 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/lib/middleware.rb @@ -0,0 +1,16 @@ +class Middleware + def initialize(app) + @app = app + end + + def call(env) + status, headers, response = @app.call(env) + body = '' + response.each {|part| body += part } + if (env["PATH_INFO"] =~ /css$/) + body += "\n/* Added by Rack filter */" + status, headers, response = Rack::Response.new(body, status, headers).finish + end + [status, headers, response] + end +end diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/api.json.erb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/api.json.erb new file mode 100644 index 00000000000..bc2af59a7cd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/api.json.erb @@ -0,0 +1 @@ +<%= {gif: image_path('100px.gif'), jpg: image_path('100px.jpg'), png: image_path('100px.png')}.to_json %> diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/apple-touch-icon.png b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/apple-touch-icon.png new file mode 100644 index 00000000000..a78f68b8ee1 Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/apple-touch-icon.png differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/favicon.ico b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/favicon.ico new file mode 100644 index 00000000000..d1d026a8b7e Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/favicon.ico differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/fonts/fontawesome-webfont.woff b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/fonts/fontawesome-webfont.woff new file mode 100644 index 00000000000..8b280b98fa2 Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/fonts/fontawesome-webfont.woff differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/fonts/fontawesome-webfont.woff2 b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/fonts/fontawesome-webfont.woff2 new file mode 100644 index 00000000000..3311d585145 Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/fonts/fontawesome-webfont.woff2 differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/100px.gif b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/100px.gif new file mode 100644 index 00000000000..557d0278134 Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/100px.gif differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/100px.jpg b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/100px.jpg new file mode 100644 index 00000000000..557d0278134 Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/100px.jpg differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/100px.png b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/100px.png new file mode 100644 index 00000000000..a78f68b8ee1 Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/100px.png differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/200px.jpg b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/200px.jpg new file mode 100644 index 00000000000..1a23674756d Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/200px.jpg differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/300px.jpg b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/300px.jpg new file mode 100644 index 00000000000..5a1d9e03eb5 Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/images/300px.jpg differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/index.html.erb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/index.html.erb new file mode 100644 index 00000000000..de017654b77 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/index.html.erb @@ -0,0 +1,314 @@ +<% content_for :head do %> + The Middleman! +<% end %> + +

      Image url:

      + 1x, <%= image_path('200px.jpg') %> 2x, <%= image_path('300px.jpg') %> 3x"> +<%= image_tag('100px.jpg?test') %> +<%= image_tag('100px.jpg?#test') %> +<%= image_tag('100px.jpg#test') %> + +

      Ignored path:

      + + +

      Autogenerated tests:

      +

      images/100px.jpg

      +

      /images/100px.jpg

      +

      ../images/100px.jpg

      +

      ../../images/100px.jpg

      +

      ../../../images/100px.jpg

      +

      http://example.com/images/100px.jpg

      +

      aimages/100px.jpga

      +

      1images/100px.jpg1

      +

      .images/100px.jpg.

      +

      -images/100px.jpg-

      +

      _images/100px.jpg_

      +

      'images/100px.jpg'

      +

      '/images/100px.jpg'

      +

      '../images/100px.jpg'

      +

      '../../images/100px.jpg'

      +

      '../../../images/100px.jpg'

      +

      'http://example.com/images/100px.jpg'

      +

      'aimages/100px.jpga'

      +

      '1images/100px.jpg1'

      +

      '.images/100px.jpg.'

      +

      '-images/100px.jpg-'

      +

      '_images/100px.jpg_'

      +

      "images/100px.jpg"

      +

      "/images/100px.jpg"

      +

      "../images/100px.jpg"

      +

      "../../images/100px.jpg"

      +

      "../../../images/100px.jpg"

      +

      "http://example.com/images/100px.jpg"

      +

      "aimages/100px.jpga"

      +

      "1images/100px.jpg1"

      +

      ".images/100px.jpg."

      +

      "-images/100px.jpg-"

      +

      "_images/100px.jpg_"

      +

      <img src=images/100px.jpg />

      +

      <img src=/images/100px.jpg />

      +

      <img src=../images/100px.jpg />

      +

      <img src=../../images/100px.jpg />

      +

      <img src=../../../images/100px.jpg />

      +

      <img src=http://example.com/images/100px.jpg />

      +

      <img src=aimages/100px.jpga />

      +

      <img src=1images/100px.jpg1 />

      +

      <img src=.images/100px.jpg. />

      +

      <img src=-images/100px.jpg- />

      +

      <img src=_images/100px.jpg_ />

      +

      <img src='http://github.com/images/100px.jpg' />

      +

      <img src='http://github.com/images/100px.jpg' />

      +

      <img src='http://github.com/images/100px.jpg' />

      +

      <img src='http://github.com/images/100px.jpg' />

      +

      <img src='http://github.com/images/100px.jpg' />

      +

      <img src='http://example.com/images/100px.jpg' />

      +

      <img src='http://github.com/aimages/100px.jpga' />

      +

      <img src='http://github.com/1images/100px.jpg1' />

      +

      <img src='http://github.com/.images/100px.jpg.' />

      +

      <img src='http://github.com/-images/100px.jpg-' />

      +

      <img src='http://github.com/_images/100px.jpg_' />

      +

      <img src="http://github.com/images/100px.jpg" />

      +

      <img src="http://github.com/images/100px.jpg" />

      +

      <img src="http://github.com/images/100px.jpg" />

      +

      <img src="http://github.com/images/100px.jpg" />

      +

      <img src="http://github.com/images/100px.jpg" />

      +

      <img src="http://example.com/images/100px.jpg" />

      +

      <img src="http://github.com/aimages/100px.jpga" />

      +

      <img src="http://github.com/1images/100px.jpg1" />

      +

      <img src="http://github.com/.images/100px.jpg." />

      +

      <img src="http://github.com/-images/100px.jpg-" />

      +

      <img src="http://github.com/_images/100px.jpg_" />

      +

      background-image:url(http://github.com/images/100px.jpg);

      +

      background-image:url(http://github.com/images/100px.jpg);

      +

      background-image:url(http://github.com/images/100px.jpg);

      +

      background-image:url(http://github.com/images/100px.jpg);

      +

      background-image:url(http://github.com/images/100px.jpg);

      +

      background-image:url(http://example.com/images/100px.jpg);

      +

      background-image:url(http://github.com/aimages/100px.jpga);

      +

      background-image:url(http://github.com/1images/100px.jpg1);

      +

      background-image:url(http://github.com/.images/100px.jpg.);

      +

      background-image:url(http://github.com/-images/100px.jpg-);

      +

      background-image:url(http://github.com/_images/100px.jpg_);

      +

      background-image:url('http://github.com/images/100px.jpg');

      +

      background-image:url('http://github.com/images/100px.jpg');

      +

      background-image:url('http://github.com/images/100px.jpg');

      +

      background-image:url('http://github.com/images/100px.jpg');

      +

      background-image:url('http://github.com/images/100px.jpg');

      +

      background-image:url('http://example.com/images/100px.jpg');

      +

      background-image:url('http://github.com/aimages/100px.jpga');

      +

      background-image:url('http://github.com/1images/100px.jpg1');

      +

      background-image:url('http://github.com/.images/100px.jpg.');

      +

      background-image:url('http://github.com/-images/100px.jpg-');

      +

      background-image:url('http://github.com/_images/100px.jpg_');

      +

      background-image:url("http://github.com/images/100px.jpg");

      +

      background-image:url("http://github.com/images/100px.jpg");

      +

      background-image:url("http://github.com/images/100px.jpg");

      +

      background-image:url("http://github.com/images/100px.jpg");

      +

      background-image:url("http://github.com/images/100px.jpg");

      +

      background-image:url("http://example.com/images/100px.jpg");

      +

      background-image:url("http://github.com/aimages/100px.jpga");

      +

      background-image:url("http://github.com/1images/100px.jpg1");

      +

      background-image:url("http://github.com/.images/100px.jpg.");

      +

      background-image:url("http://github.com/-images/100px.jpg-");

      +

      background-image:url("http://github.com/_images/100px.jpg_");

      +


      +

      images/100px.png

      +

      /images/100px.png

      +

      ../images/100px.png

      +

      ../../images/100px.png

      +

      ../../../images/100px.png

      +

      http://example.com/images/100px.png

      +

      aimages/100px.pnga

      +

      1images/100px.png1

      +

      .images/100px.png.

      +

      -images/100px.png-

      +

      _images/100px.png_

      +

      'images/100px.png'

      +

      '/images/100px.png'

      +

      '../images/100px.png'

      +

      '../../images/100px.png'

      +

      '../../../images/100px.png'

      +

      'http://example.com/images/100px.png'

      +

      'aimages/100px.pnga'

      +

      '1images/100px.png1'

      +

      '.images/100px.png.'

      +

      '-images/100px.png-'

      +

      '_images/100px.png_'

      +

      "images/100px.png"

      +

      "/images/100px.png"

      +

      "../images/100px.png"

      +

      "../../images/100px.png"

      +

      "../../../images/100px.png"

      +

      "http://example.com/images/100px.png"

      +

      "aimages/100px.pnga"

      +

      "1images/100px.png1"

      +

      ".images/100px.png."

      +

      "-images/100px.png-"

      +

      "_images/100px.png_"

      +

      <img src=images/100px.png />

      +

      <img src=/images/100px.png />

      +

      <img src=../images/100px.png />

      +

      <img src=../../images/100px.png />

      +

      <img src=../../../images/100px.png />

      +

      <img src=http://example.com/images/100px.png />

      +

      <img src=aimages/100px.pnga />

      +

      <img src=1images/100px.png1 />

      +

      <img src=.images/100px.png. />

      +

      <img src=-images/100px.png- />

      +

      <img src=_images/100px.png_ />

      +

      <img src='http://github.com/images/100px.png' />

      +

      <img src='http://github.com/images/100px.png' />

      +

      <img src='http://github.com/images/100px.png' />

      +

      <img src='http://github.com/images/100px.png' />

      +

      <img src='http://github.com/images/100px.png' />

      +

      <img src='http://example.com/images/100px.png' />

      +

      <img src='http://github.com/aimages/100px.pnga' />

      +

      <img src='http://github.com/1images/100px.png1' />

      +

      <img src='http://github.com/.images/100px.png.' />

      +

      <img src='http://github.com/-images/100px.png-' />

      +

      <img src='http://github.com/_images/100px.png_' />

      +

      <img src="http://github.com/images/100px.png" />

      +

      <img src="http://github.com/images/100px.png" />

      +

      <img src="http://github.com/images/100px.png" />

      +

      <img src="http://github.com/images/100px.png" />

      +

      <img src="http://github.com/images/100px.png" />

      +

      <img src="http://example.com/images/100px.png" />

      +

      <img src="http://github.com/aimages/100px.pnga" />

      +

      <img src="http://github.com/1images/100px.png1" />

      +

      <img src="http://github.com/.images/100px.png." />

      +

      <img src="http://github.com/-images/100px.png-" />

      +

      <img src="http://github.com/_images/100px.png_" />

      +

      background-image:url(http://github.com/images/100px.png);

      +

      background-image:url(http://github.com/images/100px.png);

      +

      background-image:url(http://github.com/images/100px.png);

      +

      background-image:url(http://github.com/images/100px.png);

      +

      background-image:url(http://github.com/images/100px.png);

      +

      background-image:url(http://example.com/images/100px.png);

      +

      background-image:url(http://github.com/aimages/100px.pnga);

      +

      background-image:url(http://github.com/1images/100px.png1);

      +

      background-image:url(http://github.com/.images/100px.png.);

      +

      background-image:url(http://github.com/-images/100px.png-);

      +

      background-image:url(http://github.com/_images/100px.png_);

      +

      background-image:url('http://github.com/images/100px.png');

      +

      background-image:url('http://github.com/images/100px.png');

      +

      background-image:url('http://github.com/images/100px.png');

      +

      background-image:url('http://github.com/images/100px.png');

      +

      background-image:url('http://github.com/images/100px.png');

      +

      background-image:url('http://example.com/images/100px.png');

      +

      background-image:url('http://github.com/aimages/100px.pnga');

      +

      background-image:url('http://github.com/1images/100px.png1');

      +

      background-image:url('http://github.com/.images/100px.png.');

      +

      background-image:url('http://github.com/-images/100px.png-');

      +

      background-image:url('http://github.com/_images/100px.png_');

      +

      background-image:url("http://github.com/images/100px.png");

      +

      background-image:url("http://github.com/images/100px.png");

      +

      background-image:url("http://github.com/images/100px.png");

      +

      background-image:url("http://github.com/images/100px.png");

      +

      background-image:url("http://github.com/images/100px.png");

      +

      background-image:url("http://example.com/images/100px.png");

      +

      background-image:url("http://github.com/aimages/100px.pnga");

      +

      background-image:url("http://github.com/1images/100px.png1");

      +

      background-image:url("http://github.com/.images/100px.png.");

      +

      background-image:url("http://github.com/-images/100px.png-");

      +

      background-image:url("http://github.com/_images/100px.png_");

      +


      +

      images/100px.gif

      +

      /images/100px.gif

      +

      ../images/100px.gif

      +

      ../../images/100px.gif

      +

      ../../../images/100px.gif

      +

      http://example.com/images/100px.gif

      +

      aimages/100px.gifa

      +

      1images/100px.gif1

      +

      .images/100px.gif.

      +

      -images/100px.gif-

      +

      _images/100px.gif_

      +

      'images/100px.gif'

      +

      '/images/100px.gif'

      +

      '../images/100px.gif'

      +

      '../../images/100px.gif'

      +

      '../../../images/100px.gif'

      +

      'http://example.com/images/100px.gif'

      +

      'aimages/100px.gifa'

      +

      '1images/100px.gif1'

      +

      '.images/100px.gif.'

      +

      '-images/100px.gif-'

      +

      '_images/100px.gif_'

      +

      "images/100px.gif"

      +

      "/images/100px.gif"

      +

      "../images/100px.gif"

      +

      "../../images/100px.gif"

      +

      "../../../images/100px.gif"

      +

      "http://example.com/images/100px.gif"

      +

      "aimages/100px.gifa"

      +

      "1images/100px.gif1"

      +

      ".images/100px.gif."

      +

      "-images/100px.gif-"

      +

      "_images/100px.gif_"

      +

      <img src=images/100px.gif />

      +

      <img src=/images/100px.gif />

      +

      <img src=../images/100px.gif />

      +

      <img src=../../images/100px.gif />

      +

      <img src=../../../images/100px.gif />

      +

      <img src=http://example.com/images/100px.gif />

      +

      <img src=aimages/100px.gifa />

      +

      <img src=1images/100px.gif1 />

      +

      <img src=.images/100px.gif. />

      +

      <img src=-images/100px.gif- />

      +

      <img src=_images/100px.gif_ />

      +

      <img src='http://github.com/images/100px.gif' />

      +

      <img src='http://github.com/images/100px.gif' />

      +

      <img src='http://github.com/images/100px.gif' />

      +

      <img src='http://github.com/images/100px.gif' />

      +

      <img src='http://github.com/images/100px.gif' />

      +

      <img src='http://example.com/images/100px.gif' />

      +

      <img src='http://github.com/aimages/100px.gifa' />

      +

      <img src='http://github.com/1images/100px.gif1' />

      +

      <img src='http://github.com/.images/100px.gif.' />

      +

      <img src='http://github.com/-images/100px.gif-' />

      +

      <img src='http://github.com/_images/100px.gif_' />

      +

      <img src="http://github.com/images/100px.gif" />

      +

      <img src="http://github.com/images/100px.gif" />

      +

      <img src="http://github.com/images/100px.gif" />

      +

      <img src="http://github.com/images/100px.gif" />

      +

      <img src="http://github.com/images/100px.gif" />

      +

      <img src="http://example.com/images/100px.gif" />

      +

      <img src="http://github.com/aimages/100px.gifa" />

      +

      <img src="http://github.com/1images/100px.gif1" />

      +

      <img src="http://github.com/.images/100px.gif." />

      +

      <img src="http://github.com/-images/100px.gif-" />

      +

      <img src="http://github.com/_images/100px.gif_" />

      +

      background-image:url(http://github.com/images/100px.gif);

      +

      background-image:url(http://github.com/images/100px.gif);

      +

      background-image:url(http://github.com/images/100px.gif);

      +

      background-image:url(http://github.com/images/100px.gif);

      +

      background-image:url(http://github.com/images/100px.gif);

      +

      background-image:url(http://example.com/images/100px.gif);

      +

      background-image:url(http://github.com/aimages/100px.gifa);

      +

      background-image:url(http://github.com/1images/100px.gif1);

      +

      background-image:url(http://github.com/.images/100px.gif.);

      +

      background-image:url(http://github.com/-images/100px.gif-);

      +

      background-image:url(http://github.com/_images/100px.gif_);

      +

      background-image:url('http://github.com/images/100px.gif');

      +

      background-image:url('http://github.com/images/100px.gif');

      +

      background-image:url('http://github.com/images/100px.gif');

      +

      background-image:url('http://github.com/images/100px.gif');

      +

      background-image:url('http://github.com/images/100px.gif');

      +

      background-image:url('http://example.com/images/100px.gif');

      +

      background-image:url('http://github.com/aimages/100px.gifa');

      +

      background-image:url('http://github.com/1images/100px.gif1');

      +

      background-image:url('http://github.com/.images/100px.gif.');

      +

      background-image:url('http://github.com/-images/100px.gif-');

      +

      background-image:url('http://github.com/_images/100px.gif_');

      +

      background-image:url("http://github.com/images/100px.gif");

      +

      background-image:url("http://github.com/images/100px.gif");

      +

      background-image:url("http://github.com/images/100px.gif");

      +

      background-image:url("http://github.com/images/100px.gif");

      +

      background-image:url("http://github.com/images/100px.gif");

      +

      background-image:url("http://example.com/images/100px.gif");

      +

      background-image:url("http://github.com/aimages/100px.gifa");

      +

      background-image:url("http://github.com/1images/100px.gif1");

      +

      background-image:url("http://github.com/.images/100px.gif.");

      +

      background-image:url("http://github.com/-images/100px.gif-");

      +

      background-image:url("http://github.com/_images/100px.gif_");

      +


      diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/javascripts/application.js b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/javascripts/application.js new file mode 100644 index 00000000000..7402bc833e2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/javascripts/application.js @@ -0,0 +1,8 @@ +function foo() { + var img = document.createElement('img'); + img.src = '/images/100px.jpg'; + var body = document.getElementsByTagName('body')[0]; + body.insertBefore(img, body.firstChild); +} + +window.onload = foo; \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/layout.erb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/layout.erb new file mode 100644 index 00000000000..3a1079a71ab --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/layout.erb @@ -0,0 +1,18 @@ + + + + + + <%= stylesheet_link_tag "site", "fragment" %> + <%= javascript_include_tag "application" %> + <%= yield_content :head %> + + + + +
      + <%= yield %> +
      + + + diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/other.html.erb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/other.html.erb new file mode 100644 index 00000000000..cc2589366f2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/other.html.erb @@ -0,0 +1,5 @@ +

      Image url:

      + + + + diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/partials.html.erb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/partials.html.erb new file mode 100644 index 00000000000..6b5aa4bf62c --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/partials.html.erb @@ -0,0 +1 @@ +<%= stylesheet_link_tag 'uses_partials' %> diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/slim.html.slim b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/slim.html.slim new file mode 100644 index 00000000000..dc74a5eee06 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/slim.html.slim @@ -0,0 +1,8 @@ +--- +directory_index: false +layout: false +--- + += image_tag '100px.jpg', srcset: "100px.jpg 1x, 200px.jpg 2x, 300px.jpg 3x" + += image_tag "300px.jpg" \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/_partial.sass b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/_partial.sass new file mode 100644 index 00000000000..3b0e67db5e4 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/_partial.sass @@ -0,0 +1,2 @@ +body + font-size: 18px \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/fragment.css.scss b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/fragment.css.scss new file mode 100644 index 00000000000..4e175489e68 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/fragment.css.scss @@ -0,0 +1,7 @@ +#main { + padding: 50px; + background-image: image-url('http://github.com/100px.jpg'); + background-image: image-url('http://github.com/100px.jpg?test'); + background-image: image-url('http://github.com/100px.jpg?#test'); + background-image: image-url('http://github.com/100px.jpg#test'); +} diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/site.css.scss b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/site.css.scss new file mode 100644 index 00000000000..58d760bc5bd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/site.css.scss @@ -0,0 +1,4 @@ +#main { + padding: 50px; + background-image: url('http://github.com/images/100px.jpg'); +} diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/uses_fonts.css b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/uses_fonts.css new file mode 100644 index 00000000000..629429d064e --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/uses_fonts.css @@ -0,0 +1,4 @@ +@font-face { + font-family: 'FontAwesome'; + src: url('http://github.com/fonts/fontawesome-webfont.woff2') format('woff2'), url('http://github.com/fonts/fontawesome-webfont.woff') format('woff'); +} diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/uses_partials.css.sass b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/uses_partials.css.sass new file mode 100644 index 00000000000..66b4dfd6a69 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/stylesheets/uses_partials.css.sass @@ -0,0 +1,4 @@ +@import partial.sass + +red + color: blue \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/subdir/api.json.erb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/subdir/api.json.erb new file mode 100644 index 00000000000..bc2af59a7cd --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/subdir/api.json.erb @@ -0,0 +1 @@ +<%= {gif: image_path('100px.gif'), jpg: image_path('100px.jpg'), png: image_path('100px.png')}.to_json %> diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/subdir/index.html.erb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/subdir/index.html.erb new file mode 100644 index 00000000000..79f12390454 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-app/source/subdir/index.html.erb @@ -0,0 +1,317 @@ +<% content_for :head do %> + The Middleman! +<% end %> + +

      Abs

      +

      http://example.com/test.jpg

      + +

      Image url:

      +

      + +

      Image url2:

      +

      <%= image_tag('200px.jpg') %>

      + +

      Image url3:

      +

      + +

      Autogenerated tests:

      +

      images/100px.jpg

      +

      /images/100px.jpg

      +

      ../images/100px.jpg

      +

      ../../images/100px.jpg

      +

      ../../../images/100px.jpg

      +

      http://example.com/images/100px.jpg

      +

      aimages/100px.jpga

      +

      1images/100px.jpg1

      +

      .images/100px.jpg.

      +

      -images/100px.jpg-

      +

      _images/100px.jpg_

      +

      'images/100px.jpg'

      +

      '/images/100px.jpg'

      +

      '../images/100px.jpg'

      +

      '../../images/100px.jpg'

      +

      '../../../images/100px.jpg'

      +

      'http://example.com/images/100px.jpg'

      +

      'aimages/100px.jpga'

      +

      '1images/100px.jpg1'

      +

      '.images/100px.jpg.'

      +

      '-images/100px.jpg-'

      +

      '_images/100px.jpg_'

      +

      "images/100px.jpg"

      +

      "/images/100px.jpg"

      +

      "../images/100px.jpg"

      +

      "../../images/100px.jpg"

      +

      "../../../images/100px.jpg"

      +

      "http://example.com/images/100px.jpg"

      +

      "aimages/100px.jpga"

      +

      "1images/100px.jpg1"

      +

      ".images/100px.jpg."

      +

      "-images/100px.jpg-"

      +

      "_images/100px.jpg_"

      +

      <img src=images/100px.jpg />

      +

      <img src=/images/100px.jpg />

      +

      <img src=../images/100px.jpg />

      +

      <img src=../../images/100px.jpg />

      +

      <img src=../../../images/100px.jpg />

      +

      <img src=http://example.com/images/100px.jpg />

      +

      <img src=aimages/100px.jpga />

      +

      <img src=1images/100px.jpg1 />

      +

      <img src=.images/100px.jpg. />

      +

      <img src=-images/100px.jpg- />

      +

      <img src=_images/100px.jpg_ />

      +

      <img src='http://github.com/images/100px.jpg' />

      +

      <img src='http://github.com/images/100px.jpg' />

      +

      <img src='http://github.com/images/100px.jpg' />

      +

      <img src='http://github.com/images/100px.jpg' />

      +

      <img src='http://github.com/images/100px.jpg' />

      +

      <img src='http://example.com/images/100px.jpg' />

      +

      <img src='http://github.com/aimages/100px.jpga' />

      +

      <img src='http://github.com/1images/100px.jpg1' />

      +

      <img src='http://github.com/.images/100px.jpg.' />

      +

      <img src='http://github.com/-images/100px.jpg-' />

      +

      <img src='http://github.com/_images/100px.jpg_' />

      +

      <img src="http://github.com/images/100px.jpg" />

      +

      <img src="http://github.com/images/100px.jpg" />

      +

      <img src="http://github.com/images/100px.jpg" />

      +

      <img src="http://github.com/images/100px.jpg" />

      +

      <img src="http://github.com/images/100px.jpg" />

      +

      <img src="http://example.com/images/100px.jpg" />

      +

      <img src="http://github.com/aimages/100px.jpga" />

      +

      <img src="http://github.com/1images/100px.jpg1" />

      +

      <img src="http://github.com/.images/100px.jpg." />

      +

      <img src="http://github.com/-images/100px.jpg-" />

      +

      <img src="http://github.com/_images/100px.jpg_" />

      +

      background-image:url(http://github.com/images/100px.jpg);

      +

      background-image:url(http://github.com/images/100px.jpg);

      +

      background-image:url(http://github.com/images/100px.jpg);

      +

      background-image:url(http://github.com/images/100px.jpg);

      +

      background-image:url(http://github.com/images/100px.jpg);

      +

      background-image:url(http://example.com/images/100px.jpg);

      +

      background-image:url(http://github.com/aimages/100px.jpga);

      +

      background-image:url(http://github.com/1images/100px.jpg1);

      +

      background-image:url(http://github.com/.images/100px.jpg.);

      +

      background-image:url(http://github.com/-images/100px.jpg-);

      +

      background-image:url(http://github.com/_images/100px.jpg_);

      +

      background-image:url('http://github.com/images/100px.jpg');

      +

      background-image:url('http://github.com/images/100px.jpg');

      +

      background-image:url('http://github.com/images/100px.jpg');

      +

      background-image:url('http://github.com/images/100px.jpg');

      +

      background-image:url('http://github.com/images/100px.jpg');

      +

      background-image:url('http://example.com/images/100px.jpg');

      +

      background-image:url('http://github.com/aimages/100px.jpga');

      +

      background-image:url('http://github.com/1images/100px.jpg1');

      +

      background-image:url('http://github.com/.images/100px.jpg.');

      +

      background-image:url('http://github.com/-images/100px.jpg-');

      +

      background-image:url('http://github.com/_images/100px.jpg_');

      +

      background-image:url("http://github.com/images/100px.jpg");

      +

      background-image:url("http://github.com/images/100px.jpg");

      +

      background-image:url("http://github.com/images/100px.jpg");

      +

      background-image:url("http://github.com/images/100px.jpg");

      +

      background-image:url("http://github.com/images/100px.jpg");

      +

      background-image:url("http://example.com/images/100px.jpg");

      +

      background-image:url("http://github.com/aimages/100px.jpga");

      +

      background-image:url("http://github.com/1images/100px.jpg1");

      +

      background-image:url("http://github.com/.images/100px.jpg.");

      +

      background-image:url("http://github.com/-images/100px.jpg-");

      +

      background-image:url("http://github.com/_images/100px.jpg_");

      +


      +

      images/100px.png

      +

      /images/100px.png

      +

      ../images/100px.png

      +

      ../../images/100px.png

      +

      ../../../images/100px.png

      +

      http://example.com/images/100px.png

      +

      aimages/100px.pnga

      +

      1images/100px.png1

      +

      .images/100px.png.

      +

      -images/100px.png-

      +

      _images/100px.png_

      +

      'images/100px.png'

      +

      '/images/100px.png'

      +

      '../images/100px.png'

      +

      '../../images/100px.png'

      +

      '../../../images/100px.png'

      +

      'http://example.com/images/100px.png'

      +

      'aimages/100px.pnga'

      +

      '1images/100px.png1'

      +

      '.images/100px.png.'

      +

      '-images/100px.png-'

      +

      '_images/100px.png_'

      +

      "images/100px.png"

      +

      "/images/100px.png"

      +

      "../images/100px.png"

      +

      "../../images/100px.png"

      +

      "../../../images/100px.png"

      +

      "http://example.com/images/100px.png"

      +

      "aimages/100px.pnga"

      +

      "1images/100px.png1"

      +

      ".images/100px.png."

      +

      "-images/100px.png-"

      +

      "_images/100px.png_"

      +

      <img src=images/100px.png />

      +

      <img src=/images/100px.png />

      +

      <img src=../images/100px.png />

      +

      <img src=../../images/100px.png />

      +

      <img src=../../../images/100px.png />

      +

      <img src=http://example.com/images/100px.png />

      +

      <img src=aimages/100px.pnga />

      +

      <img src=1images/100px.png1 />

      +

      <img src=.images/100px.png. />

      +

      <img src=-images/100px.png- />

      +

      <img src=_images/100px.png_ />

      +

      <img src='http://github.com/images/100px.png' />

      +

      <img src='http://github.com/images/100px.png' />

      +

      <img src='http://github.com/images/100px.png' />

      +

      <img src='http://github.com/images/100px.png' />

      +

      <img src='http://github.com/images/100px.png' />

      +

      <img src='http://example.com/images/100px.png' />

      +

      <img src='http://github.com/aimages/100px.pnga' />

      +

      <img src='http://github.com/1images/100px.png1' />

      +

      <img src='http://github.com/.images/100px.png.' />

      +

      <img src='http://github.com/-images/100px.png-' />

      +

      <img src='http://github.com/_images/100px.png_' />

      +

      <img src="http://github.com/images/100px.png" />

      +

      <img src="http://github.com/images/100px.png" />

      +

      <img src="http://github.com/images/100px.png" />

      +

      <img src="http://github.com/images/100px.png" />

      +

      <img src="http://github.com/images/100px.png" />

      +

      <img src="http://example.com/images/100px.png" />

      +

      <img src="http://github.com/aimages/100px.pnga" />

      +

      <img src="http://github.com/1images/100px.png1" />

      +

      <img src="http://github.com/.images/100px.png." />

      +

      <img src="http://github.com/-images/100px.png-" />

      +

      <img src="http://github.com/_images/100px.png_" />

      +

      background-image:url(http://github.com/images/100px.png);

      +

      background-image:url(http://github.com/images/100px.png);

      +

      background-image:url(http://github.com/images/100px.png);

      +

      background-image:url(http://github.com/images/100px.png);

      +

      background-image:url(http://github.com/images/100px.png);

      +

      background-image:url(http://example.com/images/100px.png);

      +

      background-image:url(http://github.com/aimages/100px.pnga);

      +

      background-image:url(http://github.com/1images/100px.png1);

      +

      background-image:url(http://github.com/.images/100px.png.);

      +

      background-image:url(http://github.com/-images/100px.png-);

      +

      background-image:url(http://github.com/_images/100px.png_);

      +

      background-image:url('http://github.com/images/100px.png');

      +

      background-image:url('http://github.com/images/100px.png');

      +

      background-image:url('http://github.com/images/100px.png');

      +

      background-image:url('http://github.com/images/100px.png');

      +

      background-image:url('http://github.com/images/100px.png');

      +

      background-image:url('http://example.com/images/100px.png');

      +

      background-image:url('http://github.com/aimages/100px.pnga');

      +

      background-image:url('http://github.com/1images/100px.png1');

      +

      background-image:url('http://github.com/.images/100px.png.');

      +

      background-image:url('http://github.com/-images/100px.png-');

      +

      background-image:url('http://github.com/_images/100px.png_');

      +

      background-image:url("http://github.com/images/100px.png");

      +

      background-image:url("http://github.com/images/100px.png");

      +

      background-image:url("http://github.com/images/100px.png");

      +

      background-image:url("http://github.com/images/100px.png");

      +

      background-image:url("http://github.com/images/100px.png");

      +

      background-image:url("http://example.com/images/100px.png");

      +

      background-image:url("http://github.com/aimages/100px.pnga");

      +

      background-image:url("http://github.com/1images/100px.png1");

      +

      background-image:url("http://github.com/.images/100px.png.");

      +

      background-image:url("http://github.com/-images/100px.png-");

      +

      background-image:url("http://github.com/_images/100px.png_");

      +


      +

      images/100px.gif

      +

      /images/100px.gif

      +

      ../images/100px.gif

      +

      ../../images/100px.gif

      +

      ../../../images/100px.gif

      +

      http://example.com/images/100px.gif

      +

      aimages/100px.gifa

      +

      1images/100px.gif1

      +

      .images/100px.gif.

      +

      -images/100px.gif-

      +

      _images/100px.gif_

      +

      'images/100px.gif'

      +

      '/images/100px.gif'

      +

      '../images/100px.gif'

      +

      '../../images/100px.gif'

      +

      '../../../images/100px.gif'

      +

      'http://example.com/images/100px.gif'

      +

      'aimages/100px.gifa'

      +

      '1images/100px.gif1'

      +

      '.images/100px.gif.'

      +

      '-images/100px.gif-'

      +

      '_images/100px.gif_'

      +

      "images/100px.gif"

      +

      "/images/100px.gif"

      +

      "../images/100px.gif"

      +

      "../../images/100px.gif"

      +

      "../../../images/100px.gif"

      +

      "http://example.com/images/100px.gif"

      +

      "aimages/100px.gifa"

      +

      "1images/100px.gif1"

      +

      ".images/100px.gif."

      +

      "-images/100px.gif-"

      +

      "_images/100px.gif_"

      +

      <img src=images/100px.gif />

      +

      <img src=/images/100px.gif />

      +

      <img src=../images/100px.gif />

      +

      <img src=../../images/100px.gif />

      +

      <img src=../../../images/100px.gif />

      +

      <img src=http://example.com/images/100px.gif />

      +

      <img src=aimages/100px.gifa />

      +

      <img src=1images/100px.gif1 />

      +

      <img src=.images/100px.gif. />

      +

      <img src=-images/100px.gif- />

      +

      <img src=_images/100px.gif_ />

      +

      <img src='http://github.com/images/100px.gif' />

      +

      <img src='http://github.com/images/100px.gif' />

      +

      <img src='http://github.com/images/100px.gif' />

      +

      <img src='http://github.com/images/100px.gif' />

      +

      <img src='http://github.com/images/100px.gif' />

      +

      <img src='http://example.com/images/100px.gif' />

      +

      <img src='http://github.com/aimages/100px.gifa' />

      +

      <img src='http://github.com/1images/100px.gif1' />

      +

      <img src='http://github.com/.images/100px.gif.' />

      +

      <img src='http://github.com/-images/100px.gif-' />

      +

      <img src='http://github.com/_images/100px.gif_' />

      +

      <img src="http://github.com/images/100px.gif" />

      +

      <img src="http://github.com/images/100px.gif" />

      +

      <img src="http://github.com/images/100px.gif" />

      +

      <img src="http://github.com/images/100px.gif" />

      +

      <img src="http://github.com/images/100px.gif" />

      +

      <img src="http://example.com/images/100px.gif" />

      +

      <img src="http://github.com/aimages/100px.gifa" />

      +

      <img src="http://github.com/1images/100px.gif1" />

      +

      <img src="http://github.com/.images/100px.gif." />

      +

      <img src="http://github.com/-images/100px.gif-" />

      +

      <img src="http://github.com/_images/100px.gif_" />

      +

      background-image:url(http://github.com/images/100px.gif);

      +

      background-image:url(http://github.com/images/100px.gif);

      +

      background-image:url(http://github.com/images/100px.gif);

      +

      background-image:url(http://github.com/images/100px.gif);

      +

      background-image:url(http://github.com/images/100px.gif);

      +

      background-image:url(http://example.com/images/100px.gif);

      +

      background-image:url(http://github.com/aimages/100px.gifa);

      +

      background-image:url(http://github.com/1images/100px.gif1);

      +

      background-image:url(http://github.com/.images/100px.gif.);

      +

      background-image:url(http://github.com/-images/100px.gif-);

      +

      background-image:url(http://github.com/_images/100px.gif_);

      +

      background-image:url('http://github.com/images/100px.gif');

      +

      background-image:url('http://github.com/images/100px.gif');

      +

      background-image:url('http://github.com/images/100px.gif');

      +

      background-image:url('http://github.com/images/100px.gif');

      +

      background-image:url('http://github.com/images/100px.gif');

      +

      background-image:url('http://example.com/images/100px.gif');

      +

      background-image:url('http://github.com/aimages/100px.gifa');

      +

      background-image:url('http://github.com/1images/100px.gif1');

      +

      background-image:url('http://github.com/.images/100px.gif.');

      +

      background-image:url('http://github.com/-images/100px.gif-');

      +

      background-image:url('http://github.com/_images/100px.gif_');

      +

      background-image:url("http://github.com/images/100px.gif");

      +

      background-image:url("http://github.com/images/100px.gif");

      +

      background-image:url("http://github.com/images/100px.gif");

      +

      background-image:url("http://github.com/images/100px.gif");

      +

      background-image:url("http://github.com/images/100px.gif");

      +

      background-image:url("http://example.com/images/100px.gif");

      +

      background-image:url("http://github.com/aimages/100px.gifa");

      +

      background-image:url("http://github.com/1images/100px.gif1");

      +

      background-image:url("http://github.com/.images/100px.gif.");

      +

      background-image:url("http://github.com/-images/100px.gif-");

      +

      background-image:url("http://github.com/_images/100px.gif_");

      +


      diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/images/100px.gif b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/images/100px.gif new file mode 100644 index 00000000000..557d0278134 Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/images/100px.gif differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/images/100px.jpg b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/images/100px.jpg new file mode 100644 index 00000000000..557d0278134 Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/images/100px.jpg differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/images/100px.png b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/images/100px.png new file mode 100644 index 00000000000..a78f68b8ee1 Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/images/100px.png differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/index.html.erb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/index.html.erb new file mode 100644 index 00000000000..c9fefc2a8e8 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/index.html.erb @@ -0,0 +1,9 @@ +<% content_for :head do %> + The Middleman! +<% end %> + +

      Image url:

      + +<%= image_tag('100px.jpg?test') %> +<%= image_tag('100px.jpg?#test') %> +<%= image_tag('100px.jpg#test') %> diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/layout.erb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/layout.erb new file mode 100644 index 00000000000..a6aa4a0c829 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/layout.erb @@ -0,0 +1,17 @@ + + + + + + <%= stylesheet_link_tag "site", "fragment" %> + <%= yield_content :head %> + + + + +
      + <%= yield %> +
      + + + diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/other.html.erb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/other.html.erb new file mode 100644 index 00000000000..cc2589366f2 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/other.html.erb @@ -0,0 +1,5 @@ +

      Image url:

      + + + + diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/stylesheets/fragment.css.scss b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/stylesheets/fragment.css.scss new file mode 100644 index 00000000000..4e175489e68 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/stylesheets/fragment.css.scss @@ -0,0 +1,7 @@ +#main { + padding: 50px; + background-image: image-url('http://github.com/100px.jpg'); + background-image: image-url('http://github.com/100px.jpg?test'); + background-image: image-url('http://github.com/100px.jpg?#test'); + background-image: image-url('http://github.com/100px.jpg#test'); +} diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/stylesheets/site.css.scss b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/stylesheets/site.css.scss new file mode 100644 index 00000000000..0d193a5cd48 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/stylesheets/site.css.scss @@ -0,0 +1,4 @@ +#main { + padding: 50px; + background-image: image-url('http://github.com/100px.jpg'); +} \ No newline at end of file diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/subdir/index.html.erb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/subdir/index.html.erb new file mode 100644 index 00000000000..3616ba64297 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-host-app/source/subdir/index.html.erb @@ -0,0 +1,6 @@ +<% content_for :head do %> + The Middleman! +<% end %> + +

      Image url:

      +<%= image_tag('100px.jpg') %> diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-minified-app/config.rb b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-minified-app/config.rb new file mode 100644 index 00000000000..94db1542e26 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-minified-app/config.rb @@ -0,0 +1,5 @@ +configure :build do + # Minify Javascript on build + activate :minify_javascript + activate :asset_hash +end diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-minified-app/source/images/100px.jpg b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-minified-app/source/images/100px.jpg new file mode 100644 index 00000000000..557d0278134 Binary files /dev/null and b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-minified-app/source/images/100px.jpg differ diff --git a/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-minified-app/source/javascripts/jquery.min.js b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-minified-app/source/javascripts/jquery.min.js new file mode 100644 index 00000000000..0f60b7bd0d9 --- /dev/null +++ b/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.2.1/fixtures/asset-hash-minified-app/source/javascripts/jquery.min.js @@ -0,0 +1,5 @@ +/*! jQuery v1.11.3 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */ +!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.3",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)+1>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b="length"in a&&a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C=1<<31,D={}.hasOwnProperty,E=[],F=E.pop,G=E.push,H=E.push,I=E.slice,J=function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},K="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",N=M.replace("w","w#"),O="\\["+L+"*("+M+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+N+"))|)"+L+"*\\]",P=":("+M+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+O+")*)|.*)\\)|)",Q=new RegExp(L+"+","g"),R=new RegExp("^"+L+"+|((?:^|[^\\\\])(?:\\\\.)*)"+L+"+$","g"),S=new RegExp("^"+L+"*,"+L+"*"),T=new RegExp("^"+L+"*([>+~]|"+L+")"+L+"*"),U=new RegExp("="+L+"*([^\\]'\"]*?)"+L+"*\\]","g"),V=new RegExp(P),W=new RegExp("^"+N+"$"),X={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+O),PSEUDO:new RegExp("^"+P),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+K+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,aa=/[+~]/,ba=/'|\\/g,ca=new RegExp("\\\\([\\da-f]{1,6}"+L+"?|("+L+")|.)","ig"),da=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ea=function(){m()};try{H.apply(E=I.call(v.childNodes),v.childNodes),E[v.childNodes.length].nodeType}catch(fa){H={apply:E.length?function(a,b){G.apply(a,I.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],k=b.nodeType,"string"!=typeof a||!a||1!==k&&9!==k&&11!==k)return d;if(!e&&p){if(11!==k&&(f=_.exec(a)))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return H.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName)return H.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=1!==k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(ba,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+ra(o[l]);w=aa.test(a)&&pa(b.parentNode)||b,x=o.join(",")}if(x)try{return H.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||C)-(~a.sourceIndex||C);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function pa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=g.documentElement,e=g.defaultView,e&&e!==e.top&&(e.addEventListener?e.addEventListener("unload",ea,!1):e.attachEvent&&e.attachEvent("onunload",ea)),p=!f(g),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(g.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(g.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!g.getElementsByName||!g.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(ca,da);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(g.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+L+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+L+"*(?:value|"+K+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){var b=g.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+L+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",P)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===g||a.ownerDocument===v&&t(v,a)?-1:b===g||b.ownerDocument===v&&t(v,b)?1:k?J(k,a)-J(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,h=[a],i=[b];if(!e||!f)return a===g?-1:b===g?1:e?-1:f?1:k?J(k,a)-J(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?la(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},g):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&D.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(ca,da),a[3]=(a[3]||a[4]||a[5]||"").replace(ca,da),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(ca,da).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+L+")"+a+"("+L+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(Q," ")+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=J(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(ca,da),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return W.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(ca,da).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:oa(function(){return[0]}),last:oa(function(a,b){return[b-1]}),eq:oa(function(a,b,c){return[0>c?c+b:c]}),even:oa(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:oa(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:oa(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:oa(function(a,b,c){for(var d=0>c?c+b:c;++db;b++)d+=a[b].value;return d}function sa(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function ta(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function ua(a,b,c){for(var d=0,e=b.length;e>d;d++)ga(a,b[d],c);return c}function va(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function wa(a,b,c,d,e,f){return d&&!d[u]&&(d=wa(d)),e&&!e[u]&&(e=wa(e,f)),ia(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||ua(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:va(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=va(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?J(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=va(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):H.apply(g,r)})}function xa(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=sa(function(a){return a===b},h,!0),l=sa(function(a){return J(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];f>i;i++)if(c=d.relative[a[i].type])m=[sa(ta(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return wa(i>1&&ta(m),i>1&&ra(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&xa(a.slice(i,e)),f>e&&xa(a=a.slice(e)),f>e&&ra(a))}m.push(c)}return ta(m)}function ya(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=F.call(i));s=va(s)}H.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&ga.uniqueSort(i)}return k&&(w=v,j=t),r};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=xa(b[c]),f[u]?d.push(f):e.push(f);f=A(a,ya(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(ca,da),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(ca,da),aa.test(j[0].type)&&pa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&ra(j),!a)return H.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,aa.test(a)&&pa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(K,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1; + +return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.lengthh;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML="
      a",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function aa(){return!0}function ba(){return!1}function ca(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!=this;i=i.parentNode||this)if(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h]","i"),ha=/^\s+/,ia=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ja=/<([\w:]+)/,ka=/\s*$/g,ra={option:[1,""],legend:[1,"
      ","
      "],area:[1,"",""],param:[1,"",""],thead:[1,"","
      "],tr:[2,"","
      "],col:[2,"","
      "],td:[3,"","
      "],_default:k.htmlSerialize?[0,"",""]:[1,"X
      ","
      "]},sa=da(y),ta=sa.appendChild(y.createElement("div"));ra.optgroup=ra.option,ra.tbody=ra.tfoot=ra.colgroup=ra.caption=ra.thead,ra.th=ra.td;function ua(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ua(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function va(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wa(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xa(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function ya(a){var b=pa.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function za(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Aa(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Ba(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xa(b).text=a.text,ya(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!ga.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(ta.innerHTML=a.outerHTML,ta.removeChild(f=ta.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ua(f),h=ua(a),g=0;null!=(e=h[g]);++g)d[g]&&Ba(e,d[g]);if(b)if(c)for(h=h||ua(a),d=d||ua(f),g=0;null!=(e=h[g]);g++)Aa(e,d[g]);else Aa(a,f);return d=ua(f,"script"),d.length>0&&za(d,!i&&ua(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=da(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(la.test(f)){h=h||o.appendChild(b.createElement("div")),i=(ja.exec(f)||["",""])[1].toLowerCase(),l=ra[i]||ra._default,h.innerHTML=l[1]+f.replace(ia,"<$1>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&ha.test(f)&&p.push(b.createTextNode(ha.exec(f)[0])),!k.tbody){f="table"!==i||ka.test(f)?""!==l[1]||ka.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ua(p,"input"),va),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ua(o.appendChild(f),"script"),g&&za(h),c)){e=0;while(f=h[e++])oa.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=wa(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ua(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&za(ua(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ua(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fa,""):void 0;if(!("string"!=typeof a||ma.test(a)||!k.htmlSerialize&&ga.test(a)||!k.leadingWhitespace&&ha.test(a)||ra[(ja.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ia,"<$1>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ua(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,m.cleanData(ua(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&na.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ua(i,"script"),xa),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ua(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,ya),j=0;f>j;j++)d=g[j],oa.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qa,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Ca,Da={};function Ea(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fa(a){var b=y,c=Da[a];return c||(c=Ea(a,b),"none"!==c&&c||(Ca=(Ca||m("