Title: [120943] trunk
Revision
120943
Author
[email protected]
Date
2012-06-21 10:53:54 -0700 (Thu, 21 Jun 2012)

Log Message

[CSSRegions]Change WEBKIT_REGION_RULE value to 16
https://bugs.webkit.org/show_bug.cgi?id=89421

Patch by Andrei Onea <[email protected]> on 2012-06-21
Reviewed by Tony Chang.

Source/WebCore:

Modified WEBKIT_REGION_RULE where applicable to match CSS Regions spec.
The new value for WEBKIT_REGION_RULE is 16 (was 10).

* css/CSSRule.cpp:
(WebCore):
Added COMPILE_ASSERT to ensure StyleRule::Region and CSSRule::WEBKIT_REGION_RULE will
* css/CSSRule.h:
(CSSRule):
Modified m_type bitfield length to 5
* css/CSSRule.idl:
* css/StyleRule.cpp:
(SameSizeAsStyleRuleBase):
(WebCore):
Added COMPILE_ASSERT to ensure that StyleRuleBase will always have exactly 32bits.
* css/StyleRule.h:
(StyleRuleBase):
Modified m_type bitfield to 5 to accommodate the new value, and modified
m_sourceLine bitfield to 27 bits in order to keep StyleRule 32
bits long. Consequently, any css rule longer than 67,108,863 lines will
cause overflow - however, the value is large enough not to cause
problems.

LayoutTests:

Added check for exact value of WEBKIT_REGION_RULE which should be 16,
according to CSS Regions spec.

* fast/regions/webkit-region-rule-expected.txt:
* fast/regions/webkit-region-rule.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (120942 => 120943)


--- trunk/LayoutTests/ChangeLog	2012-06-21 17:50:34 UTC (rev 120942)
+++ trunk/LayoutTests/ChangeLog	2012-06-21 17:53:54 UTC (rev 120943)
@@ -1,3 +1,16 @@
+2012-06-21  Andrei Onea  <[email protected]>
+
+        [CSSRegions]Change WEBKIT_REGION_RULE value to 16
+        https://bugs.webkit.org/show_bug.cgi?id=89421
+
+        Reviewed by Tony Chang.
+
+        Added check for exact value of WEBKIT_REGION_RULE which should be 16,
+        according to CSS Regions spec.
+
+        * fast/regions/webkit-region-rule-expected.txt:
+        * fast/regions/webkit-region-rule.html:
+
 2012-06-21  Jon Lee  <[email protected]>
 
         r120835: fast/box-decoration-break/box-decoration-break-rendering.html failing on mac bots

Modified: trunk/LayoutTests/fast/regions/webkit-region-rule-expected.txt (120942 => 120943)


--- trunk/LayoutTests/fast/regions/webkit-region-rule-expected.txt	2012-06-21 17:50:34 UTC (rev 120942)
+++ trunk/LayoutTests/fast/regions/webkit-region-rule-expected.txt	2012-06-21 17:53:54 UTC (rev 120943)
@@ -5,6 +5,7 @@
 
 PASS WebKitCSSRegionRule exists on Window object
 PASS WEBKIT_REGION_RULE exists on Window.CSSRule object
+PASS window.CSSRule.WEBKIT_REGION_RULE is 16
 PASS regionRule1.type is window.CSSRule.WEBKIT_REGION_RULE
 PASS regionRule1CSSRules.length is 2
 PASS regionRule1CSSRules.item(0).type is window.CSSRule.STYLE_RULE

Modified: trunk/LayoutTests/fast/regions/webkit-region-rule.html (120942 => 120943)


--- trunk/LayoutTests/fast/regions/webkit-region-rule.html	2012-06-21 17:50:34 UTC (rev 120942)
+++ trunk/LayoutTests/fast/regions/webkit-region-rule.html	2012-06-21 17:53:54 UTC (rev 120943)
@@ -26,6 +26,7 @@
     testPassed("WEBKIT_REGION_RULE exists on Window.CSSRule object");
 else
     testFailed("WEBKIT_REGION_RULE does not exist on Window.CSSRule object");
+shouldBe("window.CSSRule.WEBKIT_REGION_RULE", "16");
 
 var regionRule1 = document.styleSheets.item(0).cssRules.item(0);
 shouldBe("regionRule1.type", "window.CSSRule.WEBKIT_REGION_RULE");

Modified: trunk/Source/WebCore/ChangeLog (120942 => 120943)


--- trunk/Source/WebCore/ChangeLog	2012-06-21 17:50:34 UTC (rev 120942)
+++ trunk/Source/WebCore/ChangeLog	2012-06-21 17:53:54 UTC (rev 120943)
@@ -1,3 +1,32 @@
+2012-06-21  Andrei Onea  <[email protected]>
+
+        [CSSRegions]Change WEBKIT_REGION_RULE value to 16
+        https://bugs.webkit.org/show_bug.cgi?id=89421
+
+        Reviewed by Tony Chang.
+
+        Modified WEBKIT_REGION_RULE where applicable to match CSS Regions spec.
+        The new value for WEBKIT_REGION_RULE is 16 (was 10).
+
+        * css/CSSRule.cpp:
+        (WebCore):
+        Added COMPILE_ASSERT to ensure StyleRule::Region and CSSRule::WEBKIT_REGION_RULE will
+        * css/CSSRule.h:
+        (CSSRule):
+        Modified m_type bitfield length to 5
+        * css/CSSRule.idl:
+        * css/StyleRule.cpp:
+        (SameSizeAsStyleRuleBase):
+        (WebCore):
+        Added COMPILE_ASSERT to ensure that StyleRuleBase will always have exactly 32bits.
+        * css/StyleRule.h:
+        (StyleRuleBase):
+        Modified m_type bitfield to 5 to accommodate the new value, and modified
+        m_sourceLine bitfield to 27 bits in order to keep StyleRule 32
+        bits long. Consequently, any css rule longer than 67,108,863 lines will
+        cause overflow - however, the value is large enough not to cause
+        problems.
+
 2012-06-21  Silvia Pfeiffer  <[email protected]>
 
         Paint played and buffered ranges differently in Chrome video controls.

