Commit graph

873 commits

Author SHA1 Message Date
Fernando Jiménez Moreno
9022bd3d11 IS_IN_SHADOW_TREE flag 2019-04-26 10:17:44 +02:00
Fernando Jiménez Moreno
569b4fce10 Element attachShadow implementation 2019-04-26 10:17:44 +02:00
Fernando Jiménez Moreno
18ae0fcbd6 ShadowRoot interface 2019-04-26 10:17:44 +02:00
Ian Moody
8d7fe68ac3 Remove :-servo-case-sensitive-type-attr()
No longer needed now that the case-sensitive flag for attributes selectors is
supported.
Update user-agent CSS sheet to use the standard flag.

Fixes #23227
2019-04-18 13:46:59 +01:00
Emilio Cobos Álvarez
49842f5031 style: Fix servo build, and appease tidy / fmt. 2019-04-12 12:20:15 +02:00
Anthony Ramine
5fe5e5d6de Remove most RootedReference uses
We can replace all uses of RootedReference for Option<T> by Option::deref calls.
2019-03-10 17:51:35 +01:00
Simon Sapin
4464354e2e Reformat 2019-02-26 08:18:33 +01:00
Emilio Cobos Álvarez
c2819365f0 style: Rename MozLength to Size, and MaxLength to MaxSize.
MozLength is not a very descriptive name. If we're going to use it in both Gecko
and Servo we may as well name it something more accurate.

I would've chosen `ContentSize` per CSS2[1][2] if it wasn't a lie in presence
of box-sizing. I don't have better ideas than `Size`, given that.

[1]: https://drafts.csswg.org/css2/visudet.html#propdef-width
[2]: https://drafts.csswg.org/css2/box.html#content-width

Differential Revision: https://phabricator.services.mozilla.com/D19280
2019-02-12 02:28:00 +01:00
Emilio Cobos Álvarez
6daebcc5df Fix servo build. 2019-02-10 07:23:51 +01:00
CYBAI
cb86d451e6 Implement cannot navigate 2019-01-23 00:38:45 +08:00
Shanavas M
02d28e02e3 Parse url in getter method 2019-01-14 18:51:52 +05:30
Shanavas M
37aa21d8db Set url attribute 2019-01-14 14:59:39 +05:30
Emilio Cobos Álvarez
2a6cdaa30a Rustfmt recent changes. 2019-01-08 12:01:28 +01:00
Emilio Cobos Álvarez
c7f30ad0df style: Fix servo build. 2019-01-08 12:01:11 +01:00
Emilio Cobos Álvarez
4a31509215 style: Fix servo build.
This also fixes a bunch of calc handling issues and such.

Also remove tests that no longer compile and are covered by WPT.
2019-01-08 12:00:42 +01:00
Emilio Cobos Álvarez
97bd8fc280 Fix Servo build. 2019-01-07 00:59:30 +01:00
Manish Goregaokar
611dc4bc70 Remove now-unnecessary must_root and allow(unrooted_must_root) annotations 2019-01-04 15:05:07 -08:00
George Roman
a2d5d4f3da Serialize the children of void html elements as empty strings 2019-01-03 07:49:13 +02:00
Simon Sapin
be69f9c3e6 Rustfmt has changed its default style :/ 2018-12-28 13:17:47 +01:00
Dan Robertson
c46508e497
Update src/href attributes to be a USVString
The following IDLs have the src/href attributes typed as a DOMString
while in the spec the attribute has been updated to be a USVString:

 - HTMLIFrameElement
 - HTMLImageElement
 - HTMLInputElement
 - HTMLLinkElement
 - HTMLMediaElement
 - HTMLScriptElement
2018-12-17 15:28:42 +00:00
Jan Andre Ikenmeyer
a1a14459c1
Update MPL license to https (part 3) 2018-11-19 14:47:12 +01:00
Simon Sapin
2012be4a8b cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
Pyfisch
9e92eb205a Reorder imports 2018-11-06 22:35:07 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
Simon Sapin
76e59a46d3 Sort use statements 2018-11-06 15:26:02 +01:00
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
chansuke
c37a345dc9 Format script component 2018-09-19 17:40:47 -04:00
Emilio Cobos Álvarez
60e28c61e5
Fix Servo build. 2018-09-18 11:52:39 +02:00
Emilio Cobos Álvarez
689293e4fb
Fix Servo build. 2018-08-08 01:34:35 +02:00
Jonathan Kingston
a271c615f7 Implement support for Element.toggleAttribute 2018-06-21 02:06:32 +01:00
Fabrice Desré
75434e6fce MutationObserver api: Implement takeRecords() and characterData mutations 2018-05-02 09:58:37 -07:00
Fabrice Desré
42886613d3 Notify the embedder when it should display or hide an IME 2018-04-21 19:46:42 -07:00
Emilio Cobos Álvarez
9fa2618197
style: Add infrastructure to match :host. 2018-03-14 15:10:05 +01:00
Emilio Cobos Álvarez
1654f297ca
style: Tidy a couple things. 2018-03-14 15:10:05 +01:00
bors-servo
ac162e8f72
Auto merge of #20012 - alexfjw:avoid_Window-GetComputedStyle_when_checking_for_display-none, r=emilio
Avoid `Window::GetComputedStyle` when checking for `display: none`

<!-- Please describe your changes on the following line: -->
Refactored Window::GetComputedStyle to use Element::Style.

Not sure which tests are relevant, but I've ran the dom, fetch & 2dcontext wpt tests. They don't seem to give errors.

