Title: [93430] trunk
Revision
93430
Author
[email protected]
Date
2011-08-19 12:27:13 -0700 (Fri, 19 Aug 2011)

Log Message

[CSSRegions]Parse -webkit-region-break(after, before, inside)
https://bugs.webkit.org/show_bug.cgi?id=66559

Patch by Mihnea Ovidenie <[email protected]> on 2011-08-19
Reviewed by David Hyatt.

Source/WebCore:

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSMutableStyleDeclaration.cpp:
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::regionBreakBefore):
(WebCore::InheritedFlags::regionBreakInside):
(WebCore::InheritedFlags::regionBreakAfter):
(WebCore::InheritedFlags::setRegionBreakBefore):
(WebCore::InheritedFlags::setRegionBreakInside):
(WebCore::InheritedFlags::setRegionBreakAfter):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

* fast/css/getComputedStyle/computed-style-expected.txt:
* platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* svg/css/getComputedStyle-basic-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (93429 => 93430)


--- trunk/LayoutTests/ChangeLog	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/LayoutTests/ChangeLog	2011-08-19 19:27:13 UTC (rev 93430)
@@ -1,5 +1,16 @@
 2011-08-19  Mihnea Ovidenie  <[email protected]>
 
+        [CSSRegions]Parse -webkit-region-break(after, before, inside)
+        https://bugs.webkit.org/show_bug.cgi?id=66559
+
+        Reviewed by David Hyatt.
+
+        * fast/css/getComputedStyle/computed-style-expected.txt:
+        * platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
+        * svg/css/getComputedStyle-basic-expected.txt:
+
+2011-08-19  Mihnea Ovidenie  <[email protected]>
+
         [CSSRegions]Content displayed in regions should not be scrollable
         https://bugs.webkit.org/show_bug.cgi?id=66459
 

Modified: trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt (93429 => 93430)


--- trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt	2011-08-19 19:27:13 UTC (rev 93430)
@@ -189,6 +189,9 @@
 -webkit-flow: auto;
 -webkit-content-order: 0;
 -webkit-region-overflow: auto;
+-webkit-region-break-after: auto;
+-webkit-region-break-before: auto;
+-webkit-region-break-inside: auto;
 clip-path: none;
 clip-rule: nonzero;
 mask: none;

Modified: trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt (93429 => 93430)


--- trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt	2011-08-19 19:27:13 UTC (rev 93430)
@@ -188,6 +188,9 @@
     -webkit-flow: auto
     -webkit-content-order: 0
     -webkit-region-overflow: auto
+    -webkit-region-break-after: auto
+    -webkit-region-break-before: auto
+    -webkit-region-break-inside: auto
     clip-path: none
     clip-rule: nonzero
     mask: none

Modified: trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt (93429 => 93430)


--- trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt	2011-08-19 19:27:13 UTC (rev 93430)
@@ -376,6 +376,12 @@
 rect: style.getPropertyCSSValue(-webkit-content-order) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-region-overflow) : auto
 rect: style.getPropertyCSSValue(-webkit-region-overflow) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-region-break-after) : auto
+rect: style.getPropertyCSSValue(-webkit-region-break-after) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-region-break-before) : auto
+rect: style.getPropertyCSSValue(-webkit-region-break-before) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-region-break-inside) : auto
+rect: style.getPropertyCSSValue(-webkit-region-break-inside) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(clip-path) : none
 rect: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(clip-rule) : nonzero
@@ -828,6 +834,12 @@
 g: style.getPropertyCSSValue(-webkit-content-order) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-region-overflow) : auto
 g: style.getPropertyCSSValue(-webkit-region-overflow) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-region-break-after) : auto
+g: style.getPropertyCSSValue(-webkit-region-break-after) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-region-break-before) : auto
+g: style.getPropertyCSSValue(-webkit-region-break-before) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-region-break-inside) : auto
+g: style.getPropertyCSSValue(-webkit-region-break-inside) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(clip-path) : none
 g: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(clip-rule) : nonzero

Modified: trunk/Source/WebCore/ChangeLog (93429 => 93430)


