Right now we have two properties named margin-top-collapse and margin-after-collapse...
authorhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Sep 2010 21:16:50 +0000 (21:16 +0000)
committerhyatt@apple.com <hyatt@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Sep 2010 21:16:50 +0000 (21:16 +0000)
Reviewed by Sam Weinig.

I am adding margin-before-collapse and margin-after-collapse and just aliasing the old properties to the new ones.
This way we have some names that are directionally independent.

Note that these properties aren't like other directional properties.  They are about what to do with the before side and after side of
your block's margins when collapsing with adjacent blocks.  The meaning of before/after depend on the block-flow directionality
of the containing block.

Computed style tests all changed and the remove-shorthand.html test covers manipulation of the shorthand.

WebCore:

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSPropertyLonghand.cpp:
(WebCore::initShorthandMap):
* css/CSSPropertyNames.in:
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::applyProperty):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::MarginInfo::MarginInfo):
(WebCore::RenderBlock::isSelfCollapsingBlock):
(WebCore::RenderBlock::collapseMargins):
(WebCore::RenderBlock::layoutBlockChild):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::marginBeforeCollapse):
(WebCore::InheritedFlags::marginAfterCollapse):
(WebCore::InheritedFlags::setMarginBeforeCollapse):
(WebCore::InheritedFlags::setMarginAfterCollapse):
(WebCore::InheritedFlags::initialMarginBeforeCollapse):
(WebCore::InheritedFlags::initialMarginAfterCollapse):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator==):
* rendering/style/StyleRareNonInheritedData.h:

LayoutTests:

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@68561 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/css/remove-shorthand-expected.txt
LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-expected.txt
LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
LayoutTests/svg/css/getComputedStyle-basic-expected.txt
WebCore/ChangeLog
WebCore/css/CSSComputedStyleDeclaration.cpp
WebCore/css/CSSParser.cpp
WebCore/css/CSSPropertyLonghand.cpp
WebCore/css/CSSPropertyNames.in
WebCore/css/CSSStyleSelector.cpp
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/style/RenderStyle.cpp
WebCore/rendering/style/RenderStyle.h
WebCore/rendering/style/StyleRareNonInheritedData.cpp
WebCore/rendering/style/StyleRareNonInheritedData.h

index 01820d670db7cf51c14702479e1c554a339fc909..9aae902cd5791726c4073a48643a0de6056ca493 100644 (file)
@@ -1,3 +1,23 @@
+2010-09-28  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Right now we have two properties named margin-top-collapse and margin-after-collapse.  They are proprietary and only used by Safari RSS.
+
+        I am adding margin-before-collapse and margin-after-collapse and just aliasing the old properties to the new ones.
+        This way we have some names that are directionally independent.
+
+        Note that these properties aren't like other directional properties.  They are about what to do with the before side and after side of
+        your block's margins when collapsing with adjacent blocks.  The meaning of before/after depend on the block-flow directionality
+        of the containing block.
+
+        Computed style tests all changed and the remove-shorthand.html test covers manipulation of the shorthand.
+
+        * fast/css/remove-shorthand-expected.txt:
+        * platform/mac/fast/css/getComputedStyle/computed-style-expected.txt:
+        * platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
+        * svg/css/getComputedStyle-basic-expected.txt:
+
 2010-09-28  Martin Robinson  <mrobinson@igalia.com>
 
         Reviewed by Gustavo Noronha Silva.
index 26abc37b4e922dea30feaaef80c6e731092caf3e..19a9e9be0510bcead89dcca1baaaf9083088bbc5 100644 (file)
@@ -19,7 +19,7 @@ Removing -webkit-columns removes -webkit-column-width, -webkit-column-count.
 Removing -webkit-column-rule removes -webkit-column-rule-width, -webkit-column-rule-style, -webkit-column-rule-color.
 Removing list-style removes list-style-type, list-style-position, list-style-image.
 Removing margin removes margin-top, margin-right, margin-bottom, margin-left.
