Commit graph

20 commits

Author SHA1 Message Date
Jonathan Chan
92ec8f15f0 Implement CSSStyleRule.selectorText.
We parse when assigning using the namespaces of the stylesheet. It isn't
clear if the spec says to do that (Firefox doesn't support the setter at
all, Chrome does, Safari doesn't); the spec issue is here:
https://github.com/w3c/csswg-drafts/issues/1511

Also fix ToCss implementation of AttrSelectorOperator to not pad with
spaces, to conform with CSSOM. This means we have to update some unit
tests that expect operators with spaces around them in attribute
selectors to roundtrip.

See the "attribute selector" section of "Serializing Selectors" here:
https://drafts.csswg.org/cssom/#serializing-selectors

CSSStyleRule.selectorText is specified here:
https://drafts.csswg.org/cssom/#dom-cssstylerule-selectortext
2017-07-12 01:03:58 -07:00
Jonathan Chan
80dee7a65f Force HTMLStyleElement to create a new CSSStyleSheet when re-parsing.
We already call Document::invalidate_style_sheets and set
the stylesheet member to a new Stylesheet. This matches the behavior of
Firefox, and means the new CSSStyleSheet you get from accessing .sheet
from JS will be correct instead of stale.

(::get_cssom_stylesheet already tries to use the new Stylesheet, but
MutNullableJS::or_init is called, so if we already created a
CSSStyleSheet we will continue to return that one).
2017-06-22 15:51:59 -07:00
Jonathan Chan
18dbfced52 Correctly test CSSStyleRule.style.
Remove the assert_readonly test and add one to verify that assigning to
CSSStyleRule.style correctly forwards to CSSStyleRule.style.cssText.

We currently test for whether CSSStyleRule.style is read-only by
trying to assign to it; however, the spec has it as actually:

interface CSSStyleRule : CSSRule {
  ...
  [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
};

See: https://drafts.csswg.org/cssom/

The `PutForwards=cssText` means that assigning to CSSStyleRule.style
should actually assign to style.cssText.
2017-06-12 15:51:58 -07:00
Eloy Coto
33a46597ed Fix #6799: set stacking_context_position correctly on
fragment_border_iterator
2017-05-30 09:38:37 +02:00
Simon Sapin
1b419007d1 CSSKeyframesRule::name setter doesn’t throw anymore
063dc05e47
https://github.com/w3c/web-platform-tests/pull/5695
2017-04-26 07:55:01 +02:00
Josh Matthews
665817d2a6 Update web-platform-tests to revision 58eb04cecbbec2e18531ab440225e38944a9c444 2017-04-22 14:17:10 +02:00
Matthias Devlamynck
05b5aabc69
Shorthand with variable reference should not have extra whitespace after colon for serialization 2017-03-29 12:16:28 +02:00
Ms2ger
296fa2512b Update web-platform-tests and CSS tests.
- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180.
- Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
2017-02-06 22:38:29 +01:00
Nazım Can Altınova
fd950a7309 Support origins in CSSOM stylesheets 2017-01-20 22:00:49 +03:00
bors-servo
867df7f3d7 Auto merge of #14920 - upsuper:shorthand-variable, r=emilio
Correctly handle unserializable shorthand

get_shorthand_appendable_value doesn't always return a serializable value. This change makes it handle that case correctly.

This change also updates step number in property_value_to_css to reflect the latest spec.

---
<!-- 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 stylo [bug 1329533](https://bugzilla.mozilla.org/show_bug.cgi?id=1329533)

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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/14920)
<!-- Reviewable:end -->
2017-01-09 20:10:32 -08:00
Xidorn Quan
c183899c06 Correctly handle unserializable shorthand
get_shorthand_appendable_value doesn't always return a serializable
value. This change makes it handle that case correctly.
2017-01-09 15:38:13 +11:00
Manish Goregaokar
dbc35f4360 Add test for CSS interface 2017-01-07 23:37:50 -08:00
Keith Yeung
18567ce7a8 Implement CSSKeyframeRule.style 2017-01-07 22:18:04 -08:00
Nazım Can Altınova
c351092457 Fix overflow shorthand serialization. 2016-12-31 15:26:36 +03:00
Keith Yeung
aa99f18806 Add WPT test for CSSStyleRule.style property 2016-12-18 15:23:06 -08:00
Nazım Can Altınova
9696c3a28a Implement CSSKeyframesRule.name 2016-12-14 12:48:47 +03:00
Nazım Can Altınova
3b1de577f9 Write tests for CSSOM Interfaces 2016-12-07 23:43:07 +03:00
Nazım Can Altınova
c052835281 Implement MediaList interface 2016-12-02 23:46:40 +03:00
Nazım Can Altınova
d4c3035659 Property declaration block serialization should check for importance 2016-11-26 14:16:33 +03:00
Ms2ger
ccdb0a3458 Update web-platform-tests to revision e8bfc205e36ad699601212cd50083870bad9a75d 2016-11-15 09:35:34 +01:00