---
<!-- 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 #19885.

<!-- Either: -->
- [x] These changes do not require tests because it's a refactoring task

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20012)
<!-- Reviewable:end -->
2018-02-27 04:52:05 -05:00
Alex Fong
8d09398230 Avoid Window::GetComputedStyle when checking for display: none 2018-02-26 19:07:04 +08:00
Emilio Cobos Álvarez
7ab4b21bc3
selectors: Remove the get_ prefix from get_local_name and get_namespace. 2018-02-24 22:45:38 +01:00
Fernando Jiménez Moreno
2a4535f43e Implement element.innerText getter 2018-02-13 09:12:00 +01:00
bors-servo
82922c97dc Auto merge of #19878 - emilio:slotted-slot, r=nox
selectors: Never match ::slotted on <slot>s.

This fixes the test from https://github.com/w3c/web-platform-tests/pull/9212 in
Gecko.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19878)
<!-- Reviewable:end -->
2018-01-29 11:45:11 -06:00
CYBAI
37802dfd19 script: Move style as Element method 2018-01-28 23:47:39 +08:00
Jon Leighton
fe583fc5d0 Add layout RPC query for getting an element's style
This enables us to implement Element::has_css_layout_box() in a more
direct way, and also enables us to remove some of the existing more
specific queries.

Fixes #19811.
2018-01-28 10:59:45 +01:00
Emilio Cobos Álvarez
61e60a87e5
selectors: Never match ::slotted on <slot>s.
This fixes the test from https://github.com/w3c/web-platform-tests/pull/9212 in
Gecko.
2018-01-27 17:57:17 +01:00
bors-servo
bccb757bcd Auto merge of #19803 - jonleighton:issue-19765, r=emilio
Implement Element::has_css_layout_box()

r? emilio

Here's my initial attempt to fix #19430. It seems surprisingly simple so I am wondering whether I have missed something! (Or maybe it just actually is quite simple...)

Some things I am unsure about:

1. The spec seems vague about what a [CSS layout box](https://drafts.csswg.org/cssom-view/#css-layout-box) actually is. Indeed it says: "The terms CSS layout box and SVG layout box are not currently defined by CSS or SVG."
2. One thing the spec *does* say explicitly is "For the purpose of the requirements in this specification, elements that have a computed value of the display property that is table-column or table-column-group must be considered to have an associated CSS layout box (the column or column group, respectively)." I am unclear about the relevance of this, since [overflow does not apply](https://drafts.csswg.org/css-overflow-3/#overflow-properties) to an [internal table element](https://drafts.csswg.org/css-display-3/#layout-specific-display). Therefore I haven't done anything about this explicitly, but maybe I'm missing some nuance.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19803)
<!-- Reviewable:end -->
2018-01-19 14:37:57 -06:00
Emilio Cobos Álvarez
8e25c9e674
style: Track the visited-handling-mode on the MatchingContext.
Instead of on the stack.

This fixes bugs where we're not passing the value around correctly, like from
::-moz-any.

This is a fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1431539.
2018-01-19 13:22:37 +01:00
Jon Leighton
902edb925e Implement Element::has_css_layout_box()
Calling scroll() on an element which is not rendered (by a parent with
display: none) would previously cause a crash. In fact, we should
terminate the algorithm
[https://drafts.csswg.org/cssom-view/#dom-element-scroll] at step 10 in
this situation.

The fix hinges on implementing Element::has_css_layout_box() correctly,
rather than just returning true in all cases as we did previously.

Fixes #19430.
2018-01-18 18:31:16 +01:00
Emilio Cobos Álvarez
3119db724a
selectors: Simplify :visited by only using the "is inside link" information.
Right now we go through a lot of hoops to see if we ever see a relevant link.

However, that information is not needed: if the element is a link, we'll always
need to compute its visited style because its its own relevant link.

If the element inherits from a link, we need to also compute the visited style
anyway.

So the "has a relevant link been found" is pretty useless when we know what are
we inheriting from.

The branches at the beginning of matches_complex_selector_internal were
affecting performance, and there are no good reasons to keep them.

I've verified that this passes all the visited tests in mozilla central, and
that the test-cases too-flaky to be landed still pass.
2017-12-08 05:35:12 +01:00
Emilio Cobos Álvarez
af879523ea
style: Make all keywords CamelCase for consistency.
This prevents confusion and paves the ground for derive(Parse) of them.
2017-12-06 02:35:10 +01:00
CYBAI
a470ebd501 style: Move font-family outside of mako 2017-11-26 00:36:00 +08:00
bors-servo
37760054e2 Auto merge of #19127 - tigercosmos:overflow10, r=emilio
scroll, SetScrollTop, SetScrollLeft in `element.rs`

<!-- Please describe your changes on the following line: -->
Currently dom-element-scroll have not finished yet. (Step 10)
This PR finish the step 10 of `scroll`, `SetScrollTop`, `SetScrollLeft`

[Step 10 description](https://drafts.csswg.org/cssom-view/#dom-element-scrolltop):
> If the element does not have any associated CSS layout box, the element has no associated scrolling box, or the element has no overflow, terminate these steps.
---
<!-- 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 #19114 (github issue number if applicable).

<!-- 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. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19127)
<!-- Reviewable:end -->
2017-11-12 17:24:33 -06:00
tigercosmos
9965f7e2cc scroll, SetScrollTop, SetScrollLeft in dom-element-scroll with test 2017-11-12 02:01:44 +08:00