-Removing -webkit-margin-collapse removes -webkit-margin-top-collapse, -webkit-margin-bottom-collapse.
+Removing -webkit-margin-collapse removes -webkit-margin-before-collapse, -webkit-margin-after-collapse.
 Removing -webkit-marquee removes -webkit-marquee-direction, -webkit-marquee-increment, -webkit-marquee-repetition, -webkit-marquee-style, -webkit-marquee-speed.
 Removing -webkit-mask removes -webkit-mask-image, -webkit-mask-repeat-x, -webkit-mask-repeat-y, -webkit-mask-attachment, -webkit-mask-position-x, -webkit-mask-position-y, -webkit-mask-origin, -webkit-mask-clip.
 Removing -webkit-mask-position removes -webkit-mask-position-x, -webkit-mask-position-y.
index c642012623da4212d163507ecc8292ec01b9f616..27ac2ff75941d0e0fd408cf10c6f56252a33d812 100644 (file)
@@ -139,8 +139,8 @@ zoom: 1;
 -webkit-highlight: none;
 -webkit-line-break: normal;
 -webkit-line-clamp: none;
--webkit-margin-bottom-collapse: collapse;
--webkit-margin-top-collapse: collapse;
+-webkit-margin-before-collapse: collapse;
+-webkit-margin-after-collapse: collapse;
 -webkit-marquee-direction: auto;
 -webkit-marquee-increment: 6px;
 -webkit-marquee-repetition: infinite;
index 1f742b823e04df7d3df8482f80becbfa01fab5f4..67bdc27160302d39c24abdc13ef112129203e9cf 100644 (file)
@@ -138,8 +138,8 @@ Computed style of an element whose parent's 'display' value is 'none':
     -webkit-highlight: none
     -webkit-line-break: normal
     -webkit-line-clamp: none
-    -webkit-margin-bottom-collapse: collapse
-    -webkit-margin-top-collapse: collapse
+    -webkit-margin-before-collapse: collapse
+    -webkit-margin-after-collapse: collapse
     -webkit-marquee-direction: auto
     -webkit-marquee-increment: 6px
     -webkit-marquee-repetition: infinite
index 757db218d89dfda0cdfd2c6a569366edef38cb85..4ea73ad0cc62edf3bb215af06b71e0ea880af53a 100644 (file)
@@ -276,10 +276,10 @@ rect: style.getPropertyValue(-webkit-line-break) : normal
 rect: style.getPropertyCSSValue(-webkit-line-break) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-line-clamp) : none
 rect: style.getPropertyCSSValue(-webkit-line-clamp) : [object CSSPrimitiveValue]
-rect: style.getPropertyValue(-webkit-margin-bottom-collapse) : collapse
-rect: style.getPropertyCSSValue(-webkit-margin-bottom-collapse) : [object CSSPrimitiveValue]
-rect: style.getPropertyValue(-webkit-margin-top-collapse) : collapse
-rect: style.getPropertyCSSValue(-webkit-margin-top-collapse) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-margin-before-collapse) : collapse
+rect: style.getPropertyCSSValue(-webkit-margin-before-collapse) : [object CSSPrimitiveValue]
+rect: style.getPropertyValue(-webkit-margin-after-collapse) : collapse
+rect: style.getPropertyCSSValue(-webkit-margin-after-collapse) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-marquee-direction) : auto
 rect: style.getPropertyCSSValue(-webkit-marquee-direction) : [object CSSPrimitiveValue]
 rect: style.getPropertyValue(-webkit-marquee-increment) : 6px
@@ -698,10 +698,10 @@ g: style.getPropertyValue(-webkit-line-break) : normal
 g: style.getPropertyCSSValue(-webkit-line-break) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-line-clamp) : none
 g: style.getPropertyCSSValue(-webkit-line-clamp) : [object CSSPrimitiveValue]
