Commit ee1f52ee authored by nainar@chromium.org's avatar nainar@chromium.org

Make cssFloat an enumerable property of CSSStyleDeclaration

cssFloat does not show up as an enumerated property of 
CSSStyleDeclaration even though it does evaluate to a value. FF and 
IE both treat cssFloat as an enumerable property of CSSStyleDeclaration

BUG=492999

Review URL: https://codereview.chromium.org/1288623005

git-svn-id: svn://svn.chromium.org/blink/trunk@200965 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 656b425c
<!DOCTYPE html>
<script src="../../LayoutTests/resources/testharness.js"></script>
<script src="../../LayoutTests/resources/testharnessreport.js"></script>
<div id="target"></div>
<script>
addEventListener("load", function() {
test(function() {
assert_true('cssFloat' in getComputedStyle(target), 'cssFloat is in CSSStyleDeclaration');
assert_equals(target.style.cssFloat, '');
target.style.cssFloat = 'right';
assert_equals(target.style.cssFloat, 'right');
var CSSXGetComputedStyleQueries = 566;
assert_false(internals.isUseCounted(document, CSSXGetComputedStyleQueries));
}, 'Testing CSSFloat');
}, false);
</script>
...@@ -79,6 +79,7 @@ colorRendering ...@@ -79,6 +79,7 @@ colorRendering
content content
counterIncrement counterIncrement
counterReset counterReset
cssFloat
cssText cssText
cursor cursor
cx cx
......
...@@ -292,6 +292,7 @@ interface CSSRuleList ...@@ -292,6 +292,7 @@ interface CSSRuleList
method constructor method constructor
method item method item
interface CSSStyleDeclaration interface CSSStyleDeclaration
getter cssFloat
getter cssText getter cssText
getter length getter length
getter parentRule getter parentRule
...@@ -301,6 +302,7 @@ interface CSSStyleDeclaration ...@@ -301,6 +302,7 @@ interface CSSStyleDeclaration
method item method item
method removeProperty method removeProperty
method setProperty method setProperty
setter cssFloat
setter cssText setter cssText
interface CSSStyleRule interface CSSStyleRule
getter selectorText getter selectorText
......
...@@ -80,6 +80,7 @@ columnFill ...@@ -80,6 +80,7 @@ columnFill
content content
counterIncrement counterIncrement
counterReset counterReset
cssFloat
cssText cssText
cursor cursor
cx cx
......
...@@ -376,6 +376,7 @@ interface CSSRuleList ...@@ -376,6 +376,7 @@ interface CSSRuleList
method constructor method constructor
method item method item
interface CSSStyleDeclaration interface CSSStyleDeclaration
getter cssFloat
getter cssText getter cssText
getter length getter length
getter parentRule getter parentRule
...@@ -385,6 +386,7 @@ interface CSSStyleDeclaration ...@@ -385,6 +386,7 @@ interface CSSStyleDeclaration
method item method item
method removeProperty method removeProperty
method setProperty method setProperty
setter cssFloat
setter cssText setter cssText
interface CSSStyleRule interface CSSStyleRule
getter selectorText getter selectorText
......
...@@ -91,6 +91,8 @@ private: ...@@ -91,6 +91,8 @@ private:
bool isPropertyImplicit(const String& propertyName) override; bool isPropertyImplicit(const String& propertyName) override;
void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionState&) override; void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionState&) override;
String removeProperty(const String& propertyName, ExceptionState&) override; String removeProperty(const String& propertyName, ExceptionState&) override;
String cssFloat() const;
void setCSSFloat(const String&, ExceptionState&);
String cssText() const override; String cssText() const override;
void setCSSText(const String&, ExceptionState&) override; void setCSSText(const String&, ExceptionState&) override;
PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) override; PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) override;
......
...@@ -47,6 +47,14 @@ public: ...@@ -47,6 +47,14 @@ public:
#endif #endif
virtual CSSRule* parentRule() const = 0; virtual CSSRule* parentRule() const = 0;
String cssFloat()
{
return getPropertyValueInternal(CSSPropertyFloat);
}
void setCSSFloat(const String& value, ExceptionState& exceptionState)
{
setPropertyInternal(CSSPropertyFloat, value, false, exceptionState);
}
virtual String cssText() const = 0; virtual String cssText() const = 0;
virtual void setCSSText(const String&, ExceptionState&) = 0; virtual void setCSSText(const String&, ExceptionState&) = 0;
virtual unsigned length() const = 0; virtual unsigned length() const = 0;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
// void setPropertyPriority(DOMString property, [TreatNullAs=EmptyString] DOMString priority); // void setPropertyPriority(DOMString property, [TreatNullAs=EmptyString] DOMString priority);
[RaisesException] DOMString removeProperty(DOMString property); [RaisesException] DOMString removeProperty(DOMString property);
readonly attribute CSSRule? parentRule; readonly attribute CSSRule? parentRule;
// [TreatNullAs=EmptyString] attribute DOMString cssFloat; [RaisesException=Setter, TreatNullAs=EmptyString] attribute DOMString cssFloat;
// The camel-cased and dashed attribute getters have custom bindings. // The camel-cased and dashed attribute getters have custom bindings.
// http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-camel-cased-attribute // http://dev.w3.org/csswg/cssom/#dom-cssstyledeclaration-camel-cased-attribute
......
...@@ -56,6 +56,8 @@ private: ...@@ -56,6 +56,8 @@ private:
bool isPropertyImplicit(const String& propertyName) final; bool isPropertyImplicit(const String& propertyName) final;
void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionState&) final; void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionState&) final;
String removeProperty(const String& propertyName, ExceptionState&) final; String removeProperty(const String& propertyName, ExceptionState&) final;
String cssFloat() const;
void setCSSFloat(const String&, ExceptionState&);
String cssText() const final; String cssText() const final;
void setCSSText(const String&, ExceptionState&) final; void setCSSText(const String&, ExceptionState&) final;
PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) final; PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) final;
......
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