Changeset 68561 in webkit
- Timestamp:
- Sep 28, 2010, 2:16:50 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r68558 r68561 1 2010-09-28 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Right now we have two properties named margin-top-collapse and margin-after-collapse. They are proprietary and only used by Safari RSS. 6 7 I am adding margin-before-collapse and margin-after-collapse and just aliasing the old properties to the new ones. 8 This way we have some names that are directionally independent. 9 10 Note that these properties aren't like other directional properties. They are about what to do with the before side and after side of 11 your block's margins when collapsing with adjacent blocks. The meaning of before/after depend on the block-flow directionality 12 of the containing block. 13 14 Computed style tests all changed and the remove-shorthand.html test covers manipulation of the shorthand. 15 16 * fast/css/remove-shorthand-expected.txt: 17 * platform/mac/fast/css/getComputedStyle/computed-style-expected.txt: 18 * platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: 19 * svg/css/getComputedStyle-basic-expected.txt: 20 1 21 2010-09-28 Martin Robinson <mrobinson@igalia.com> 2 22 -
trunk/LayoutTests/fast/css/remove-shorthand-expected.txt
r47906 r68561 20 20 Removing list-style removes list-style-type, list-style-position, list-style-image. 21 21 Removing margin removes margin-top, margin-right, margin-bottom, margin-left. 22 Removing -webkit-margin-collapse removes -webkit-margin- top-collapse, -webkit-margin-bottom-collapse.22 Removing -webkit-margin-collapse removes -webkit-margin-before-collapse, -webkit-margin-after-collapse. 23 23 Removing -webkit-marquee removes -webkit-marquee-direction, -webkit-marquee-increment, -webkit-marquee-repetition, -webkit-marquee-style, -webkit-marquee-speed. 24 24 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. -
trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-expected.txt
r67667 r68561 140 140 -webkit-line-break: normal; 141 141 -webkit-line-clamp: none; 142 -webkit-margin-b ottom-collapse: collapse;143 -webkit-margin- top-collapse: collapse;142 -webkit-margin-before-collapse: collapse; 143 -webkit-margin-after-collapse: collapse; 144 144 -webkit-marquee-direction: auto; 145 145 -webkit-marquee-increment: 6px; -
trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
r67667 r68561 139 139 -webkit-line-break: normal 140 140 -webkit-line-clamp: none 141 -webkit-margin-b ottom-collapse: collapse142 -webkit-margin- top-collapse: collapse141 -webkit-margin-before-collapse: collapse 142 -webkit-margin-after-collapse: collapse 143 143 -webkit-marquee-direction: auto 144 144 -webkit-marquee-increment: 6px -
trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt
r67667 r68561 277 277 rect: style.getPropertyValue(-webkit-line-clamp) : none 278 278 rect: style.getPropertyCSSValue(-webkit-line-clamp) : [object CSSPrimitiveValue] 279 rect: style.getPropertyValue(-webkit-margin-b ottom-collapse) : collapse280 rect: style.getPropertyCSSValue(-webkit-margin-b ottom-collapse) : [object CSSPrimitiveValue]281 rect: style.getPropertyValue(-webkit-margin- top-collapse) : collapse282 rect: style.getPropertyCSSValue(-webkit-margin- top-collapse) : [object CSSPrimitiveValue]279 rect: style.getPropertyValue(-webkit-margin-before-collapse) : collapse 280 rect: style.getPropertyCSSValue(-webkit-margin-before-collapse) : [object CSSPrimitiveValue] 281 rect: style.getPropertyValue(-webkit-margin-after-collapse) : collapse 282 rect: style.getPropertyCSSValue(-webkit-margin-after-collapse) : [object CSSPrimitiveValue] 283 283 rect: style.getPropertyValue(-webkit-marquee-direction) : auto 284 284 rect: style.getPropertyCSSValue(-webkit-marquee-direction) : [object CSSPrimitiveValue] … … 699 699 g: style.getPropertyValue(-webkit-line-clamp) : none 700 700 g: style.getPropertyCSSValue(-webkit-line-clamp) : [object CSSPrimitiveValue] 701 g: style.getPropertyValue(-webkit-margin-b ottom-collapse) : collapse702 g: style.getPropertyCSSValue(-webkit-margin-b ottom-collapse) : [object CSSPrimitiveValue]703 g: style.getPropertyValue(-webkit-margin- top-collapse) : collapse704 g: style.getPropertyCSSValue(-webkit-margin- top-collapse) : [object CSSPrimitiveValue]701 g: style.getPropertyValue(-webkit-margin-before-collapse) : collapse 702 g: style.getPropertyCSSValue(-webkit-margin-before-collapse) : [object CSSPrimitiveValue] 703 g: style.getPropertyValue(-webkit-margin-after-collapse) : collapse 704 g: style.getPropertyCSSValue(-webkit-margin-after-collapse) : [object CSSPrimitiveValue] 705 705 g: style.getPropertyValue(-webkit-marquee-direction) : auto 706 706 g: style.getPropertyCSSValue(-webkit-marquee-direction) : [object CSSPrimitiveValue] -
trunk/WebCore/ChangeLog
r68558 r68561 1 2010-09-28 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 Right now we have two properties named margin-top-collapse and margin-after-collapse. They are proprietary and only used by Safari RSS. 6 7 I am adding margin-before-collapse and margin-after-collapse and just aliasing the old properties to the new ones. 8 This way we have some names that are directionally independent. 9 10 Note that these properties aren't like other directional properties. They are about what to do with the before side and after side of 11 your block's margins when collapsing with adjacent blocks. The meaning of before/after depend on the block-flow directionality 12 of the containing block. 13 14 Computed style tests all changed and the remove-shorthand.html test covers manipulation of the shorthand. 15 16 * css/CSSComputedStyleDeclaration.cpp: 17 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 18 * css/CSSParser.cpp: 19 (WebCore::CSSParser::parseValue): 20 * css/CSSPropertyLonghand.cpp: 21 (WebCore::initShorthandMap): 22 * css/CSSPropertyNames.in: 23 * css/CSSStyleSelector.cpp: 24 (WebCore::CSSStyleSelector::applyProperty): 25 * rendering/RenderBlock.cpp: 26 (WebCore::RenderBlock::MarginInfo::MarginInfo): 27 (WebCore::RenderBlock::isSelfCollapsingBlock): 28 (WebCore::RenderBlock::collapseMargins): 29 (WebCore::RenderBlock::layoutBlockChild): 30 * rendering/style/RenderStyle.cpp: 31 (WebCore::RenderStyle::diff): 32 * rendering/style/RenderStyle.h: 33 (WebCore::InheritedFlags::marginBeforeCollapse): 34 (WebCore::InheritedFlags::marginAfterCollapse): 35 (WebCore::InheritedFlags::setMarginBeforeCollapse): 36 (WebCore::InheritedFlags::setMarginAfterCollapse): 37 (WebCore::InheritedFlags::initialMarginBeforeCollapse): 38 (WebCore::InheritedFlags::initialMarginAfterCollapse): 39 * rendering/style/StyleRareNonInheritedData.cpp: 40 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): 41 (WebCore::StyleRareNonInheritedData::operator==): 42 * rendering/style/StyleRareNonInheritedData.h: 43 1 44 2010-09-28 Martin Robinson <mrobinson@igalia.com> 2 45 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r67882 r68561 193 193 CSSPropertyWebkitLineBreak, 194 194 CSSPropertyWebkitLineClamp, 195 CSSPropertyWebkitMarginB ottomCollapse,196 CSSPropertyWebkitMargin TopCollapse,195 CSSPropertyWebkitMarginBeforeCollapse, 196 CSSPropertyWebkitMarginAfterCollapse, 197 197 CSSPropertyWebkitMarqueeDirection, 198 198 CSSPropertyWebkitMarqueeIncrement, … … 1363 1363 // Not a real style property -- used by the editing engine -- so has no computed value. 1364 1364 break; 1365 case CSSPropertyWebkitMargin BottomCollapse:1366 return CSSPrimitiveValue::create(style->margin BottomCollapse());1367 case CSSPropertyWebkitMargin TopCollapse:1368 return CSSPrimitiveValue::create(style->margin TopCollapse());1365 case CSSPropertyWebkitMarginAfterCollapse: 1366 return CSSPrimitiveValue::create(style->marginAfterCollapse()); 1367 case CSSPropertyWebkitMarginBeforeCollapse: 1368 return CSSPrimitiveValue::create(style->marginBeforeCollapse()); 1369 1369 case CSSPropertyWebkitPerspective: 1370 1370 if (!style->hasPerspective()) -
trunk/WebCore/css/CSSParser.cpp
r68521 r68561 1432 1432 } 1433 1433 case CSSPropertyWebkitMarginCollapse: { 1434 const int properties[2] = { CSSPropertyWebkitMargin TopCollapse,1435 CSSPropertyWebkitMargin BottomCollapse };1434 const int properties[2] = { CSSPropertyWebkitMarginBeforeCollapse, 1435 CSSPropertyWebkitMarginAfterCollapse }; 1436 1436 if (num == 1) { 1437 1437 ShorthandScope scope(this, CSSPropertyWebkitMarginCollapse); … … 1450 1450 return false; 1451 1451 } 1452 case CSSPropertyWebkitMarginBeforeCollapse: 1453 case CSSPropertyWebkitMarginAfterCollapse: 1452 1454 case CSSPropertyWebkitMarginTopCollapse: 1453 1455 case CSSPropertyWebkitMarginBottomCollapse: -
trunk/WebCore/css/CSSPropertyLonghand.cpp
r59111 r68561 99 99 SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyMargin, marginProperties); 100 100 101 static const int marginCollapseProperties[] = { CSSPropertyWebkitMargin TopCollapse, CSSPropertyWebkitMarginBottomCollapse };101 static const int marginCollapseProperties[] = { CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginAfterCollapse }; 102 102 SET_SHORTHAND_MAP_ENTRY(shorthandMap, CSSPropertyWebkitMarginCollapse, marginCollapseProperties); 103 103 -
trunk/WebCore/css/CSSPropertyNames.in
r67882 r68561 233 233 -webkit-logical-width 234 234 -webkit-logical-height 235 -webkit-margin-after-collapse 236 -webkit-margin-before-collapse 235 237 -webkit-margin-bottom-collapse 238 -webkit-margin-top-collapse 236 239 -webkit-margin-collapse 237 240 -webkit-margin-after … … 239 242 -webkit-margin-end 240 243 -webkit-margin-start 241 -webkit-margin-top-collapse242 244 -webkit-marquee 243 245 -webkit-marquee-direction -
trunk/WebCore/css/CSSStyleSelector.cpp
r68227 r68561 5159 5159 case CSSPropertyWebkitMarginCollapse: { 5160 5160 if (isInherit) { 5161 m_style->setMargin TopCollapse(m_parentStyle->marginTopCollapse());5162 m_style->setMargin BottomCollapse(m_parentStyle->marginBottomCollapse());5161 m_style->setMarginBeforeCollapse(m_parentStyle->marginBeforeCollapse()); 5162 m_style->setMarginAfterCollapse(m_parentStyle->marginAfterCollapse()); 5163 5163 } 5164 5164 else if (isInitial) { 5165 m_style->setMarginTopCollapse(MCOLLAPSE); 5166 m_style->setMarginBottomCollapse(MCOLLAPSE); 5167 } 5168 return; 5169 } 5170 5165 m_style->setMarginBeforeCollapse(MCOLLAPSE); 5166 m_style->setMarginAfterCollapse(MCOLLAPSE); 5167 } 5168 return; 5169 } 5170 5171 case CSSPropertyWebkitMarginBeforeCollapse: 5171 5172 case CSSPropertyWebkitMarginTopCollapse: 5172 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginTopCollapse, MarginTopCollapse) 5173 return; 5173 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginBeforeCollapse, MarginBeforeCollapse) 5174 return; 5175 case CSSPropertyWebkitMarginAfterCollapse: 5174 5176 case CSSPropertyWebkitMarginBottomCollapse: 5175 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(margin BottomCollapse, MarginBottomCollapse)5177 HANDLE_INHERIT_AND_INITIAL_AND_PRIMITIVE(marginAfterCollapse, MarginAfterCollapse) 5176 5178 return; 5177 5179 case CSSPropertyWebkitLineClamp: { -
trunk/WebCore/rendering/RenderBlock.cpp
r68556 r68561 93 93 && !block->isBlockFlowRoot(); 94 94 95 m_canCollapseMarginBeforeWithChildren = m_canCollapseWithChildren && (beforeBorderPadding == 0) && block->style()->margin TopCollapse() != MSEPARATE;95 m_canCollapseMarginBeforeWithChildren = m_canCollapseWithChildren && (beforeBorderPadding == 0) && block->style()->marginBeforeCollapse() != MSEPARATE; 96 96 97 97 // If any height other than auto is specified in CSS, then we don't collapse our bottom … … 100 100 // with it. We also don't collapse if we have any bottom border/padding. 101 101 m_canCollapseMarginAfterWithChildren = m_canCollapseWithChildren && (afterBorderPadding == 0) && 102 (block->style()->logicalHeight().isAuto() && block->style()->logicalHeight().value() == 0) && block->style()->margin BottomCollapse() != MSEPARATE;103 104 m_quirkContainer = block->isTableCell() || block->isBody() || block->style()->margin TopCollapse() == MDISCARD ||105 block->style()->margin BottomCollapse() == MDISCARD;102 (block->style()->logicalHeight().isAuto() && block->style()->logicalHeight().value() == 0) && block->style()->marginAfterCollapse() != MSEPARATE; 103 104 m_quirkContainer = block->isTableCell() || block->isBody() || block->style()->marginBeforeCollapse() == MDISCARD || 105 block->style()->marginAfterCollapse() == MDISCARD; 106 106 107 107 m_posMargin = m_canCollapseMarginBeforeWithChildren ? block->maxTopMargin(true) : 0; … … 1023 1023 || isTable() || borderAndPaddingHeight() 1024 1024 || style()->minHeight().isPositive() 1025 || style()->margin TopCollapse() == MSEPARATE || style()->marginBottomCollapse() == MSEPARATE)1025 || style()->marginBeforeCollapse() == MSEPARATE || style()->marginAfterCollapse() == MSEPARATE) 1026 1026 return false; 1027 1027 … … 1480 1480 // See if the top margin is quirky. We only care if this child has 1481 1481 // margins that will collapse with us. 1482 bool topQuirk = child->isTopMarginQuirk() || style()->margin TopCollapse() == MDISCARD;1482 bool topQuirk = child->isTopMarginQuirk() || style()->marginBeforeCollapse() == MDISCARD; 1483 1483 1484 1484 if (marginInfo.canCollapseWithMarginBefore()) { … … 1533 1533 } 1534 1534 else { 1535 if (child->style()->margin TopCollapse() == MSEPARATE) {1535 if (child->style()->marginBeforeCollapse() == MSEPARATE) { 1536 1536 setLogicalHeight(height() + marginInfo.margin() + child->marginTop()); 1537 1537 ypos = height(); … … 1550 1550 1551 1551 if (marginInfo.margin()) 1552 marginInfo.setMarginAfterQuirk(child->isBottomMarginQuirk() || style()->margin BottomCollapse() == MDISCARD);1552 marginInfo.setMarginAfterQuirk(child->isBottomMarginQuirk() || style()->marginAfterCollapse() == MDISCARD); 1553 1553 } 1554 1554 … … 1811 1811 1812 1812 // Do not allow a collapse if the margin top collapse style is set to SEPARATE. 1813 if (child->style()->margin TopCollapse() == MSEPARATE) {1813 if (child->style()->marginBeforeCollapse() == MSEPARATE) { 1814 1814 marginInfo.setAtBeforeSideOfBlock(false); 1815 1815 marginInfo.clearMargin(); … … 1935 1935 // Update our height now that the child has been placed in the correct position. 1936 1936 setLogicalHeight(height() + child->height()); 1937 if (child->style()->margin BottomCollapse() == MSEPARATE) {1937 if (child->style()->marginAfterCollapse() == MSEPARATE) { 1938 1938 setLogicalHeight(height() + child->marginBottom()); 1939 1939 marginInfo.clearMargin(); -
trunk/WebCore/rendering/style/RenderStyle.cpp
r68551 r68561 324 324 if (rareNonInheritedData.get() != other->rareNonInheritedData.get()) { 325 325 if (rareNonInheritedData->m_appearance != other->rareNonInheritedData->m_appearance || 326 rareNonInheritedData->margin TopCollapse != other->rareNonInheritedData->marginTopCollapse ||327 rareNonInheritedData->margin BottomCollapse != other->rareNonInheritedData->marginBottomCollapse ||326 rareNonInheritedData->marginBeforeCollapse != other->rareNonInheritedData->marginBeforeCollapse || 327 rareNonInheritedData->marginAfterCollapse != other->rareNonInheritedData->marginAfterCollapse || 328 328 rareNonInheritedData->lineClamp != other->rareNonInheritedData->lineClamp || 329 329 rareNonInheritedData->textOverflow != other->rareNonInheritedData->textOverflow) -
trunk/WebCore/rendering/style/RenderStyle.h
r68427 r68561 666 666 EUserSelect userSelect() const { return static_cast<EUserSelect>(rareInheritedData->userSelect); } 667 667 bool textOverflow() const { return rareNonInheritedData->textOverflow; } 668 EMarginCollapse margin TopCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginTopCollapse); }669 EMarginCollapse margin BottomCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBottomCollapse); }668 EMarginCollapse marginBeforeCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginBeforeCollapse); } 669 EMarginCollapse marginAfterCollapse() const { return static_cast<EMarginCollapse>(rareNonInheritedData->marginAfterCollapse); } 670 670 EWordBreak wordBreak() const { return static_cast<EWordBreak>(rareInheritedData->wordBreak); } 671 671 EWordWrap wordWrap() const { return static_cast<EWordWrap>(rareInheritedData->wordWrap); } … … 1006 1006 void setUserSelect(EUserSelect s) { SET_VAR(rareInheritedData, userSelect, s); } 1007 1007 void setTextOverflow(bool b) { SET_VAR(rareNonInheritedData, textOverflow, b); } 1008 void setMargin TopCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginTopCollapse, c); }1009 void setMargin BottomCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBottomCollapse, c); }1008 void setMarginBeforeCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginBeforeCollapse, c); } 1009 void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginAfterCollapse, c); } 1010 1010 void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); } 1011 1011 void setWordWrap(EWordWrap b) { SET_VAR(rareInheritedData, wordWrap, b); } … … 1219 1219 static EUserSelect initialUserSelect() { return SELECT_TEXT; } 1220 1220 static bool initialTextOverflow() { return false; } 1221 static EMarginCollapse initialMargin TopCollapse() { return MCOLLAPSE; }1222 static EMarginCollapse initialMargin BottomCollapse() { return MCOLLAPSE; }1221 static EMarginCollapse initialMarginBeforeCollapse() { return MCOLLAPSE; } 1222 static EMarginCollapse initialMarginAfterCollapse() { return MCOLLAPSE; } 1223 1223 static EWordBreak initialWordBreak() { return NormalWordBreak; } 1224 1224 static EWordWrap initialWordWrap() { return NormalWordWrap; } -
trunk/WebCore/rendering/style/StyleRareNonInheritedData.cpp
r66037 r68561 38 38 , userDrag(RenderStyle::initialUserDrag()) 39 39 , textOverflow(RenderStyle::initialTextOverflow()) 40 , margin TopCollapse(MCOLLAPSE)41 , margin BottomCollapse(MCOLLAPSE)40 , marginBeforeCollapse(MCOLLAPSE) 41 , marginAfterCollapse(MCOLLAPSE) 42 42 , matchNearestMailBlockquoteColor(RenderStyle::initialMatchNearestMailBlockquoteColor()) 43 43 , m_appearance(RenderStyle::initialAppearance()) … … 74 74 , userDrag(o.userDrag) 75 75 , textOverflow(o.textOverflow) 76 , margin TopCollapse(o.marginTopCollapse)77 , margin BottomCollapse(o.marginBottomCollapse)76 , marginBeforeCollapse(o.marginBeforeCollapse) 77 , marginAfterCollapse(o.marginAfterCollapse) 78 78 , matchNearestMailBlockquoteColor(o.matchNearestMailBlockquoteColor) 79 79 , m_appearance(o.m_appearance) … … 119 119 && userDrag == o.userDrag 120 120 && textOverflow == o.textOverflow 121 && margin TopCollapse == o.marginTopCollapse122 && margin BottomCollapse == o.marginBottomCollapse121 && marginBeforeCollapse == o.marginBeforeCollapse 122 && marginAfterCollapse == o.marginAfterCollapse 123 123 && matchNearestMailBlockquoteColor == o.matchNearestMailBlockquoteColor 124 124 && m_appearance == o.m_appearance -
trunk/WebCore/rendering/style/StyleRareNonInheritedData.h
r66037 r68561 99 99 unsigned userDrag : 2; // EUserDrag 100 100 bool textOverflow : 1; // Whether or not lines that spill out should be truncated with "..." 101 unsigned margin TopCollapse : 2; // EMarginCollapse102 unsigned margin BottomCollapse : 2; // EMarginCollapse101 unsigned marginBeforeCollapse : 2; // EMarginCollapse 102 unsigned marginAfterCollapse : 2; // EMarginCollapse 103 103 unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added. 104 104 unsigned m_appearance : 6; // EAppearance
Note:
See TracChangeset
for help on using the changeset viewer.