-g: style.getPropertyValue(-webkit-margin-bottom-collapse) : collapse
-g: style.getPropertyCSSValue(-webkit-margin-bottom-collapse) : [object CSSPrimitiveValue]
-g: style.getPropertyValue(-webkit-margin-top-collapse) : collapse
-g: style.getPropertyCSSValue(-webkit-margin-top-collapse) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-margin-before-collapse) : collapse
+g: style.getPropertyCSSValue(-webkit-margin-before-collapse) : [object CSSPrimitiveValue]
+g: style.getPropertyValue(-webkit-margin-after-collapse) : collapse
+g: style.getPropertyCSSValue(-webkit-margin-after-collapse) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-marquee-direction) : auto
 g: style.getPropertyCSSValue(-webkit-marquee-direction) : [object CSSPrimitiveValue]
 g: style.getPropertyValue(-webkit-marquee-increment) : 6px
index 8806f7acee4f51873d74386d73aa2c9b0f9672f2..6cf16817fa7023902062263afe9a7347a3e2e3cb 100644 (file)
@@ -1,3 +1,46 @@
+2010-09-28  David Hyatt  <hyatt@apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Right now we have two properties named margin-top-collapse and margin-after-collapse.  They are proprietary and only used by Safari RSS.
+
+        I am adding margin-before-collapse and margin-after-collapse and just aliasing the old properties to the new ones.
+        This way we have some names that are directionally independent.
+
+        Note that these properties aren't like other directional properties.  They are about what to do with the before side and after side of
+        your block's margins when collapsing with adjacent blocks.  The meaning of before/after depend on the block-flow directionality
+        of the containing block.
+
+        Computed style tests all changed and the remove-shorthand.html test covers manipulation of the shorthand.
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        * css/CSSPropertyLonghand.cpp:
+        (WebCore::initShorthandMap):
+        * css/CSSPropertyNames.in:
+        * css/CSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applyProperty):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::MarginInfo::MarginInfo):
+        (WebCore::RenderBlock::isSelfCollapsingBlock):
+        (WebCore::RenderBlock::collapseMargins):
+        (WebCore::RenderBlock::layoutBlockChild):
+        * rendering/style/RenderStyle.cpp:
+        (WebCore::RenderStyle::diff):
+        * rendering/style/RenderStyle.h:
+        (WebCore::InheritedFlags::marginBeforeCollapse):
+        (WebCore::InheritedFlags::marginAfterCollapse):
+        (WebCore::InheritedFlags::setMarginBeforeCollapse):
+        (WebCore::InheritedFlags::setMarginAfterCollapse):
+        (WebCore::InheritedFlags::initialMarginBeforeCollapse):
+        (WebCore::InheritedFlags::initialMarginAfterCollapse):
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
+        (WebCore::StyleRareNonInheritedData::operator==):
+        * rendering/style/StyleRareNonInheritedData.h:
+
 2010-09-28  Martin Robinson  <mrobinson@igalia.com>
 
         Reviewed by Gustavo Noronha Silva.
index 1333239d6f07f306c974980c47228ddfc891b37e..1cc79961167c8869a7c4332aaf780594f4bd5567 100644 (file)
@@ -192,8 +192,8 @@ static const int computedProperties[] = {
     CSSPropertyWebkitHighlight,
     CSSPropertyWebkitLineBreak,
     CSSPropertyWebkitLineClamp,
-    CSSPropertyWebkitMarginBottomCollapse,
-    CSSPropertyWebkitMarginTopCollapse,
+    CSSPropertyWebkitMarginBeforeCollapse,
+    CSSPropertyWebkitMarginAfterCollapse,
     CSSPropertyWebkitMarqueeDirection,
     CSSPropertyWebkitMarqueeIncrement,
     CSSPropertyWebkitMarqueeRepetition,
@@ -1362,10 +1362,10 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper
         case CSSPropertyWebkitFontSizeDelta:
             // Not a real style property -- used by the editing engine -- so has no computed value.
             break;
-        case CSSPropertyWebkitMarginBottomCollapse:
-            return CSSPrimitiveValue::create(style->marginBottomCollapse());
-        case CSSPropertyWebkitMarginTopCollapse:
-            return CSSPrimitiveValue::create(style->marginTopCollapse());
+        case CSSPropertyWebkitMarginAfterCollapse:
+            return CSSPrimitiveValue::create(style->marginAfterCollapse());
+        case CSSPropertyWebkitMarginBeforeCollapse:
+            return CSSPrimitiveValue::create(style->marginBeforeCollapse());
         case CSSPropertyWebkitPerspective:
             if (!style->hasPerspective())
                 return CSSPrimitiveValue::createIdentifier(CSSValueNone);
index 5479bdfbd396273f361675728cf3340ac798a4dd..de4a991f2d6c4cbcdc7950ff1c819dca30c2ba00 100644 (file)
@@ -1431,8 +1431,8 @@ bool CSSParser::parseValue(int propId, bool important)
         return false;
     }
     case CSSPropertyWebkitMarginCollapse: {
-        const int properties[2] = { CSSPropertyWebkitMarginTopCollapse,
-            CSSPropertyWebkitMarginBottomCollapse };
+        const int properties[2] = { CSSPropertyWebkitMarginBeforeCollapse,
+            CSSPropertyWebkitMarginAfterCollapse };
         if (num == 1) {
             ShorthandScope scope(this, CSSPropertyWebkitMarginCollapse);
             if (!parseValue(properties[0], important))
@@ -1449,6 +1449,8 @@ bool CSSParser::parseValue(int propId, bool important)
         }
         return false;
     }