Modified: trunk/Source/WebCore/css/CSSRule.cpp (120942 => 120943)


--- trunk/Source/WebCore/css/CSSRule.cpp	2012-06-21 17:50:34 UTC (rev 120942)
+++ trunk/Source/WebCore/css/CSSRule.cpp	2012-06-21 17:53:54 UTC (rev 120943)
@@ -46,6 +46,10 @@
 
 COMPILE_ASSERT(sizeof(CSSRule) == sizeof(SameSizeAsCSSRule), CSSRule_should_stay_small);
 
+#if ENABLE(CSS_REGIONS)
+COMPILE_ASSERT(StyleRuleBase::Region == static_cast<StyleRuleBase::Type>(CSSRule::WEBKIT_REGION_RULE), enums_should_match);
+#endif
+
 void CSSRule::setCssText(const String& /*cssText*/, ExceptionCode& /*ec*/)
 {
     notImplemented();

Modified: trunk/Source/WebCore/css/CSSRule.h (120942 => 120943)


--- trunk/Source/WebCore/css/CSSRule.h	2012-06-21 17:50:34 UTC (rev 120942)
+++ trunk/Source/WebCore/css/CSSRule.h	2012-06-21 17:53:54 UTC (rev 120943)
@@ -58,7 +58,7 @@
         WEBKIT_KEYFRAMES_RULE,
         WEBKIT_KEYFRAME_RULE,
 #if ENABLE(CSS_REGIONS)
-        WEBKIT_REGION_RULE = 10
+        WEBKIT_REGION_RULE = 16
 #endif
     };
 
@@ -125,7 +125,7 @@
 private:
     mutable unsigned m_hasCachedSelectorText : 1;
     unsigned m_parentIsRule : 1;
-    unsigned m_type : 4;
+    unsigned m_type : 5;
     union {
         CSSRule* m_parentRule;
         CSSStyleSheet* m_parentStyleSheet;

Modified: trunk/Source/WebCore/css/CSSRule.idl (120942 => 120943)


--- trunk/Source/WebCore/css/CSSRule.idl	2012-06-21 17:50:34 UTC (rev 120942)
+++ trunk/Source/WebCore/css/CSSRule.idl	2012-06-21 17:53:54 UTC (rev 120943)
@@ -40,7 +40,7 @@
         const unsigned short WEBKIT_KEYFRAMES_RULE = 7;
         const unsigned short WEBKIT_KEYFRAME_RULE = 8;
 #if defined(ENABLE_CSS_REGIONS) && ENABLE_CSS_REGIONS
-        const unsigned short WEBKIT_REGION_RULE = 10;
+        const unsigned short WEBKIT_REGION_RULE = 16;
 #endif
 
         readonly attribute unsigned short   type;

Modified: trunk/Source/WebCore/css/StyleRule.cpp (120942 => 120943)


--- trunk/Source/WebCore/css/StyleRule.cpp	2012-06-21 17:50:34 UTC (rev 120942)
+++ trunk/Source/WebCore/css/StyleRule.cpp	2012-06-21 17:53:54 UTC (rev 120943)
@@ -35,6 +35,12 @@
 
 namespace WebCore {
 
+struct SameSizeAsStyleRuleBase : public WTF::RefCountedBase {
+    unsigned bitfields;
+};
+
+COMPILE_ASSERT(sizeof(StyleRuleBase) == sizeof(SameSizeAsStyleRuleBase), StyleRuleBase_should_stay_small);
+
 PassRefPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSStyleSheet* parentSheet) const
 {
     return createCSSOMWrapper(parentSheet, 0);

Modified: trunk/Source/WebCore/css/StyleRule.h (120942 => 120943)


--- trunk/Source/WebCore/css/StyleRule.h	2012-06-21 17:50:34 UTC (rev 120942)
+++ trunk/Source/WebCore/css/StyleRule.h	2012-06-21 17:53:54 UTC (rev 120943)
@@ -45,7 +45,7 @@
         Page,
         Keyframes,
         Keyframe, // Not used. These are internally non-rule StyleKeyframe objects.
-        Region
+        Region = 16
     };
     Type type() const { return static_cast<Type>(m_type); }
     
@@ -83,8 +83,8 @@
     
     PassRefPtr<CSSRule> createCSSOMWrapper(CSSStyleSheet* parentSheet, CSSRule* parentRule) const;
 
-    unsigned m_type : 4;
-    signed m_sourceLine : 28;
+    unsigned m_type : 5;
+    signed m_sourceLine : 27;
 };
 
 class StyleRule : public StyleRuleBase {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to