Bug 1345206 - Wire up bindings for @page rule. r=xidorn

Connect the Servo types and functions for working with @page rules to Gecko.

This also adjusts the Stylo test expectations to match the current state with
@page support.

MozReview-Commit-ID: 513d05m51wK

--HG--
extra : rebase_source : aa92dc1ad4b3949418759b3893a918663ec6ee0c
This commit is contained in:
J. Ryan Stinnett 2017-03-30 21:25:22 -05:00
parent 7a5e0808ba
commit 7f0b8b2dd6
4 changed files with 14 additions and 4 deletions

View File

@ -17,3 +17,4 @@ SERVO_ARC_TYPE(AnimationValueMap, RawServoAnimationValueMap)
SERVO_ARC_TYPE(MediaList, RawServoMediaList)
SERVO_ARC_TYPE(MediaRule, RawServoMediaRule)
SERVO_ARC_TYPE(NamespaceRule, RawServoNamespaceRule)
SERVO_ARC_TYPE(PageRule, RawServoPageRule)

View File

@ -95,6 +95,7 @@ SERVO_BINDING_FUNC(Servo_CssRules_DeleteRule, nsresult,
BASIC_RULE_FUNCS(Style)
BASIC_RULE_FUNCS(Media)
BASIC_RULE_FUNCS(Namespace)
BASIC_RULE_FUNCS(Page)
#undef BASIC_RULE_FUNCS
SERVO_BINDING_FUNC(Servo_CssRules_GetFontFaceRuleAt, nsCSSFontFaceRule*,
ServoCssRulesBorrowed rules, uint32_t index)
@ -113,6 +114,11 @@ SERVO_BINDING_FUNC(Servo_NamespaceRule_GetPrefix, nsIAtom*,
RawServoNamespaceRuleBorrowed rule)
SERVO_BINDING_FUNC(Servo_NamespaceRule_GetURI, nsIAtom*,
RawServoNamespaceRuleBorrowed rule)
SERVO_BINDING_FUNC(Servo_PageRule_GetStyle, RawServoDeclarationBlockStrong,
RawServoPageRuleBorrowed rule)
SERVO_BINDING_FUNC(Servo_PageRule_SetStyle, void,
RawServoPageRuleBorrowed rule,
RawServoDeclarationBlockBorrowed declarations)
// Animations API
SERVO_BINDING_FUNC(Servo_ParseProperty,

View File

@ -12,6 +12,7 @@
#include "mozilla/ServoStyleRule.h"
#include "mozilla/ServoMediaRule.h"
#include "mozilla/ServoNamespaceRule.h"
#include "mozilla/ServoPageRule.h"
namespace mozilla {
@ -87,6 +88,7 @@ ServoCSSRuleList::GetRule(uint32_t aIndex)
CASE_RULE(STYLE, Style)
CASE_RULE(MEDIA, Media)
CASE_RULE(NAMESPACE, Namespace)
CASE_RULE(PAGE, Page)
#undef CASE_RULE
case nsIDOMCSSRule::FONT_FACE_RULE: {
// Returns a borrowed nsCSSFontFaceRule object directly, so we

View File

@ -68,6 +68,7 @@ to mochitest command.
* @keyframes
* test_keyframes_rules.html [1]
* test_rules_out_of_sheets.html [1]
* test_bug887741_at-rules_in_declaration_lists.html `rules[2]` [1]
* @support
* test_supports_rules.html [1]
* test_box_size_keywords.html: moz-prefixed intrinsic size keyword value [64]
@ -243,10 +244,8 @@ to mochitest command.
* ... `justify-` [6]
* test_value_storage.html `align-` [9]
* ... `justify-` [14]
* @page support
* test_bug887741_at-rules_in_declaration_lists.html [1]
* test_page_parser.html [30]
* test_rule_insertion.html `@page` [4]
* @page should ignore properties with viewport units bug 1353191
* test_page_parser.html `2v` [8]
* Stylesheet cloning is somehow busted bug 1348481
* test_selectors.html `cloned correctly` [157]
* ... `matched clone` [204]
@ -396,6 +395,8 @@ to mochitest command.
* Unit should be preserved after parsing servo/servo#15346
* test_units_length.html [5]
* test_units_time.html [1]
* test_page_parser.html `192px` [8]
* test_bug887741_at-rules_in_declaration_lists.html `188.96666px` [1]
* insertRule / deleteRule don't work bug 1336863
* test_rule_insertion.html [5]
* @-moz-document support