+    case CSSPropertyWebkitMarginBeforeCollapse:
+    case CSSPropertyWebkitMarginAfterCollapse:
     case CSSPropertyWebkitMarginTopCollapse:
     case CSSPropertyWebkitMarginBottomCollapse:
         if (id == CSSValueCollapse || id == CSSValueSeparate || id == CSSValueDiscard)
index a4b3325d2855884c285f03b5b9796a9e06303a07..acca036543149caf84f645b01ebcf6606e347f45 100644 (file)
@@ -98,7 +98,7 @@ static void initShorthandMap(ShorthandMap& shorthandMap)
     };
     SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyMargin, marginProperties);
 
-    static const int marginCollapseProperties[] = { CSSPropertyWebkitMarginTopCollapse, CSSPropertyWebkitMarginBottomCollapse };
+    static const int marginCollapseProperties[] = { CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginAfterCollapse };
     SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyWebkitMarginCollapse, marginCollapseProperties);
 
     static const int marqueeProperties[] = {
index addeccafcc845dac728094a6cc891b5947b9e872..8584e5f7bed5109634f939b1e206d117e29280cb 100644 (file)
@@ -232,13 +232,15 @@ z-index
 -webkit-line-clamp
 -webkit-logical-width
 -webkit-logical-height
+-webkit-margin-after-collapse
+-webkit-margin-before-collapse
 -webkit-margin-bottom-collapse
+-webkit-margin-top-collapse
 -webkit-margin-collapse
 -webkit-margin-after
 -webkit-margin-before
 -webkit-margin-end
 -webkit-margin-start
--webkit-margin-top-collapse
 -webkit-marquee
 -webkit-marquee-direction
 -webkit-marquee-increment
index d0a39948279427ee47a5fa382665776b51c98f0e..ae9d912f02b3d25c1778474777d888c01ff0204d 100644 (file)
@@ -5158,21 +5158,23 @@ void CSSStyleSelector::applyProperty(int id, CSSValue *value)
     }
     case CSSPropertyWebkitMarginCollapse: {
         if (isInherit) {
-            m_style->setMarginTopCollapse(m_parentStyle->marginTopCollapse());
-            m_style->setMarginBottomCollapse(m_parentStyle->marginBottomCollapse());
+            m_style->setMarginBeforeCollapse(m_parentStyle->marginBeforeCollapse());
+            m_style->setMarginAfterCollapse(m_parentStyle->marginAfterCollapse());
         }
         else if (isInitial) {
-            m_style->setMarginTopCollapse(MCOLLAPSE);
-            m_style->setMarginBottomCollapse(MCOLLAPSE);
+            m_style->setMarginBeforeCollapse(MCOLLAPSE);
+            m_style->setMarginAfterCollapse(MCOLLAPSE);
         }
         return;
     }
 
+    case CSSPropertyWebkitMarginBeforeCollapse:
     case CSSPropertyWebkitMarginTopCollapse:
-        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginTopCollapse, MarginTopCollapse)
+        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginBeforeCollapse, MarginBeforeCollapse)
         return;
+    case CSSPropertyWebkitMarginAfterCollapse:
     case CSSPropertyWebkitMarginBottomCollapse:
-        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginBottomCollapse, MarginBottomCollapse)
+        HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginAfterCollapse, MarginAfterCollapse)
         return;
     case CSSPropertyWebkitLineClamp: {
         HANDLE_INHERIT_AND_INITIAL(lineClamp, LineClamp)
index 7862e7b3c3ef51540faa29b120fe78e44b9643d5..d2731d726f09496e0157c6d71b69710153bcae8b 100644 (file)
@@ -92,17 +92,17 @@ RenderBlock::MarginInfo::MarginInfo(RenderBlock* block, int beforeBorderPadding,
         && !block->isFloating() && !block->isTableCell() && !block->hasOverflowClip() && !block->isInlineBlockOrInlineTable()
         && !block->isBlockFlowRoot();
 
-    m_canCollapseMarginBeforeWithChildren = m_canCollapseWithChildren && (beforeBorderPadding == 0) && block->style()->marginTopCollapse() != MSEPARATE;
+    m_canCollapseMarginBeforeWithChildren = m_canCollapseWithChildren && (beforeBorderPadding == 0) && block->style()->marginBeforeCollapse() != MSEPARATE;
 
     // If any height other than auto is specified in CSS, then we don't collapse our bottom
     // margins with our children's margins.  To do otherwise would be to risk odd visual
     // effects when the children overflow out of the parent block and yet still collapse
     // with it.  We also don't collapse if we have any bottom border/padding.
     m_canCollapseMarginAfterWithChildren = m_canCollapseWithChildren && (afterBorderPadding == 0) &&
-        (block->style()->logicalHeight().isAuto() && block->style()->logicalHeight().value() == 0) && block->style()->marginBottomCollapse() != MSEPARATE;
+        (block->style()->logicalHeight().isAuto() && block->style()->logicalHeight().value() == 0) && block->style()->marginAfterCollapse() != MSEPARATE;
     
-    m_quirkContainer = block->isTableCell() || block->isBody() || block->style()->marginTopCollapse() == MDISCARD || 
-        block->style()->marginBottomCollapse() == MDISCARD;
+    m_quirkContainer = block->isTableCell() || block->isBody() || block->style()->marginBeforeCollapse() == MDISCARD || 
+        block->style()->marginAfterCollapse() == MDISCARD;
 
     m_posMargin = m_canCollapseMarginBeforeWithChildren ? block->maxTopMargin(true) : 0;
     m_negMargin = m_canCollapseMarginAfterWithChildren ? block->maxTopMargin(false) : 0;
@@ -1022,7 +1022,7 @@ bool RenderBlock::isSelfCollapsingBlock() const
     if (height() > 0
         || isTable() || borderAndPaddingHeight()
         || style()->minHeight().isPositive()
-        || style()->marginTopCollapse() == MSEPARATE || style()->marginBottomCollapse() == MSEPARATE)
+        || style()->marginBeforeCollapse() == MSEPARATE || style()->marginAfterCollapse() == MSEPARATE)
         return false;
 
     bool hasAutoHeight = style()->height().isAuto();
@@ -1479,7 +1479,7 @@ int RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo)
     
     // See if the top margin is quirky. We only care if this child has
     // margins that will collapse with us.
-    bool topQuirk = child->isTopMarginQuirk() || style()->marginTopCollapse() == MDISCARD;
+    bool topQuirk = child->isTopMarginQuirk() || style()->marginBeforeCollapse() == MDISCARD;
 
     if (marginInfo.canCollapseWithMarginBefore()) {
         // This child is collapsing with the top of the
@@ -1532,7 +1532,7 @@ int RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo)
             ypos = height() + collapsedTopPos - collapsedTopNeg;
     }
     else {
-        if (child->style()->marginTopCollapse() == MSEPARATE) {
+        if (child->style()->marginBeforeCollapse() == MSEPARATE) {
             setLogicalHeight(height() + marginInfo.margin() + child->marginTop());
             ypos = height();
         }
@@ -1549,7 +1549,7 @@ int RenderBlock::collapseMargins(RenderBox* child, MarginInfo& marginInfo)
         marginInfo.setNegMargin(child->maxBottomMargin(false));
 
         if (marginInfo.margin())
-            marginInfo.setMarginAfterQuirk(child->isBottomMarginQuirk() || style()->marginBottomCollapse() == MDISCARD);
+            marginInfo.setMarginAfterQuirk(child->isBottomMarginQuirk() || style()->marginAfterCollapse() == MDISCARD);
     }
     
     // If margins would pull us past the top of the next page, then we need to pull back and pretend like the margins
@@ -1810,7 +1810,7 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
     child->computeBlockDirectionMargins(this);
 
     // Do not allow a collapse if the margin top collapse style is set to SEPARATE.
-    if (child->style()->marginTopCollapse() == MSEPARATE) {
+    if (child->style()->marginBeforeCollapse() == MSEPARATE) {
         marginInfo.setAtBeforeSideOfBlock(false);
         marginInfo.clearMargin();
     }
@@ -1934,7 +1934,7 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
 
     // Update our height now that the child has been placed in the correct position.
     setLogicalHeight(height() + child->height());
-    if (child->style()->marginBottomCollapse() == MSEPARATE) {
+    if (child->style()->marginAfterCollapse() == MSEPARATE) {
         setLogicalHeight(height() + child->marginBottom());
         marginInfo.clearMargin();
     }
index d1ad4bb61bea8d86f8ce4da0ae2e5912a5ed05e0..623a2983cb9852ed463a1087135a945e72dee9a9 100644 (file)
@@ -323,8 +323,8 @@ StyleDifference RenderStyle::diff(const RenderStyle* other, unsigned& changedCon
 
     if (rareNonInheritedData.get() != other->rareNonInheritedData.get()) {
         if (rareNonInheritedData->m_appearance != other->rareNonInheritedData->m_appearance ||
-            rareNonInheritedData->marginTopCollapse != other->rareNonInheritedData->marginTopCollapse ||
-            rareNonInheritedData->marginBottomCollapse != other->rareNonInheritedData->marginBottomCollapse ||
+            rareNonInheritedData->marginBeforeCollapse != other->rareNonInheritedData->marginBeforeCollapse ||
+            rareNonInheritedData->marginAfterCollapse != other->rareNonInheritedData->marginAfterCollapse ||
             rareNonInheritedData->lineClamp != other->rareNonInheritedData->lineClamp ||
             rareNonInheritedData->textOverflow != other->rareNonInheritedData->textOverflow)
             return StyleDifferenceLayout;
index b9dc44697cae34716d8b92bc38d4d7bf48072602..480fdb6f5fff54657bc3bc548f9e1e27d460318e 100644 (file)
@@ -665,8 +665,8 @@ public:
     EUserDrag userDrag() const { return static_cast<EUserDrag>(rareNonInheritedData->userDrag); }
     EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInheritedData->userSelect); }
     bool textOverflow() const { return rareNonInheritedData->textOverflow; }
-    EMarginCollapse marginTopCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginTopCollapse); }
-    EMarginCollapse marginBottomCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBottomCollapse); }
+    EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBeforeCollapse); }
+    EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginAfterCollapse); }
     EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedData->wordBreak); }
     EWordWrap wordWrap() const { return static_cast<EWordWrap>(rareInheritedData->wordWrap); }
     ENBSPMode nbspMode() const { return static_cast<ENBSPMode>(rareInheritedData->nbspMode); }
@@ -1005,8 +1005,8 @@ public:
     void setUserDrag(EUserDrag d) { SET_VAR(rareNonInheritedData, userDrag, d); }
     void setUserSelect(EUserSelect s) { SET_VAR(rareInheritedData, userSelect, s); }
     void setTextOverflow(bool b) { SET_VAR(rareNonInheritedData, textOverflow, b); }
