aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom
Commit message (Collapse)AuthorAgeFilesLines
* Avoid assert failure when using @importOriol Brufau2023-06-141-1/+1
|
* Further changes required by ServoOriol Brufau2023-06-091-1/+2
|
* Further changes required by ServoOriol Brufau2023-06-091-0/+2
|
* Further changes required by ServoOriol Brufau2023-06-093-20/+18
|
* Auto merge of #29805 - jdm:dom-protos, r=mrobinsonbors-servo2023-06-01199-609/+2653
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support extending DOM classes in JS Adds support for determining the correct prototype as part of a `new` call for non-HTML constructors. Support for HTML constructors [was added](https://github.com/servo/servo/blob/master/components/script/dom/bindings/htmlconstructor.rs#L116) as part of the custom element work, but that wasn't enough for extending other DOM objects like `EventTarget`. This work is based on Gecko's code in https://searchfox.org/mozilla-central/rev/2d678a843ceab81e43f7ffb83212197dc10e944a/dom/bindings/BindingUtils.cpp#3667, and is split into two parts: 1) the actualy new implementation (demonstrating that extending `EventTarget` works as expected) 2) plumbing the new prototype through all of the rest of the DOM object construction code. This ends up being more complex than the way it's done in Gecko because they have lazy DOM reflectors, so their native DOM objects can be constructed without any knowledge of a JS prototype. Servo's reflectors are eager, however, so we need to propagate prototype information into individual constructors. As a result, this was a tedious set of changes to make. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #29770 - [x] There are tests for these changes
| * Rename reflect_dom_object2.Josh Matthews2023-05-31113-228/+254
| |
| * Assert that we're constructing.Josh Matthews2023-05-301-1/+2
| |
| * Throw type error when calling DOM constructor without new.Josh Matthews2023-05-303-15/+45
| |
| * Don't root a Realm that's used for one call.dom-protosJosh Matthews2023-05-291-3/+3
| |
| * Formatting.Josh Matthews2023-05-2881-206/+588
| |
| * Support arbitrary protos when wrapping DOM objects with constructors.Josh Matthews2023-05-28195-584/+2026
| |
| * Support arbitrary protos when wrapping EventTarget objects.Josh Matthews2023-05-286-22/+185
| |
* | Further changes required by ServoOriol Brufau2023-05-301-0/+1
| |
* | Further changes required by ServoOriol Brufau2023-05-261-0/+1
|/
* Auto merge of #29798 - jdm:per-interface-codegen, r=jdmbors-servo2023-05-262-30/+74
|\ | | | | | | | | | | | | | | | | | | | | Extract bodies of generated binding helpers into common code This is part of fixing #29770, by extracting common behaviour that [will be called](https://searchfox.org/mozilla-central/rev/2d678a843ceab81e43f7ffb83212197dc10e944a/dom/bindings/BindingUtils.cpp#3744) from new code in interface.rs. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes
| * Formatting.Josh Matthews2023-05-261-8/+2
| |
| * Use an enum to pass the index value for interfaces/protos.Josh Matthews2023-05-262-9/+27
| |
| * Extract bodies of DefineDOMInterface and GetProtoObject/GetConstructorObject ↵Josh Matthews2023-05-262-30/+62
| | | | | | | | out of generated bindings.
* | Further changes required by ServoOriol Brufau2023-05-241-3/+3
| |
* | Further changes required by ServoOriol Brufau2023-05-241-10/+6
| |
* | Enter realms when creating special same-origin iframes.Josh Matthews2023-05-201-0/+3
| |
* | Enter realms more consistently during the script event loop.Josh Matthews2023-05-204-1/+24
| |
* | Fix formatting.Josh Matthews2023-05-202-3/+3
| |
* | Remove unused argument from AlreadyInRealm::assert.Josh Matthews2023-05-206-9/+8
| |
* | Remove global argument from Promise::new_in_current_realm.Josh Matthews2023-05-2027-52/+50
| |
* | Make GlobalScope.get_cx a static method.Josh Matthews2023-05-2033-87/+89
|/
* Auto merge of #29748 - Loirooriol:sync, r=mrobinsonbors-servo2023-05-195-25/+12
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport several style changes from Gecko <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
| * Further changes required by ServoOriol Brufau2023-05-193-4/+4
| |
| * Further changes required by ServoOriol Brufau2023-05-162-21/+8
| |
* | Auto merge of #28587 - yvt:fix-location-target, r=mrobinsonbors-servo2023-05-181-179/+270
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make `Location` operate on the correct objects This PR updates the implementation of the "[`Location`-object navigate][1]" algorithm to use the correct browsing context as the source browsing context for navigation. This affects the determination of a referrer and referrer policy and the treatment of `javascript:` URLs. This PR also fixes the derivation of a `Location` object's [relevant `Document`][2] to match the specified behavior. [1]: https://html.spec.whatwg.org/multipage/#location-object-navigate [2]: https://html.spec.whatwg.org/multipage/#relevant-document --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes
| * | Make `Location` operate on the correct objectsyvt2023-05-181-179/+270
| |/ | | | | | | | | | | | | | | | | | | This PR updates the implementation of the "Location-object navigate" algorithm to use the correct browsing context as the source browsing context for navigation. This affects the determination of a referrer and referrer policy and the treatment of javascript: URLs. This PR also fixes the derivation of a Location object's relevant Document to match the specified behavior.
* | Auto merge of #29637 - ↵bors-servo2023-05-181-15/+3
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | AnthonyJ3:Use-same-origin-as-default-credential-mode-for-RequestInit-fix, r=mukilan Use same-origin as default credential mode for RequestInit fix <!-- Please describe your changes on the following line: --> - Updated the default credential mode from omit to same-origin as per: https://github.com/whatwg/fetch/pull/1153 - Deleted instances of fallback credentials --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #29633 (GitHub issue number if applicable) - [X] There are tests for these changes
| * fixup! defaulted credentials mode to same-origin & removed fallback credentialsAnthonyJ32023-04-251-4/+3
| |
| * fixup! defaulted credentials mode to same-origin & removed fallback credentialsAnthonyJ32023-04-171-4/+1
| |
| * defaulted credentials mode to same-origin & removed fallback credentialsAnthonyJ32023-04-161-9/+1
| | | | | | | | Signed-off-by: AnthonyJ3 <johnsonac.3300@gmail.com>
* | Add value argument to URLSearchParams's has() and delete()Veronika Bušů2023-05-112-6/+14
| | | | | | | | | | | | This commit should fix #29725. Signed-off-by: Veronika Bušů <paricbat@email.cz>
* | Auto merge of #29711 - switchpiggy:sp3, r=mrobinsonbors-servo2023-05-081-1/+20
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implemented special cases for Element.clientWidth() and clientHeight() <!-- Please describe your changes on the following line: --> Implemented the special cases for Element.clientWidth() and Element.clientHeight() as outlined in issue #29704. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] These changes do not require tests because tests already exist. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> [Specification text](https://w3c.github.io/csswg-drafts/cssom-view/#dom-element-clientwidth): > If the element is the [root element](https://w3c.github.io/csswg-drafts/css-display-4/#root-element) and the element’s [node document](https://dom.spec.whatwg.org/#concept-node-document) is not in [quirks mode](https://dom.spec.whatwg.org/#concept-document-quirks), or if the element is [the body element](https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2) and the element’s node document is in quirks mode, return the [viewport](https://www.w3.org/TR/CSS21/visuren.html#x1) width excluding the size of a rendered scroll bar (if any).
| * | fixup! Checks moved to Element::client_rect(), fixed conditions for the ↵switchpiggy2023-05-052-27/+14
| | | | | | | | | | | | special cases, reconfigured Window constructor to initialize current_viewport to initial window size
| * | Checks moved to Element::client_rect(), fixed conditions for the special ↵switchpiggy2023-05-052-24/+34
| | | | | | | | | | | | cases, reconfigured Window constructor to initialize current_viewport to initial window size
| * | Implemented special cases for Element.clientWidth() and clientHeight()switchpiggy2023-05-041-0/+22
| | |
* | | Auto merge of #29703 - ohno418:update-url-constructor-steps, r=mrobinsonbors-servo2023-05-081-17/+17
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update step numbers in URL constructor <!-- Please describe your changes on the following line: --> Two commits have been made ahead of the current implementation of Servo's URL constructor: - Align with a more modern IDL definition style [1] - Add URL.canParse() [2] Since these commits don't alter the actual behavior, this commit only updates the step numbers and adds brief descriptions for each step. No behavior change is expected with this commit. [1]: https://github.com/whatwg/url/commit/ea3b75d333cbce91f73676ef2d21bcadb12b4419 [2]: https://github.com/whatwg/url/commit/ae3c28b84e3e7122c2807401c26b8a63cb2ab445 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [x] These changes do not require tests because no behavior has changed. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
| * | | Update step numbers in URL constructorYutaro Ohno2023-05-061-17/+17
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two commits have been made ahead of the current implementation of Servo's URL constructor: - Align with a more modern IDL definition style [1] - Add URL.canParse() [2] Since these commits don't alter the actual behavior, this commit only updates the step numbers and adds brief descriptions for each step. No behavior change is expected with this commit. [1]: https://github.com/whatwg/url/commit/ea3b75d333cbce91f73676ef2d21bcadb12b4419 [2]: https://github.com/whatwg/url/commit/ae3c28b84e3e7122c2807401c26b8a63cb2ab445 Signed-off-by: Yutaro Ohno <yutaro.ono.418@gmail.com>
* / / Fix scrolling on root elementMartin Robinson2023-05-051-3/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | eca0acf4598c173c71765b961bd2079c0bb48cd2 uncovered a bug in the way that the scrolling area of `window` was calculated and broke scrolling on the root element. This change does two things in order to fix that: 1. Does a partial revert of eca0acf4598c173c71765b961bd2079c0bb48cd2 in order to get scrolling from script working again on the window object. 2. Has the compositor always generate a frame for scrolls starting from script and waits for them. This is speculative fix for flakiness in root scrolling tests on CI.
* | Auto merge of #29693 - mrobinson:cleanup-options, r=mukilanbors-servo2023-05-031-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up how command-line options are passed around <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #29678 - [x] These changes do not require tests because they do not change behavior.
| * | Clean up debug optionsMartin Robinson2023-05-011-1/+1
| | |
* | | Fix flakiness in animation testsMartin Robinson2023-05-021-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. When updating the animation timeline, ensure that nodes that are animating are marked dirty, if necessary, so any style queries will force an layout flush. 2. Disable the problematic transition test suites, as they are in Gecko. These suites often fail when Servo is so overloaded that it cannot deliver frames fast enough to get more than two samples during the animation lifecycle. Fixes #28334. Fixes #26435. Fixes #21486.
* | | Reset to in-memory stream with empty byte sequence for None init bodycybai2023-04-271-0/+5
|/ / | | | | | | | | | | | | Because the response body stream is initialized with FetchResponse, it cannot be processed with in-memory empty sequence. Thus, instead of using the FetchResponse stream, we'll reset it to Memory body stream with empty byte sequence if there's no init body.
* | Allow script to scroll `overflow: scroll` elementsMartin Robinson2023-04-252-48/+58
| | | | | | | | | | | | Before the code was only allowing `overflow: hidden` elements to scroll. This fixes that issue and also clean up the code that deals with detecting whether the body is a "potentially scrollable" in quirks mode.
* | Scroll from script should trigger a reflowMartin Robinson2023-04-251-21/+21
| | | | | | | | | | | | | | | | | | Scrolling from script should flow layout and send a display list to WebRender. This allows all of the scroll nodes to exist in WebRender before asking it to move the node. See https://gist.github.com/paulirish/5d52fb081b3570c81e3a. Fixes #29659.
* | Auto merge of #29646 - CYBAI:fix-classname-filter, r=jdmbors-servo2023-04-241-0/+6
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix checking for empty set in getElementsByClassName Because empty set with `.all(predicate)` will always return `true`, it will result in always filtering wrong elements when the classes is empty set. Thus, we return earlier with `always_empty` HTMLCollection in the empty classes case so that we can avoid filtering on empty sets. With adding the checking, we can fix the failures in `/dom/nodes/getElementsByClassName-empty-set.html`. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) - [x] There are tests for these changes