--- trunk/Source/WebCore/ChangeLog	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/Source/WebCore/ChangeLog	2011-08-19 19:27:13 UTC (rev 93430)
@@ -1,3 +1,30 @@
+2011-08-19  Mihnea Ovidenie  <[email protected]>
+
+        [CSSRegions]Parse -webkit-region-break(after, before, inside)
+        https://bugs.webkit.org/show_bug.cgi?id=66559
+
+        Reviewed by David Hyatt.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSMutableStyleDeclaration.cpp:
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        * css/CSSPropertyNames.in:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applyProperty):
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::regionBreakBefore):
+        (WebCore::InheritedFlags::regionBreakInside):
+        (WebCore::InheritedFlags::regionBreakAfter):
+        (WebCore::InheritedFlags::setRegionBreakBefore):
+        (WebCore::InheritedFlags::setRegionBreakInside):
+        (WebCore::InheritedFlags::setRegionBreakAfter):
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==):
+        * rendering/style/StyleRareNonInheritedData.h:
+
 2011-08-19  Emil A Eklund  <[email protected]>
 
         Switch RenderLayer to to new layout types

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (93429 => 93430)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2011-08-19 19:27:13 UTC (rev 93430)
@@ -251,7 +251,10 @@
     CSSPropertyWebkitWritingMode,
     CSSPropertyWebkitFlow,
     CSSPropertyWebkitContentOrder,
-    CSSPropertyWebkitRegionOverflow
+    CSSPropertyWebkitRegionOverflow,
+    CSSPropertyWebkitRegionBreakAfter,
+    CSSPropertyWebkitRegionBreakBefore,
+    CSSPropertyWebkitRegionBreakInside
 #if ENABLE(SVG)
     ,
     CSSPropertyClipPath,
@@ -1068,6 +1071,12 @@
             if (style->hasAutoColumnWidth())
                 return primitiveValueCache->createIdentifierValue(CSSValueAuto);
             return zoomAdjustedPixelValue(style->columnWidth(), style.get(), primitiveValueCache);
+        case CSSPropertyWebkitRegionBreakAfter:
+            return primitiveValueCache->createValue(style->regionBreakAfter());
+        case CSSPropertyWebkitRegionBreakBefore:
+            return primitiveValueCache->createValue(style->regionBreakBefore());
+        case CSSPropertyWebkitRegionBreakInside:
+            return primitiveValueCache->createValue(style->regionBreakInside());
         case CSSPropertyCursor: {
             RefPtr<CSSValueList> list;
             CursorList* cursors = style->cursors();

Modified: trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp (93429 => 93430)


--- trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp	2011-08-19 19:27:13 UTC (rev 93430)
@@ -802,6 +802,9 @@
     CSSPropertyPageBreakAfter,
     CSSPropertyPageBreakBefore,
     CSSPropertyPageBreakInside,
+    CSSPropertyWebkitRegionBreakAfter,
+    CSSPropertyWebkitRegionBreakBefore,
+    CSSPropertyWebkitRegionBreakInside,
     CSSPropertyTextAlign,
     CSSPropertyTextIndent,
     CSSPropertyWidows

Modified: trunk/Source/WebCore/css/CSSParser.cpp (93429 => 93430)


--- trunk/Source/WebCore/css/CSSParser.cpp	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2011-08-19 19:27:13 UTC (rev 93430)
@@ -883,6 +883,8 @@
     case CSSPropertyPageBreakBefore:
     case CSSPropertyWebkitColumnBreakAfter:
     case CSSPropertyWebkitColumnBreakBefore:
+    case CSSPropertyWebkitRegionBreakAfter:
+    case CSSPropertyWebkitRegionBreakBefore:
         if (id == CSSValueAuto ||
              id == CSSValueAlways ||
              id == CSSValueAvoid ||
@@ -893,6 +895,7 @@
 
     case CSSPropertyPageBreakInside:    // avoid | auto | inherit
     case CSSPropertyWebkitColumnBreakInside:
+    case CSSPropertyWebkitRegionBreakInside:
         if (id == CSSValueAuto || id == CSSValueAvoid)
             validPrimitive = true;
         break;

Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (93429 => 93430)


--- trunk/Source/WebCore/css/CSSPropertyNames.in	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in	2011-08-19 19:27:13 UTC (rev 93430)
@@ -331,4 +331,7 @@
 -webkit-content-order
 -webkit-region-overflow
 -webkit-wrap-shape
+-webkit-region-break-after
+-webkit-region-break-before
+-webkit-region-break-inside
 

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (93429 => 93430)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-08-19 19:27:13 UTC (rev 93430)
@@ -4556,6 +4556,15 @@
             m_style->setColumnCount(RenderStyle::initialColumnCount());
         }
         return;
+    case CSSPropertyWebkitRegionBreakBefore:
+        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE_WITH_VALUE(regionBreakBefore, RegionBreakBefore, PageBreak)
+        return;
+    case CSSPropertyWebkitRegionBreakAfter:
+        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE_WITH_VALUE(regionBreakAfter, RegionBreakAfter, PageBreak)
+        return;
+    case CSSPropertyWebkitRegionBreakInside:
+        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE_WITH_VALUE(regionBreakInside, RegionBreakInside, PageBreak)
+        return;
     case CSSPropertyWebkitMarquee:
         if (valueType != CSSValue::CSS_INHERIT || !m_parentNode) return;
         m_style->setMarqueeDirection(m_parentStyle->marqueeDirection());

Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (93429 => 93430)


--- trunk/Source/WebCore/rendering/style/RenderStyle.h	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h	2011-08-19 19:27:13 UTC (rev 93430)
@@ -725,6 +725,9 @@
     EPageBreak columnBreakBefore() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakBefore); }
     EPageBreak columnBreakInside() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakInside); }
     EPageBreak columnBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_multiCol->m_breakAfter); }
+    EPageBreak regionBreakBefore() const { return static_cast<EPageBreak>(rareNonInheritedData->m_regionBreakBefore); }
+    EPageBreak regionBreakInside() const { return static_cast<EPageBreak>(rareNonInheritedData->m_regionBreakInside); }
+    EPageBreak regionBreakAfter() const { return static_cast<EPageBreak>(rareNonInheritedData->m_regionBreakAfter); }
     const TransformOperations& transform() const { return rareNonInheritedData->m_transform->m_operations; }
     Length transformOriginX() const { return rareNonInheritedData->m_transform->m_x; }
     Length transformOriginY() const { return rareNonInheritedData->m_transform->m_y; }
@@ -1097,6 +1100,9 @@
     // For valid values of column-break-inside see http://www.w3.org/TR/css3-multicol/#break-before-break-after-break-inside
     void setColumnBreakInside(EPageBreak p) { ASSERT(p == PBAUTO || p == PBAVOID); SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakInside, p); }
     void setColumnBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData.access()->m_multiCol, m_breakAfter, p); }
+    void setRegionBreakBefore(EPageBreak p) { SET_VAR(rareNonInheritedData, m_regionBreakBefore, p); }
+    void setRegionBreakInside(EPageBreak p) { ASSERT(p == PBAUTO || p == PBAVOID); SET_VAR(rareNonInheritedData, m_regionBreakInside, p); }
+    void setRegionBreakAfter(EPageBreak p) { SET_VAR(rareNonInheritedData, m_regionBreakAfter, p); }
     void inheritColumnPropertiesFrom(RenderStyle* parent) { rareNonInheritedData.access()->m_multiCol = parent->rareNonInheritedData->m_multiCol; }
     void setTransform(const TransformOperations& ops) { SET_VAR(rareNonInheritedData.access()->m_transform, m_operations, ops); }
     void setTransformOriginX(Length l) { SET_VAR(rareNonInheritedData.access()->m_transform, m_x, l); }

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp (93429 => 93430)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.cpp	2011-08-19 19:27:13 UTC (rev 93430)
@@ -60,6 +60,9 @@
     , m_regionIndex(RenderStyle::initialRegionIndex())
     , m_regionOverflow(RenderStyle::initialRegionOverflow())
     , m_wrapShape(RenderStyle::initialWrapShape())
+    , m_regionBreakAfter(RenderStyle::initialPageBreak())
+    , m_regionBreakBefore(RenderStyle::initialPageBreak())
+    , m_regionBreakInside(RenderStyle::initialPageBreak())
 {
 }
 
@@ -107,6 +110,9 @@
     , m_regionIndex(o.m_regionIndex)
     , m_regionOverflow(o.m_regionOverflow)
     , m_wrapShape(o.m_wrapShape)
+    , m_regionBreakAfter(o.m_regionBreakAfter)
+    , m_regionBreakBefore(o.m_regionBreakBefore)
+    , m_regionBreakInside(o.m_regionBreakInside)
 {
 }
 
@@ -160,7 +166,10 @@
         && (m_regionThread == o.m_regionThread)
         && (m_regionIndex == o.m_regionIndex)
         && (m_regionOverflow == o.m_regionOverflow)
-        && (m_wrapShape == o.m_wrapShape);
+        && (m_wrapShape == o.m_wrapShape)
+        && (m_regionBreakAfter == o.m_regionBreakAfter)
+        && (m_regionBreakBefore == o.m_regionBreakBefore)
+        && (m_regionBreakInside == o.m_regionBreakInside);
 }
 
 bool StyleRareNonInheritedData::contentDataEquivalent(const StyleRareNonInheritedData& o) const

Modified: trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h (93429 => 93430)


--- trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2011-08-19 19:26:03 UTC (rev 93429)
+++ trunk/Source/WebCore/rendering/style/StyleRareNonInheritedData.h	2011-08-19 19:27:13 UTC (rev 93430)
@@ -143,6 +143,10 @@
 
     RefPtr<CSSWrapShape> m_wrapShape;
 
+    unsigned m_regionBreakAfter : 2; // EPageBreak
+    unsigned m_regionBreakBefore : 2; // EPageBreak
+    unsigned m_regionBreakInside : 2; // EPageBreak
+
 private:
     StyleRareNonInheritedData();
     StyleRareNonInheritedData(const StyleRareNonInheritedData&);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to