-    void setMarginTopCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginTopCollapse, c); }
-    void setMarginBottomCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBottomCollapse, c); }
+    void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBeforeCollapse, c); }
+    void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginAfterCollapse, c); }
     void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); }
     void setWordWrap(EWordWrap b) { SET_VAR(rareInheritedData, wordWrap, b); }
     void setNBSPMode(ENBSPMode b) { SET_VAR(rareInheritedData, nbspMode, b); }
@@ -1218,8 +1218,8 @@ public:
     static EUserDrag initialUserDrag() { return DRAG_AUTO; }
     static EUserSelect initialUserSelect() { return SELECT_TEXT; }
     static bool initialTextOverflow() { return false; }
-    static EMarginCollapse initialMarginTopCollapse() { return MCOLLAPSE; }
-    static EMarginCollapse initialMarginBottomCollapse() { return MCOLLAPSE; }
+    static EMarginCollapse initialMarginBeforeCollapse() { return MCOLLAPSE; }
+    static EMarginCollapse initialMarginAfterCollapse() { return MCOLLAPSE; }
     static EWordBreak initialWordBreak() { return NormalWordBreak; }
     static EWordWrap initialWordWrap() { return NormalWordWrap; }
     static ENBSPMode initialNBSPMode() { return NBNORMAL; }
index e293984a4b44ecbd29d2647a096373c62788d761..e0f7f7ad8b64038ab1b6fab755e16780af026f1f 100644 (file)
@@ -37,8 +37,8 @@ StyleRareNonInheritedData::StyleRareNonInheritedData()
     , m_counterDirectives(0)
     , userDrag(RenderStyle::initialUserDrag())
     , textOverflow(RenderStyle::initialTextOverflow())
-    , marginTopCollapse(MCOLLAPSE)
-    , marginBottomCollapse(MCOLLAPSE)
+    , marginBeforeCollapse(MCOLLAPSE)
+    , marginAfterCollapse(MCOLLAPSE)
     , matchNearestMailBlockquoteColor(RenderStyle::initialMatchNearestMailBlockquoteColor())
     , m_appearance(RenderStyle::initialAppearance())
     , m_borderFit(RenderStyle::initialBorderFit())
@@ -73,8 +73,8 @@ StyleRareNonInheritedData::StyleRareNonInheritedData(const StyleRareNonInherited
     , m_counterDirectives(0)
     , userDrag(o.userDrag)
     , textOverflow(o.textOverflow)
-    , marginTopCollapse(o.marginTopCollapse)
-    , marginBottomCollapse(o.marginBottomCollapse)
+    , marginBeforeCollapse(o.marginBeforeCollapse)
+    , marginAfterCollapse(o.marginAfterCollapse)
     , matchNearestMailBlockquoteColor(o.matchNearestMailBlockquoteColor)
     , m_appearance(o.m_appearance)
     , m_borderFit(o.m_borderFit)
@@ -118,8 +118,8 @@ bool StyleRareNonInheritedData::operator==(const StyleRareNonInheritedData& o) c
         && m_counterDirectives == o.m_counterDirectives
         && userDrag == o.userDrag
         && textOverflow == o.textOverflow
-        && marginTopCollapse == o.marginTopCollapse
-        && marginBottomCollapse == o.marginBottomCollapse
+        && marginBeforeCollapse == o.marginBeforeCollapse
+        && marginAfterCollapse == o.marginAfterCollapse
         && matchNearestMailBlockquoteColor == o.matchNearestMailBlockquoteColor
         && m_appearance == o.m_appearance
         && m_borderFit == o.m_borderFit
index 6003ea4f6ddec1dac3b17d2d87f7870bbcc695de..3f693f91fa4412210d9a6d3e022ca2c7f286dab8 100644 (file)
@@ -98,8 +98,8 @@ public:
 
     unsigned userDrag : 2; // EUserDrag
     bool textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
-    unsigned marginTopCollapse : 2; // EMarginCollapse
-    unsigned marginBottomCollapse : 2; // EMarginCollapse
+    unsigned marginBeforeCollapse : 2; // EMarginCollapse
+    unsigned marginAfterCollapse : 2; // EMarginCollapse
     unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added.
     unsigned m_appearance : 6; // EAppearance
     unsigned m_borderFit : 1; // EBorderFit