Commit f4f8b214 authored by Hwanseung Lee's avatar Hwanseung Lee Committed by Commit Bot

[css-typed-om] rename attributeStyleMap to styleMap at CSSStyleRule

rename attributeStyleMap to styleMap at CSSStyleRule

https://github.com/w3c/css-houdini-drafts/issues/572
https://github.com/w3c/css-houdini-drafts/pull/596

Bug: 807008
Change-Id: I8e5f140914783c074f73f75ed94312989e90e0ef
Reviewed-on: https://chromium-review.googlesource.com/893239Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: Hwanseung Lee <hs1217.lee@samsung.com>
Cr-Commit-Position: refs/heads/master@{#533077}
parent 8c4f6577
...@@ -137,7 +137,7 @@ function createRuleWithDeclaredStyleMap(test, cssText) { ...@@ -137,7 +137,7 @@ function createRuleWithDeclaredStyleMap(test, cssText) {
test.add_cleanup(() => { test.add_cleanup(() => {
style.remove(); style.remove();
}); });
return [rule, rule.attributeStyleMap]; return [rule, rule.styleMap];
} }
// Creates a new element with background image set to |imageValue| // Creates a new element with background image set to |imageValue|
......
...@@ -28,7 +28,7 @@ div { ...@@ -28,7 +28,7 @@ div {
'use strict'; 'use strict';
const target = document.getElementById('target'); const target = document.getElementById('target');
const styleMap = document.styleSheets[0].rules[0].attributeStyleMap; const styleMap = document.styleSheets[0].rules[0].styleMap;
test(() => { test(() => {
const properties = styleMap.getProperties(); const properties = styleMap.getProperties();
...@@ -63,7 +63,7 @@ test(() => { ...@@ -63,7 +63,7 @@ test(() => {
style.sheet.insertRule('.test { width: 10px; }'); style.sheet.insertRule('.test { width: 10px; }');
let rule = style.sheet.rules[0]; let rule = style.sheet.rules[0];
let styleMap = rule.attributeStyleMap; let styleMap = rule.styleMap;
assert_style_value_equals(styleMap.get('width'), CSS.px(10)); assert_style_value_equals(styleMap.get('width'), CSS.px(10));
rule.style.width = '20px'; rule.style.width = '20px';
......
...@@ -15,9 +15,9 @@ ...@@ -15,9 +15,9 @@
test(() => { test(() => {
let rule = document.styleSheets[0].rules[0]; let rule = document.styleSheets[0].rules[0];
rule.attributeStyleMap.set('width', CSS.px(200)); rule.styleMap.set('width', CSS.px(200));
assert_equals(getComputedStyle(target).width, '200px') assert_equals(getComputedStyle(target).width, '200px')
rule.attributeStyleMap.set('width', CSS.px(150)); rule.styleMap.set('width', CSS.px(150));
assert_equals(getComputedStyle(target).width, '150px') assert_equals(getComputedStyle(target).width, '150px')
}); });
</script> </script>
......
...@@ -26,6 +26,6 @@ PASS StylePropertyMap interface: operation set(DOMString, [object Object],[objec ...@@ -26,6 +26,6 @@ PASS StylePropertyMap interface: operation set(DOMString, [object Object],[objec
PASS StylePropertyMap interface: operation update(DOMString, UpdateFunction) PASS StylePropertyMap interface: operation update(DOMString, UpdateFunction)
PASS Element interface: operation computedStyleMap() PASS Element interface: operation computedStyleMap()
PASS Element interface: attribute attributeStyleMap PASS Element interface: attribute attributeStyleMap
PASS CSSStyleRule interface: attribute attributeStyleMap PASS CSSStyleRule interface: attribute styleMap
Harness: the test ran to completion. Harness: the test ran to completion.
...@@ -30,7 +30,7 @@ partial interface Element { ...@@ -30,7 +30,7 @@ partial interface Element {
}; };
partial interface CSSStyleRule { partial interface CSSStyleRule {
[SameObject] readonly attribute StylePropertyMap attributeStyleMap; [SameObject] readonly attribute StylePropertyMap styleMap;
}; };
partial interface Element { partial interface Element {
......
...@@ -123,7 +123,7 @@ function createDeclaredStyleMap(test, cssText) { ...@@ -123,7 +123,7 @@ function createDeclaredStyleMap(test, cssText) {
test.add_cleanup(() => { test.add_cleanup(() => {
style.remove(); style.remove();
}); });
return rule.attributeStyleMap; return rule.styleMap;
} }
// Creates a new element with background image set to |imageValue| // Creates a new element with background image set to |imageValue|
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<script> <script>
test(() => { test(() => {
var sheet = document.styleSheets[0]; var sheet = document.styleSheets[0];
var styleMap = sheet.cssRules[0].attributeStyleMap; var styleMap = sheet.cssRules[0].styleMap;
sheet.deleteRule(0); sheet.deleteRule(0);
gc(); gc();
......
...@@ -793,9 +793,9 @@ interface CSSStyleDeclaration ...@@ -793,9 +793,9 @@ interface CSSStyleDeclaration
setter cssText setter cssText
interface CSSStyleRule : CSSRule interface CSSStyleRule : CSSRule
attribute @@toStringTag attribute @@toStringTag
getter attributeStyleMap
getter selectorText getter selectorText
getter style getter style
getter styleMap
method constructor method constructor
setter selectorText setter selectorText
setter style setter style
......
...@@ -44,7 +44,7 @@ static SelectorTextCache& GetSelectorTextCache() { ...@@ -44,7 +44,7 @@ static SelectorTextCache& GetSelectorTextCache() {
CSSStyleRule::CSSStyleRule(StyleRule* style_rule, CSSStyleSheet* parent) CSSStyleRule::CSSStyleRule(StyleRule* style_rule, CSSStyleSheet* parent)
: CSSRule(parent), : CSSRule(parent),
style_rule_(style_rule), style_rule_(style_rule),
attribute_style_map_(new DeclaredStylePropertyMap(this)) {} style_map_(new DeclaredStylePropertyMap(this)) {}
CSSStyleRule::~CSSStyleRule() = default; CSSStyleRule::~CSSStyleRule() = default;
...@@ -111,7 +111,7 @@ void CSSStyleRule::Reattach(StyleRuleBase* rule) { ...@@ -111,7 +111,7 @@ void CSSStyleRule::Reattach(StyleRuleBase* rule) {
void CSSStyleRule::Trace(blink::Visitor* visitor) { void CSSStyleRule::Trace(blink::Visitor* visitor) {
visitor->Trace(style_rule_); visitor->Trace(style_rule_);
visitor->Trace(properties_cssom_wrapper_); visitor->Trace(properties_cssom_wrapper_);
visitor->Trace(attribute_style_map_); visitor->Trace(style_map_);
CSSRule::Trace(visitor); CSSRule::Trace(visitor);
} }
......
...@@ -51,9 +51,7 @@ class CORE_EXPORT CSSStyleRule final : public CSSRule { ...@@ -51,9 +51,7 @@ class CORE_EXPORT CSSStyleRule final : public CSSRule {
CSSStyleDeclaration* style() const; CSSStyleDeclaration* style() const;
StylePropertyMap* attributeStyleMap() const { StylePropertyMap* styleMap() const { return style_map_.Get(); }
return attribute_style_map_.Get();
}
// FIXME: Not CSSOM. Remove. // FIXME: Not CSSOM. Remove.
StyleRule* GetStyleRule() const { return style_rule_.Get(); } StyleRule* GetStyleRule() const { return style_rule_.Get(); }
...@@ -67,7 +65,7 @@ class CORE_EXPORT CSSStyleRule final : public CSSRule { ...@@ -67,7 +65,7 @@ class CORE_EXPORT CSSStyleRule final : public CSSRule {
Member<StyleRule> style_rule_; Member<StyleRule> style_rule_;
mutable Member<StyleRuleCSSStyleDeclaration> properties_cssom_wrapper_; mutable Member<StyleRuleCSSStyleDeclaration> properties_cssom_wrapper_;
Member<StylePropertyMap> attribute_style_map_; Member<StylePropertyMap> style_map_;
}; };
DEFINE_CSS_RULE_TYPE_CASTS(CSSStyleRule, kStyleRule); DEFINE_CSS_RULE_TYPE_CASTS(CSSStyleRule, kStyleRule);
......
...@@ -25,5 +25,5 @@ ...@@ -25,5 +25,5 @@
] interface CSSStyleRule : CSSRule { ] interface CSSStyleRule : CSSRule {
[SetterCallWith=ExecutionContext] attribute DOMString selectorText; [SetterCallWith=ExecutionContext] attribute DOMString selectorText;
[SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style; [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
[SameObject, RuntimeEnabled=CSSTypedOM, MeasureAs=CSSTypedOMStylePropertyMap] readonly attribute StylePropertyMap attributeStyleMap; [SameObject, RuntimeEnabled=CSSTypedOM, MeasureAs=CSSTypedOMStylePropertyMap] readonly attribute StylePropertyMap styleMap;
}; };
...@@ -19,7 +19,7 @@ class StyleRule; ...@@ -19,7 +19,7 @@ class StyleRule;
// The declared StylePropertyMap retrieves styles specified by a CSS style rule // The declared StylePropertyMap retrieves styles specified by a CSS style rule
// and returns them as CSSStyleValues. The IDL for this class is in // and returns them as CSSStyleValues. The IDL for this class is in
// StylePropertyMap.idl. The declared StylePropertyMap for an element is // StylePropertyMap.idl. The declared StylePropertyMap for an element is
// accessed via CSSStyleRule.attributeStyleMap (see CSSStyleRule.idl) // accessed via CSSStyleRule.styleMap (see CSSStyleRule.idl)
class CORE_EXPORT DeclaredStylePropertyMap final : public StylePropertyMap { class CORE_EXPORT DeclaredStylePropertyMap final : public StylePropertyMap {
WTF_MAKE_NONCOPYABLE(DeclaredStylePropertyMap); WTF_MAKE_NONCOPYABLE(DeclaredStylePropertyMap);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment