Commit graph

873 commits

Author SHA1 Message Date
John Poge II
5f2c6c09cd
Implement :valid :invalid pseudo classes (#26729)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2023-07-21 10:42:03 +00:00
Oriol Brufau
1ac55889bb Further changes required by Servo 2023-06-09 10:22:23 +02:00
Oriol Brufau
07dbd9d637 Further changes required by Servo 2023-06-09 10:22:18 +02:00
Josh Matthews
0e8ac3fdac Formatting. 2023-05-28 23:54:02 -04:00
Josh Matthews
dbff26bce0 Support arbitrary protos when wrapping DOM objects with constructors. 2023-05-28 23:23:12 -04:00
Oriol Brufau
4f0e0c888c Further changes required by Servo 2023-05-24 18:32:36 +02:00
Oriol Brufau
373d22119f Further changes required by Servo 2023-05-19 19:06:08 +02:00
switchpiggy
34762d97ad fixup! Checks moved to Element::client_rect(), fixed conditions for the special cases, reconfigured Window constructor to initialize current_viewport to initial window size 2023-05-05 11:13:26 -07:00
switchpiggy
7c61c5b930 Checks moved to Element::client_rect(), fixed conditions for the special cases, reconfigured Window constructor to initialize current_viewport to initial window size 2023-05-05 02:05:02 -07:00
switchpiggy
bf49260e81 Implemented special cases for Element.clientWidth() and clientHeight() 2023-05-04 23:03:36 -07:00
Martin Robinson
eca0acf459 Allow script to scroll overflow: scroll elements
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.
2023-04-25 21:25:00 +02:00
Emilio Cobos Álvarez
31e8e418ea Miscellaneous build / tidy fixes. 2021-02-26 17:53:55 +01:00
YUAN LYU
a999850b24 Implement referrerPolicy for HTMLLinkElement and HTMLScriptElement 2020-12-01 00:37:16 -05:00
Tyler Wilcock
61c5ab8f69 Replace generic 'value' variable name with 'id' and 'name' to reduce confusion 2020-11-23 23:31:34 -06:00
Vincent Ricard
2a4dd894de Implement DOMTokenList.supports API 2020-10-05 09:26:36 +02:00
Vincent Ricard
ddfa9ca5b4 Implements HTMLDetailsElement toggle 2020-09-26 11:53:47 +02:00
Vincent Ricard
66f80fbf4f Implement ParentNode#replaceChildren 2020-09-25 08:21:10 +02:00
Josh Matthews
d55424e88f Update document focus when element focusability changes. 2020-06-15 11:22:28 -04:00
Anthony Ramine
036f123c4e Implement concept of dirty root 2020-05-19 16:26:36 +02:00
Bastien Orivel
1b2464b4b6 Add a fast path in Element::SetInnerHTML when the value is small and trivial text
Inspired from gecko which has a similar fast path. This makes innerHTML
more than 10 times faster for this case.

Fixes #25892
2020-05-04 18:11:49 +02:00
Emilio Cobos Álvarez
848a6203de Some servo build fixes. 2020-04-16 18:29:30 +02:00
Anthony Ramine
c10e839924 Don't go through the layout thread to retrieve a node's primary style 2020-04-07 14:34:47 +02:00
teapotd
779552ee7d Form constraints validation 2020-04-02 10:16:46 +02:00
bors-servo
af1ebe79ef
Auto merge of #26083 - servo:layout-2020-more-cleanups, r=jdm
More layout cleanups from the introduction of a lifetime in LayoutDom<T>

What can I say, the follow-up fixes just kept coming to my door one by one, I couldn't just tell them to go away.
2020-04-01 12:05:16 -04:00
Anthony Ramine
28e5abe606 Introduce <LayoutDom<Element>>::focus_state 2020-04-01 11:40:56 +02:00
Anthony Ramine
ebd2892158 Make synthesize_presentational_hints_for_legacy_attributes be safe 2020-04-01 11:40:55 +02:00
Anthony Ramine
fc07a5147c Make LayoutNodeHelpers::composed_parent_node_ref be safe
For clarity, I introduce <LayoutDom<Element>>::parent_node_ref to contain
the remaining unsafety bits out of composed_parent_node_ref which is more
complex than just a field access.
2020-04-01 11:40:34 +02:00
Josh Matthews
6ab7a50b31 Cache the result of retrieving an element's client rectangle from layout. 2020-03-31 17:15:44 -04:00
Anthony Ramine
9c8540af5c Make layout methods accessing rare data be safe
They don't do anything fancy so there is no additional unsafety calling them
compared to using LayoutDom in the first place, the usual story of all
those changes.
2020-03-31 22:04:35 +02:00
Anthony Ramine
414d477b54 Don't generate rare_data_for_layout methods anymore
It is only used twice.
2020-03-31 21:54:02 +02:00
Anthony Ramine
dd750c6f86 Introduce LayoutDom::to_layout_slice
It generalises <LayoutDom<Element>>::attrs.
2020-03-31 21:39:45 +02:00
Anthony Ramine
fbc3e430ab Make a bunch or trivial LayoutElementHelpers safe 2020-03-31 20:37:57 +02:00
Anthony Ramine
5ff931d171 Introduce <LayoutDom<Element>>::attrs()
This safe method is the basic block to access element attributes from layout.
We reuse it in the other attr-related layout methods to remove a pretty big
source of rampant unsafe code between script and layout.
2020-03-31 18:46:49 +02:00
Anthony Ramine
0bda174823 Merge RawLayoutElementHelpers into LayoutElementHelpers 2020-03-31 18:30:42 +02:00
Anthony Ramine
3b504148d5 Move around some code in the element
The intent is to merge the two layout helper traits together
so I'm moving them around to make later diffs more readable.
2020-03-31 18:02:02 +02:00
Anthony Ramine
3e875ce3eb Introduce AttrHelpersForLayout::namespace 2020-03-31 14:06:22 +02:00
Anthony Ramine
47c9f19121 Don't clone the result of AttrHelpersForLayout::local_name
There is no need to do that. Embrace returning borrows from the DOM, it good.
2020-03-31 14:02:14 +02:00
Anthony Ramine
4db84bede8 Rename AttrHelpersForLayout methods 2020-03-31 13:58:50 +02:00
Anthony Ramine
02fb5a68e6 Remove a bunch of _forever suffixes in Attr methods
They don't return &'static references anymore.
2020-03-30 13:09:03 +02:00
Anthony Ramine
4279fe5933 Fix LayoutElementHelpers::get_classes_for_layout
It should not return a 'static reference
2020-03-30 13:07:27 +02:00
Anthony Ramine
467913acdb Make LayoutElementHelpers methods take self 2020-03-29 19:31:54 +02:00
Anthony Ramine
dba6a635e5 Give a lifetime parameter to LayoutDom 2020-03-28 15:37:57 +01:00
YUAN LYU
3ea6d87bcc
Add trait DomObjectWrap to provide WRAP function 2020-03-20 22:16:56 -04:00
Dmitry Kolupaev
35d340daba Simplify code for directionality 2020-02-25 01:18:21 +03:00
Dmitry Kolupaev
edb940e613 Remove recursiveness from directionality search 2020-02-25 01:18:21 +03:00
Dmitry Kolupaev
7d6d1c09cb Rearrange directionality algorithm functions 2020-02-25 01:18:20 +03:00
Dmitry Kolupaev
ef49f2e0eb Implement dirname for form submit and directionality for element 2020-02-25 01:18:20 +03:00
bors-servo
f020536215
Auto merge of #25548 - pshaughn:docnamedgetter, r=jdm
Add SupportedPropertyNames to Document (also fix iframe getting)

Existing test of named-getting an iframe now succeeds. I added a new test for Object.getOwnPropertyNames(document) based on my understanding of the spec; that test could use a second opinion.

UPDATE: This was trying to do too many things in one PR as originally submitted. It is now using #25572 as a base, and I suggest reviewing that PR before this one to avoid duplicating review effort.

---
<!-- 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 #7273 for all implemented named getters, fix #25146, and fix the iframe case only of #25145.

<!-- Either: -->
- [X] There are tests for these changes

<!-- 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. -->
2020-02-13 20:11:20 -05:00
bors-servo
e697e6cca7
Auto merge of #25488 - pshaughn:clickactivate, r=jdm
Event dispatch rewritten to align to spec, activate on clicks better

I went over the changes to the event dispatch spec that had accumulated over the past few years, rewriting dispatch/invoke/inner-invoke almost completely and modifying other code where it was relevant. Most of the remaining obvious deviations from spec are things that will only come up when we start handling events in shadow DOM.

I am pushing now because I want to see CI test results, but please do not approve this PR just if automated test improvements look good. I may have broken some actual UI interactions in the course of fixing synthetic events, and some manual testing is needed, including checking that manual interactions with interactive content continue to fire the events they're supposed to.

---
<!-- 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 #25384 and fix #22783 and fix #25199

<!-- Either: -->
- [ ] There are automated tests for the synthetic-click parts of these changes, BUT the effects on real UI events need some manual testing before merging

<!-- 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. -->
2020-02-13 17:37:12 -05:00
Patrick Shaughnessy
e48eac6879 Doc named getter improvements 2020-02-13 15:37:03 -05:00