Changeset 94912 in webkit
- Timestamp:
- Sep 10, 2011 2:08:05 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 25 added
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r94907 r94912 1 2011-09-09 David Hyatt <hyatt@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=67861 4 5 Implement border-image-outset (and the mask equivalents). 6 7 Reviewed by Beth Dakin. 8 9 * fast/borders/block-mask-overlay-image-outset.html: Added. 10 * fast/borders/block-mask-overlay-image.html~: Added. 11 * fast/borders/border-image-outset-in-shorthand.html: Added. 12 * fast/borders/border-image-outset-split-inline-vertical-lr.html: Added. 13 * fast/borders/border-image-outset-split-inline.html: Added. 14 * fast/borders/border-image-outset.html: Added. 15 * fast/borders/inline-mask-overlay-image-outset-vertical-rl.html: Added. 16 * fast/borders/inline-mask-overlay-image-outset.html: Added. 17 * fast/css/getComputedStyle/computed-style-expected.txt: 18 * fast/css/getComputedStyle/computed-style-with-zoom-expected.txt: 19 * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: 20 * fast/css/getComputedStyle/getComputedStyle-border-image-expected.txt: 21 * fast/reflections/reflection-computed-style-expected.txt: 22 * fast/reflections/reflection-masks-outset.html: Added. 23 * platform/mac/fast/borders/block-mask-overlay-image-outset-expected.png: Added. 24 * platform/mac/fast/borders/block-mask-overlay-image-outset-expected.txt: Added. 25 * platform/mac/fast/borders/border-image-outset-expected.png: Added. 26 * platform/mac/fast/borders/border-image-outset-expected.txt: Added. 27 * platform/mac/fast/borders/border-image-outset-in-shorthand-expected.png: Added. 28 * platform/mac/fast/borders/border-image-outset-in-shorthand-expected.txt: Added. 29 * platform/mac/fast/borders/border-image-outset-split-inline-expected.png: Added. 30 * platform/mac/fast/borders/border-image-outset-split-inline-expected.txt: Added. 31 * platform/mac/fast/borders/border-image-outset-split-inline-vertical-lr-expected.png: Added. 32 * platform/mac/fast/borders/border-image-outset-split-inline-vertical-lr-expected.txt: Added. 33 * platform/mac/fast/borders/inline-mask-overlay-image-outset-expected.png: Added. 34 * platform/mac/fast/borders/inline-mask-overlay-image-outset-expected.txt: Added. 35 * platform/mac/fast/borders/inline-mask-overlay-image-outset-vertical-rl-expected.png: Added. 36 * platform/mac/fast/borders/inline-mask-overlay-image-outset-vertical-rl-expected.txt: Added. 37 * platform/mac/fast/reflections/reflection-masks-outset-expected.png: Added. 38 * platform/mac/fast/reflections/reflection-masks-outset-expected.txt: Added. 39 * svg/css/getComputedStyle-basic-expected.txt: 40 1 41 2011-09-10 Csaba Osztrogonác <ossy@webkit.org> 2 42 -
trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
r94726 r94912 15 15 border-bottom-width: 0px; 16 16 border-collapse: separate; 17 border-image-outset: 0px; 17 18 border-image-repeat: stretch; 18 19 border-image-slice: 100%; … … 160 161 -webkit-mask-attachment: scroll; 161 162 -webkit-mask-box-image: none; 163 -webkit-mask-box-image-outset: 0px; 162 164 -webkit-mask-box-image-repeat: stretch; 163 165 -webkit-mask-box-image-slice: 0; -
trunk/LayoutTests/fast/css/getComputedStyle/computed-style-with-zoom-expected.txt
r94593 r94912 6 6 PASS -webkit-border-horizontal-spacing, value: "20px" 7 7 PASS -webkit-border-vertical-spacing, value: "20px" 8 PASS -webkit-box-reflect, value: "below 20px -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(white)) 0 fill / auto stretch"8 PASS -webkit-box-reflect, value: "below 20px -webkit-gradient(linear, 0% 0%, 0% 100%, from(transparent), to(white)) 0 fill / auto / 0px stretch" 9 9 PASS -webkit-box-shadow, value: "rgb(255, 0, 0) 20px 20px 20px 20px" 10 10 PASS -webkit-column-rule-width, value: "20px" -
trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
r94726 r94912 14 14 border-bottom-width: 0px 15 15 border-collapse: separate 16 border-image-outset: 0px 16 17 border-image-repeat: stretch 17 18 border-image-slice: 100% … … 159 160 -webkit-mask-attachment: scroll 160 161 -webkit-mask-box-image: none 162 -webkit-mask-box-image-outset: 0px 161 163 -webkit-mask-box-image-repeat: stretch 162 164 -webkit-mask-box-image-slice: 0 -
trunk/LayoutTests/fast/css/getComputedStyle/getComputedStyle-border-image-expected.txt
r94593 r94912 8 8 -webkit-border-image: -webkit-gradient(linear, 0 0, 0 0) 25 25 25 25 stretch stretch; 9 9 -webkit-border-image 10 getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 25 fill / 1 stretch10 getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 25 fill / 1 / 0px stretch 11 11 getPropertyCSSValue: [object CSSValue] 12 12 13 13 -webkit-border-image: -webkit-gradient(linear, 0 0, 0 0) 50 repeat; 14 14 -webkit-border-image 15 getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 50 fill / 1 repeat15 getPropertyValue: -webkit-gradient(linear, 0 0, 0 0) 50 fill / 1 / 0px repeat 16 16 getPropertyCSSValue: [object CSSValue] 17 17 -
trunk/LayoutTests/fast/reflections/reflection-computed-style-expected.txt
r94595 r94912 18 18 -webkit-box-reflect: below 5px -webkit-gradient(linear, 0 0, 0 0) 25 25 25 25 stretch stretch; 19 19 -webkit-box-reflect 20 getPropertyValue: below 5px -webkit-gradient(linear, 0 0, 0 0) 25 fill / auto stretch20 getPropertyValue: below 5px -webkit-gradient(linear, 0 0, 0 0) 25 fill / auto / 0px stretch 21 21 getPropertyCSSValue: [object CSSValue] 22 22 -
trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt
r94726 r94912 27 27 rect: style.getPropertyValue(border-collapse) : separate 28 28 rect: style.getPropertyCSSValue(border-collapse) : [object CSSPrimitiveValue] 29 rect: style.getPropertyValue(border-image-outset) : 0px 30 rect: style.getPropertyCSSValue(border-image-outset) : [object CSSPrimitiveValue] 29 31 rect: style.getPropertyValue(border-image-repeat) : stretch 30 32 rect: style.getPropertyCSSValue(border-image-repeat) : [object CSSPrimitiveValue] … … 317 319 rect: style.getPropertyValue(-webkit-mask-box-image) : none 318 320 rect: style.getPropertyCSSValue(-webkit-mask-box-image) : [object CSSPrimitiveValue] 321 rect: style.getPropertyValue(-webkit-mask-box-image-outset) : 0px 322 rect: style.getPropertyCSSValue(-webkit-mask-box-image-outset) : [object CSSPrimitiveValue] 319 323 rect: style.getPropertyValue(-webkit-mask-box-image-repeat) : stretch 320 324 rect: style.getPropertyCSSValue(-webkit-mask-box-image-repeat) : [object CSSPrimitiveValue] … … 503 507 g: style.getPropertyValue(border-collapse) : separate 504 508 g: style.getPropertyCSSValue(border-collapse) : [object CSSPrimitiveValue] 509 g: style.getPropertyValue(border-image-outset) : 0px 510 g: style.getPropertyCSSValue(border-image-outset) : [object CSSPrimitiveValue] 505 511 g: style.getPropertyValue(border-image-repeat) : stretch 506 512 g: style.getPropertyCSSValue(border-image-repeat) : [object CSSPrimitiveValue] … … 793 799 g: style.getPropertyValue(-webkit-mask-box-image) : none 794 800 g: style.getPropertyCSSValue(-webkit-mask-box-image) : [object CSSPrimitiveValue] 801 g: style.getPropertyValue(-webkit-mask-box-image-outset) : 0px 802 g: style.getPropertyCSSValue(-webkit-mask-box-image-outset) : [object CSSPrimitiveValue] 795 803 g: style.getPropertyValue(-webkit-mask-box-image-repeat) : stretch 796 804 g: style.getPropertyCSSValue(-webkit-mask-box-image-repeat) : [object CSSPrimitiveValue] -
trunk/Source/WebCore/ChangeLog
r94911 r94912 1 2011-09-09 David Hyatt <hyatt@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=67861 4 5 Implement border-image-outset (and the mask equivalents). 6 7 Reviewed by Beth Dakin. 8 9 Added new tests in fast/borders and fast/reflections. 10 11 * css/CSSBorderImageValue.cpp: 12 (WebCore::CSSBorderImageValue::CSSBorderImageValue): 13 (WebCore::CSSBorderImageValue::cssText): 14 * css/CSSBorderImageValue.h: 15 (WebCore::CSSBorderImageValue::create): 16 Add m_outset field to CSSBorderImageValue and teach it how to dump the field as 17 part of cssText(). 18 19 * css/CSSComputedStyleDeclaration.cpp: 20 (WebCore::valueForNinePieceImageQuad): 21 (WebCore::valueForNinePieceImage): 22 (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): 23 Add support for border-image-outset and -webkit-mask-box-image-outset. Refactor 24 the code so that border-image-width and border-image-outset use a common 25 function. 26 27 * css/CSSParser.cpp: 28 (WebCore::CSSParser::parseValue): 29 (WebCore::BorderImageParseContext::BorderImageParseContext): 30 (WebCore::BorderImageParseContext::allowOutset): 31 (WebCore::BorderImageParseContext::commitSlash): 32 (WebCore::BorderImageParseContext::commitBorderWidth): 33 (WebCore::BorderImageParseContext::commitBorderOutset): 34 (WebCore::BorderImageParseContext::commitRepeat): 35 (WebCore::BorderImageParseContext::commitBorderImage): 36 (WebCore::CSSParser::parseBorderImage): 37 Teach the border image parsing code about outsets. This code will soon be 38 replaced by true shorthand parsing code, but for now keep it working and add 39 outset support to it. 40 41 (WebCore::BorderImageQuadParseContext::BorderImageQuadParseContext): 42 (WebCore::BorderImageQuadParseContext::commitBorderImageQuad): 43 (WebCore::CSSParser::parseBorderImageQuad): 44 (WebCore::CSSParser::parseBorderImageWidth): 45 (WebCore::CSSParser::parseBorderImageOutset): 46 * css/CSSParser.h: 47 Refactor the border-image-width code so that it can be shared by border-image-outset, since 48 they are extremely similar. 49 50 * css/CSSPropertyNames.in: 51 Add the new properties. 52 53 * css/CSSStyleSelector.cpp: 54 (WebCore::CSSStyleSelector::applyProperty): 55 (WebCore::CSSStyleSelector::mapNinePieceImage): 56 (WebCore::CSSStyleSelector::mapNinePieceImageQuad): 57 (WebCore::CSSStyleSelector::loadPendingImages): 58 * css/CSSStyleSelector.h: 59 Refactor the code so that width/outset share common mapping functions. Add support for outset. 60 61 * rendering/InlineFlowBox.cpp: 62 (WebCore::InlineFlowBox::addToLine): 63 (WebCore::InlineFlowBox::addBoxShadowVisualOverflow): 64 (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow): 65 (WebCore::InlineFlowBox::computeOverflow): 66 Add new functions for computing the visual overflow caused by border outsets. Fix bugs in 67 the shadow overflow code as well. 68 69 (WebCore::clipRectForNinePieceImageStrip): 70 (WebCore::InlineFlowBox::paintBoxDecorations): 71 (WebCore::InlineFlowBox::paintMask): 72 * rendering/InlineFlowBox.h: 73 Make sure the clip rect pushed when painting one piece of a split inline strip is expanded to 74 include the border and mask outsets. Always include the block direction expansion, and conditionally 75 include the inline direction expansion based off includeLogicalLeftEdge()/includeLogicalRightEdge(). 76 clipRectForNinePieceImageStrip is a common function shared by masks and border images that does this 77 work. 78 79 * rendering/RenderBlock.cpp: 80 (WebCore::RenderBlock::computeOverflow): 81 * rendering/RenderBox.cpp: 82 (WebCore::RenderBox::maskClipRect): 83 (WebCore::RenderBox::addBoxShadowAndBorderOverflow): 84 * rendering/RenderBox.h: 85 Rename addShadowOverflow to addBoxShadowAndBorderOverflow. Have it compute both shadow and border image 86 outset overflow. Fix bugs with shadow overflow computation. 87 88 * rendering/RenderBoxModelObject.cpp: 89 (WebCore::RenderBoxModelObject::paintNinePieceImage): 90 Change painting to apply the outsets to inflate the border image drawing area. 91 92 * rendering/RenderEmbeddedObject.cpp: 93 (WebCore::RenderEmbeddedObject::layout): 94 * rendering/RenderIFrame.cpp: 95 (WebCore::RenderIFrame::layout): 96 Patched to call the renamed addBoxShadowAndBorderOverflow function instead of addShadowOverflow. 97 98 * rendering/RenderLayer.cpp: 99 (WebCore::RenderLayer::calculateRects): 100 Patched to no longer apply box-shadow to overflow clip areas when inflating the intersection area for the 101 layer bounds. Instead we generically apply all visual overflow so that border image outsets will also be 102 included. This fixes https://bugs.webkit.org/show_bug.cgi?id=37467. 103 104 * rendering/RenderReplaced.cpp: 105 (WebCore::RenderReplaced::layout): 106 Patched to call the renamed addBoxShadowAndBorderOverflow function instead of addShadowOverflow. 107 108 * rendering/style/NinePieceImage.cpp: 109 (WebCore::NinePieceImage::operator==): 110 * rendering/style/NinePieceImage.h: 111 (WebCore::NinePieceImage::NinePieceImage): 112 (WebCore::NinePieceImage::outset): 113 (WebCore::NinePieceImage::setOutset): 114 (WebCore::NinePieceImage::computeOutset): 115 (WebCore::NinePieceImage::copyOutsetFrom): 116 Add the outset field to NinePieceImage along with some helpers for manipulating outsets. 117 118 * rendering/style/RenderStyle.cpp: 119 (WebCore::RenderStyle::getImageOutsets): 120 (WebCore::RenderStyle::getImageHorizontalOutsets): 121 (WebCore::RenderStyle::getImageVerticalOutsets): 122 * rendering/style/RenderStyle.h: 123 (WebCore::InheritedFlags::hasBorderImageOutsets): 124 (WebCore::InheritedFlags::getBorderImageOutsets): 125 (WebCore::InheritedFlags::getBorderImageHorizontalOutsets): 126 (WebCore::InheritedFlags::getBorderImageVerticalOutsets): 127 (WebCore::InheritedFlags::getBorderImageInlineDirectionOutsets): 128 (WebCore::InheritedFlags::getBorderImageBlockDirectionOutsets): 129 (WebCore::InheritedFlags::getImageInlineDirectionOutsets): 130 (WebCore::InheritedFlags::getImageBlockDirectionOutsets): 131 Helpers for outset computation used by painting and overflow functions. 132 1 133 2011-09-10 Dan Bernstein <mitz@apple.com> 2 134 -
trunk/Source/WebCore/css/CSSBorderImageValue.cpp
r94593 r94912 28 28 29 29 CSSBorderImageValue::CSSBorderImageValue(PassRefPtr<CSSValue> image, PassRefPtr<CSSBorderImageSliceValue> imageSlice, 30 PassRefPtr<CSSValue> borderSlice, PassRefPtr<CSSValue> repeat)30 PassRefPtr<CSSValue> borderSlice, PassRefPtr<CSSValue> outset, PassRefPtr<CSSValue> repeat) 31 31 : m_image(image) 32 32 , m_imageSlice(imageSlice) 33 33 , m_borderSlice(borderSlice) 34 , m_outset(outset) 34 35 , m_repeat(repeat) 35 36 { … … 55 56 } 56 57 58 if (m_outset) { 59 text += " / "; 60 text += m_outset->cssText(); 61 } 62 57 63 if (m_repeat) { 58 64 // Now the keywords. -
trunk/Source/WebCore/css/CSSBorderImageValue.h
r94593 r94912 33 33 public: 34 34 static PassRefPtr<CSSBorderImageValue> create(PassRefPtr<CSSValue> image, PassRefPtr<CSSBorderImageSliceValue> imageSlice, 35 PassRefPtr<CSSValue> borderSlice, PassRefPtr<CSSValue> repeat)35 PassRefPtr<CSSValue> borderSlice, PassRefPtr<CSSValue> outset, PassRefPtr<CSSValue> repeat) 36 36 { 37 return adoptRef(new CSSBorderImageValue(image, imageSlice, borderSlice, repeat));37 return adoptRef(new CSSBorderImageValue(image, imageSlice, borderSlice, outset, repeat)); 38 38 } 39 39 virtual ~CSSBorderImageValue(); … … 56 56 RefPtr<CSSValue> m_borderSlice; 57 57 58 // The outset values are used to inflate the border image drawing area. 59 RefPtr<CSSValue> m_outset; 60 58 61 // Values for how to handle the scaling/stretching/tiling of the image slices. 59 62 RefPtr<CSSValue> m_repeat; 60 63 61 64 private: 62 CSSBorderImageValue(PassRefPtr<CSSValue> image, PassRefPtr<CSSBorderImageSliceValue>, PassRefPtr<CSSValue> borderSlice, PassRefPtr<CSSValue> repeat); 65 CSSBorderImageValue(PassRefPtr<CSSValue> image, PassRefPtr<CSSBorderImageSliceValue>, PassRefPtr<CSSValue> borderSlice, 66 PassRefPtr<CSSValue> outset, PassRefPtr<CSSValue> repeat); 63 67 virtual bool isBorderImageValue() const { return true; } 64 68 }; -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r94710 r94912 75 75 CSSPropertyBorderBottomWidth, 76 76 CSSPropertyBorderCollapse, 77 CSSPropertyBorderImageOutset, 77 78 CSSPropertyBorderImageRepeat, 78 79 CSSPropertyBorderImageSlice, … … 230 231 CSSPropertyWebkitMaskAttachment, 231 232 CSSPropertyWebkitMaskBoxImage, 233 CSSPropertyWebkitMaskBoxImageOutset, 232 234 CSSPropertyWebkitMaskBoxImageRepeat, 233 235 CSSPropertyWebkitMaskBoxImageSlice, … … 383 385 } 384 386 385 static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImage Width(const NinePieceImage& image, CSSPrimitiveValueCache* primitiveValueCache)387 static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const LengthBox& box, CSSPrimitiveValueCache* primitiveValueCache) 386 388 { 387 389 // Create the slices. … … 391 393 RefPtr<CSSPrimitiveValue> left; 392 394 393 if ( image.borderSlices().top().isRelative())394 top = primitiveValueCache->createValue( image.borderSlices().top().value(), CSSPrimitiveValue::CSS_NUMBER);395 if (box.top().isRelative()) 396 top = primitiveValueCache->createValue(box.top().value(), CSSPrimitiveValue::CSS_NUMBER); 395 397 else 396 top = primitiveValueCache->createValue(image.borderSlices().top()); 397 398 if (image.borderSlices().right() == image.borderSlices().top() && image.borderSlices().bottom() == image.borderSlices().top() 399 && image.borderSlices().left() == image.borderSlices().top()) { 398 top = primitiveValueCache->createValue(box.top()); 399 400 if (box.right() == box.top() && box.bottom() == box.top() && box.left() == box.top()) { 400 401 right = top; 401 402 bottom = top; 402 403 left = top; 403 404 } else { 404 if ( image.borderSlices().right().isRelative())405 right = primitiveValueCache->createValue( image.borderSlices().right().value(), CSSPrimitiveValue::CSS_NUMBER);405 if (box.right().isRelative()) 406 right = primitiveValueCache->createValue(box.right().value(), CSSPrimitiveValue::CSS_NUMBER); 406 407 else 407 right = primitiveValueCache->createValue( image.borderSlices().right());408 right = primitiveValueCache->createValue(box.right()); 408 409 409 if ( image.borderSlices().bottom() == image.borderSlices().top() && image.borderSlices().right() == image.borderSlices().left()) {410 if (box.bottom() == box.top() && box.right() == box.left()) { 410 411 bottom = top; 411 412 right = left; 412 413 } else { 413 if ( image.borderSlices().bottom().isRelative())414 bottom = primitiveValueCache->createValue( image.borderSlices().bottom().value(), CSSPrimitiveValue::CSS_NUMBER);414 if (box.bottom().isRelative()) 415 bottom = primitiveValueCache->createValue(box.bottom().value(), CSSPrimitiveValue::CSS_NUMBER); 415 416 else 416 bottom = primitiveValueCache->createValue( image.borderSlices().bottom());417 bottom = primitiveValueCache->createValue(box.bottom()); 417 418 418 if ( image.borderSlices().left() == image.borderSlices().right())419 if (box.left() == box.right()) 419 420 left = right; 420 421 else { 421 if ( image.borderSlices().left().isRelative())422 left = primitiveValueCache->createValue( image.borderSlices().left().value(), CSSPrimitiveValue::CSS_NUMBER);422 if (box.left().isRelative()) 423 left = primitiveValueCache->createValue(box.left().value(), CSSPrimitiveValue::CSS_NUMBER); 423 424 else 424 left = primitiveValueCache->createValue( image.borderSlices().left());425 left = primitiveValueCache->createValue(box.left()); 425 426 } 426 427 } … … 463 464 464 465 // Create the border area slices. 465 RefPtr<CSSValue> borderSlices = valueForNinePieceImageWidth(image, primitiveValueCache); 466 RefPtr<CSSValue> borderSlices = valueForNinePieceImageQuad(image.borderSlices(), primitiveValueCache); 467 468 // Create the border outset. 469 RefPtr<CSSValue> outset = valueForNinePieceImageQuad(image.outset(), primitiveValueCache); 466 470 467 471 // Create the repeat rules. 468 472 RefPtr<CSSValue> repeat = valueForNinePieceImageRepeat(image, primitiveValueCache); 469 473 470 return CSSBorderImageValue::create(imageValue.release(), imageSlices.release(), borderSlices.release(), repeat);474 return CSSBorderImageValue::create(imageValue.release(), imageSlices.release(), borderSlices.release(), outset.release(), repeat); 471 475 } 472 476 … … 1700 1704 case CSSPropertyWebkitBorderImage: 1701 1705 return valueForNinePieceImage(style->borderImage(), primitiveValueCache); 1706 case CSSPropertyBorderImageOutset: 1707 return valueForNinePieceImageQuad(style->borderImage().outset(), primitiveValueCache); 1702 1708 case CSSPropertyBorderImageRepeat: 1703 1709 return valueForNinePieceImageRepeat(style->borderImage(), primitiveValueCache); … … 1705 1711 return valueForNinePieceImageSlice(style->borderImage(), primitiveValueCache); 1706 1712 case CSSPropertyBorderImageWidth: 1707 return valueForNinePieceImage Width(style->borderImage(), primitiveValueCache);1713 return valueForNinePieceImageQuad(style->borderImage().borderSlices(), primitiveValueCache); 1708 1714 case CSSPropertyWebkitMaskBoxImage: 1709 1715 return valueForNinePieceImage(style->maskBoxImage(), primitiveValueCache); 1716 case CSSPropertyWebkitMaskBoxImageOutset: 1717 return valueForNinePieceImageQuad(style->maskBoxImage().outset(), primitiveValueCache); 1710 1718 case CSSPropertyWebkitMaskBoxImageRepeat: 1711 1719 return valueForNinePieceImageRepeat(style->maskBoxImage(), primitiveValueCache); … … 1713 1721 return valueForNinePieceImageSlice(style->maskBoxImage(), primitiveValueCache); 1714 1722 case CSSPropertyWebkitMaskBoxImageWidth: 1715 return valueForNinePieceImage Width(style->maskBoxImage(), primitiveValueCache);1723 return valueForNinePieceImageQuad(style->maskBoxImage().borderSlices(), primitiveValueCache); 1716 1724 case CSSPropertyWebkitMaskBoxImageSource: 1717 1725 if (style->maskBoxImageSource()) -
trunk/Source/WebCore/css/CSSParser.cpp
r94710 r94912 1452 1452 break; 1453 1453 } 1454 case CSSPropertyBorderImageOutset: 1455 case CSSPropertyWebkitMaskBoxImageOutset: { 1456 RefPtr<CSSPrimitiveValue> result; 1457 if (parseBorderImageOutset(result)) { 1458 addProperty(propId, result, important); 1459 return true; 1460 } 1461 break; 1462 } 1454 1463 case CSSPropertyBorderImageRepeat: 1455 1464 case CSSPropertyWebkitMaskBoxImageRepeat: { … … 1473 1482 case CSSPropertyWebkitMaskBoxImageWidth: { 1474 1483 RefPtr<CSSPrimitiveValue> result; 1475 if (parseBorderImageWidth( propId,result)) {1484 if (parseBorderImageWidth(result)) { 1476 1485 addProperty(propId, result, important); 1477 1486 return true; … … 5152 5161 , m_allowSlash(false) 5153 5162 , m_allowWidth(false) 5163 , m_allowOutset(false) 5154 5164 , m_allowRepeat(false) 5155 5165 {} … … 5158 5168 bool allowSlash() const { return m_allowSlash; } 5159 5169 bool allowWidth() const { return m_allowWidth; } 5170 bool allowOutset() const { return m_allowOutset; } 5160 5171 bool allowRepeat() const { return m_allowRepeat; } 5161 5172 … … 5166 5177 m_allowBreak = m_allowSlash = m_allowRepeat = true; 5167 5178 } 5168 void commitSlash() { m_allowBreak = m_allowSlash = m_allowRepeat = false; m_allowWidth = true; } 5179 void commitSlash() 5180 { 5181 m_allowBreak = m_allowSlash = m_allowRepeat = false; 5182 if (!m_borderSlice) 5183 m_allowWidth = true; 5184 else 5185 m_allowOutset = true; 5186 } 5169 5187 void commitBorderWidth(PassRefPtr<CSSPrimitiveValue> slice) 5170 5188 { … … 5172 5190 m_allowBreak = m_allowRepeat = true; 5173 5191 m_allowWidth = false; 5192 m_allowSlash = true; 5193 } 5194 void commitBorderOutset(PassRefPtr<CSSPrimitiveValue> outset) 5195 { 5196 m_outset = outset; 5197 m_allowBreak = m_allowRepeat = true; 5198 m_allowWidth = m_allowOutset = m_allowSlash = false; 5174 5199 } 5175 5200 void commitRepeat(PassRefPtr<CSSValue> repeat) 5176 5201 { 5177 5202 m_repeat = repeat; 5178 m_allowRepeat = m_allowSlash = m_allowWidth = false;5203 m_allowRepeat = m_allowSlash = m_allowWidth = m_allowOutset = false; 5179 5204 m_allowBreak = true; 5180 5205 } … … 5183 5208 { 5184 5209 // Make our new border image value now. 5185 return CSSBorderImageValue::create(m_image, m_imageSlice, m_borderSlice, m_ repeat);5210 return CSSBorderImageValue::create(m_image, m_imageSlice, m_borderSlice, m_outset, m_repeat); 5186 5211 } 5187 5212 … … 5191 5216 bool m_allowSlash; 5192 5217 bool m_allowWidth; 5218 bool m_allowOutset; 5193 5219 bool m_allowRepeat; 5194 5220 … … 5196 5222 RefPtr<CSSBorderImageSliceValue> m_imageSlice; 5197 5223 RefPtr<CSSPrimitiveValue> m_borderSlice; 5224 RefPtr<CSSPrimitiveValue> m_outset; 5198 5225 5199 5226 RefPtr<CSSValue> m_repeat; … … 5203 5230 { 5204 5231 // Look for an image initially. If the first value is not a URI or the keyword "none", then we're done. 5232 ShorthandScope scope(this, propId); 5205 5233 BorderImageParseContext context(primitiveValueCache()); 5206 5234 CSSParserValue* val = m_valueList->current(); … … 5232 5260 } else if (context.allowWidth()) { 5233 5261 RefPtr<CSSPrimitiveValue> borderSlice; 5234 if (!parseBorderImageWidth( propId,borderSlice))5262 if (!parseBorderImageWidth(borderSlice)) 5235 5263 return false; 5236 5264 context.commitBorderWidth(borderSlice.release()); 5265 continue; 5266 } else if (context.allowOutset()) { 5267 RefPtr<CSSPrimitiveValue> borderOutset; 5268 if (!parseBorderImageOutset(borderOutset)) 5269 return false; 5270 context.commitBorderOutset(borderOutset.release()); 5237 5271 continue; 5238 5272 } else if (context.allowRepeat()) { … … 5402 5436 } 5403 5437 5404 class BorderImage WidthParseContext {5438 class BorderImageQuadParseContext { 5405 5439 public: 5406 BorderImage WidthParseContext(CSSPrimitiveValueCache* primitiveValueCache)5440 BorderImageQuadParseContext(CSSPrimitiveValueCache* primitiveValueCache) 5407 5441 : m_primitiveValueCache(primitiveValueCache) 5408 5442 , m_allowNumber(true) … … 5440 5474 void setTop(PassRefPtr<CSSPrimitiveValue> val) { m_top = val; } 5441 5475 5442 PassRefPtr<CSSPrimitiveValue> commitBorderImage Width()5476 PassRefPtr<CSSPrimitiveValue> commitBorderImageQuad() 5443 5477 { 5444 5478 // We need to clone and repeat values for any omissions. … … 5479 5513 }; 5480 5514 5481 bool CSSParser::parseBorderImage Width(int propId, RefPtr<CSSPrimitiveValue>& result)5482 { 5483 BorderImage WidthParseContext context(primitiveValueCache());5515 bool CSSParser::parseBorderImageQuad(Units validUnits, RefPtr<CSSPrimitiveValue>& result) 5516 { 5517 BorderImageQuadParseContext context(primitiveValueCache()); 5484 5518 CSSParserValue* val; 5485 5519 while ((val = m_valueList->current())) { 5486 if (context.allowNumber() && (validUnit(val, FLength | FInteger | FNonNeg | FPercent, true) || val->id == CSSValueAuto)) {5520 if (context.allowNumber() && (validUnit(val, validUnits, true) || val->id == CSSValueAuto)) { 5487 5521 context.commitNumber(val); 5488 } else if ( propId == CSSPropertyBorderImageWidth || propId == CSSPropertyWebkitMaskBoxImageWidth) {5522 } else if (!inShorthand()) { 5489 5523 // If we're not parsing a shorthand then we are invalid. 5490 5524 return false; … … 5496 5530 if (context.allowFinalCommit()) { 5497 5531 // Need to fully commit as a single value. 5498 result = context.commitBorderImage Width();5532 result = context.commitBorderImageQuad(); 5499 5533 return true; 5500 5534 } 5501 5535 return false; 5536 } 5537 5538 bool CSSParser::parseBorderImageWidth(RefPtr<CSSPrimitiveValue>& result) 5539 { 5540 return parseBorderImageQuad(FLength | FInteger | FNonNeg | FPercent, result); 5541 } 5542 5543 bool CSSParser::parseBorderImageOutset(RefPtr<CSSPrimitiveValue>& result) 5544 { 5545 return parseBorderImageQuad(FLength | FInteger | FNonNeg, result); 5502 5546 } 5503 5547 -
trunk/Source/WebCore/css/CSSParser.h
r94593 r94912 170 170 bool parseBorderImageRepeat(RefPtr<CSSValue>&); 171 171 bool parseBorderImageSlice(int propId, RefPtr<CSSBorderImageSliceValue>&); 172 bool parseBorderImageWidth(int propId, RefPtr<CSSPrimitiveValue>&); 172 bool parseBorderImageWidth(RefPtr<CSSPrimitiveValue>&); 173 bool parseBorderImageOutset(RefPtr<CSSPrimitiveValue>&); 173 174 bool parseBorderRadius(int propId, bool important); 174 175 … … 374 375 static bool validUnit(CSSParserValue*, Units, bool strict); 375 376 377 bool parseBorderImageQuad(Units, RefPtr<CSSPrimitiveValue>&); 378 376 379 PassRefPtr<CSSPrimitiveValue> createPrimitiveNumericValue(CSSParserValue*); 377 380 PassRefPtr<CSSPrimitiveValue> createPrimitiveStringValue(CSSParserValue*); -
trunk/Source/WebCore/css/CSSPropertyNames.in
r94710 r94912 59 59 border-collapse 60 60 border-color 61 border-image-outset 61 62 border-image-repeat 62 63 border-image-slice … … 284 285 -webkit-mask-attachment 285 286 -webkit-mask-box-image 287 -webkit-mask-box-image-outset 286 288 -webkit-mask-box-image-repeat 287 289 -webkit-mask-box-image-slice -
trunk/Source/WebCore/css/CSSStyleSelector.cpp
r94889 r94912 3183 3183 return; 3184 3184 } 3185 case CSSPropertyBorderImageOutset: 3186 case CSSPropertyWebkitMaskBoxImageOutset: { 3187 bool isBorderImage = id == CSSPropertyBorderImageOutset; 3188 NinePieceImage image(isBorderImage ? m_style->borderImage() : m_style->maskBoxImage()); 3189 if (isInherit) 3190 image.copyOutsetFrom(isBorderImage ? m_parentStyle->borderImage() : m_parentStyle->maskBoxImage()); 3191 else if (isInitial) 3192 image.setOutset(LengthBox()); 3193 else 3194 image.setOutset(mapNinePieceImageQuad(value)); 3195 3196 if (isBorderImage) 3197 m_style->setBorderImage(image); 3198 else 3199 m_style->setMaskBoxImage(image); 3200 return; 3201 } 3185 3202 case CSSPropertyBorderImageRepeat: 3186 3203 case CSSPropertyWebkitMaskBoxImageRepeat: { … … 3230 3247 image.setBorderSlices(isBorderImage ? LengthBox(Length(1, Relative), Length(1, Relative), Length(1, Relative), Length(1, Relative)) : LengthBox()); 3231 3248 } else 3232 mapNinePieceImageWidth(value, image);3233 3249 image.setBorderSlices(mapNinePieceImageQuad(value)); 3250 3234 3251 if (isBorderImage) 3235 3252 m_style->setBorderImage(image); … … 4597 4614 4598 4615 // Map in the border slices. 4599 mapNinePieceImageWidth(borderImage->m_borderSlice.get(), image); 4616 if (borderImage->m_borderSlice) 4617 image.setBorderSlices(mapNinePieceImageQuad(borderImage->m_borderSlice.get())); 4618 4619 // Map in the outset. 4620 if (borderImage->m_outset) 4621 image.setOutset(mapNinePieceImageQuad(borderImage->m_outset.get())); 4600 4622 4601 4623 if (property == CSSPropertyWebkitBorderImage) { … … 4650 4672 } 4651 4673 4652 void CSSStyleSelector::mapNinePieceImageWidth(CSSValue* value, NinePieceImage& image)4674 LengthBox CSSStyleSelector::mapNinePieceImageQuad(CSSValue* value) 4653 4675 { 4654 4676 if (!value || !value->isPrimitiveValue()) 4655 return ;4677 return LengthBox(); 4656 4678 4657 4679 // Get our zoom value. … … 4668 4690 else if (slices->top()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) 4669 4691 box.m_top = Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); 4670 else 4692 else if (slices->top()->getIdent() != CSSValueAuto) 4671 4693 box.m_top = slices->top()->computeLength<Length>(style(), rootElementStyle(), zoom); 4672 4694 … … 4675 4697 else if (slices->right()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) 4676 4698 box.m_right = Length(slices->right()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); 4677 else 4699 else if (slices->right()->getIdent() != CSSValueAuto) 4678 4700 box.m_right = slices->right()->computeLength<Length>(style(), rootElementStyle(), zoom); 4679 4701 … … 4682 4704 else if (slices->bottom()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) 4683 4705 box.m_bottom = Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); 4684 else 4706 else if (slices->bottom()->getIdent() != CSSValueAuto) 4685 4707 box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElementStyle(), zoom); 4686 4708 … … 4689 4711 else if (slices->left()->primitiveType() == CSSPrimitiveValue::CSS_PERCENTAGE) 4690 4712 box.m_left = Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); 4691 else 4713 else if (slices->left()->getIdent() != CSSValueAuto) 4692 4714 box.m_left = slices->left()->computeLength<Length>(style(), rootElementStyle(), zoom); 4693 4715 4694 image.setBorderSlices(box);4716 return box; 4695 4717 } 4696 4718 … … 5421 5443 if (maskImage.image() && maskImage.image()->isPendingImage()) { 5422 5444 CSSImageValue* imageValue = static_cast<StylePendingImage*>(maskImage.image())->cssImageValue(); 5423 reflection->setMask(NinePieceImage(imageValue->cachedImage(cachedResourceLoader), maskImage.imageSlices(), maskImage.fill(), maskImage.borderSlices(), maskImage. horizontalRule(), maskImage.verticalRule()));5445 reflection->setMask(NinePieceImage(imageValue->cachedImage(cachedResourceLoader), maskImage.imageSlices(), maskImage.fill(), maskImage.borderSlices(), maskImage.outset(), maskImage.horizontalRule(), maskImage.verticalRule())); 5424 5446 } 5425 5447 } -
trunk/Source/WebCore/css/CSSStyleSelector.h
r94656 r94912 302 302 void mapNinePieceImage(CSSPropertyID, CSSValue*, NinePieceImage&); 303 303 void mapNinePieceImageSlice(CSSValue*, NinePieceImage&); 304 void mapNinePieceImageWidth(CSSValue*, NinePieceImage&);304 LengthBox mapNinePieceImageQuad(CSSValue*); 305 305 void mapNinePieceImageRepeat(CSSValue*, NinePieceImage&); 306 306 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r92340 r94912 153 153 child->clearKnownToHaveNoOverflow(); 154 154 } else if (!child->renderer()->isBR() && (child->renderer()->style(m_firstLine)->boxShadow() || child->boxModelObject()->hasSelfPaintingLayer() 155 || (child->renderer()->isListMarker() && !toRenderListMarker(child->renderer())->isInside()))) 155 || (child->renderer()->isListMarker() && !toRenderListMarker(child->renderer())->isInside()) 156 || child->renderer()->style(m_firstLine)->hasBorderImageOutsets())) 156 157 child->clearKnownToHaveNoOverflow(); 157 158 … … 722 723 inline void InlineFlowBox::addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow) 723 724 { 725 // box-shadow on root line boxes is applying to the block and not to the lines. 724 726 if (!parent()) 725 return; // Box-shadow doesn't apply to root line boxes. 727 return; 728 729 RenderStyle* style = renderer()->style(m_firstLine); 730 if (!style->boxShadow()) 731 return; 726 732 727 733 LayoutUnit boxShadowLogicalTop; 728 734 LayoutUnit boxShadowLogicalBottom; 729 renderer()->style(m_firstLine)->getBoxShadowBlockDirectionExtent(boxShadowLogicalTop, boxShadowLogicalBottom); 730 731 LayoutUnit logicalTopVisualOverflow = min(logicalTop() + boxShadowLogicalTop, logicalVisualOverflow.y()); 732 LayoutUnit logicalBottomVisualOverflow = max(logicalBottom() + boxShadowLogicalBottom, logicalVisualOverflow.maxY()); 735 style->getBoxShadowBlockDirectionExtent(boxShadowLogicalTop, boxShadowLogicalBottom); 736 737 // Similar to how glyph overflow works, if our lines are flipped, then it's actually the opposite shadow that applies, since 738 // the line is "upside down" in terms of block coordinates. 739 LayoutUnit shadowLogicalTop = style->isFlippedLinesWritingMode() ? -boxShadowLogicalBottom : boxShadowLogicalTop; 740 LayoutUnit shadowLogicalBottom = style->isFlippedLinesWritingMode() ? -boxShadowLogicalTop : boxShadowLogicalBottom; 741 742 LayoutUnit logicalTopVisualOverflow = min(logicalTop() + shadowLogicalTop, logicalVisualOverflow.y()); 743 LayoutUnit logicalBottomVisualOverflow = max(logicalBottom() + shadowLogicalBottom, logicalVisualOverflow.maxY()); 733 744 734 745 LayoutUnit boxShadowLogicalLeft; 735 746 LayoutUnit boxShadowLogicalRight; 736 renderer()->style(m_firstLine)->getBoxShadowInlineDirectionExtent(boxShadowLogicalLeft, boxShadowLogicalRight);747 style->getBoxShadowInlineDirectionExtent(boxShadowLogicalLeft, boxShadowLogicalRight); 737 748 738 749 LayoutUnit logicalLeftVisualOverflow = min(pixelSnappedLogicalLeft() + boxShadowLogicalLeft, logicalVisualOverflow.x()); 739 750 LayoutUnit logicalRightVisualOverflow = max(pixelSnappedLogicalRight() + boxShadowLogicalRight, logicalVisualOverflow.maxX()); 751 752 logicalVisualOverflow = LayoutRect(logicalLeftVisualOverflow, logicalTopVisualOverflow, 753 logicalRightVisualOverflow - logicalLeftVisualOverflow, logicalBottomVisualOverflow - logicalTopVisualOverflow); 754 } 755 756 inline void InlineFlowBox::addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow) 757 { 758 // border-image-outset on root line boxes is applying to the block and not to the lines. 759 if (!parent()) 760 return; 761 762 RenderStyle* style = renderer()->style(m_firstLine); 763 if (!style->hasBorderImageOutsets()) 764 return; 765 766 LayoutUnit borderOutsetLogicalTop; 767 LayoutUnit borderOutsetLogicalBottom; 768 style->getBorderImageBlockDirectionOutsets(borderOutsetLogicalTop, borderOutsetLogicalBottom); 769 770 // Similar to how glyph overflow works, if our lines are flipped, then it's actually the opposite border that applies, since 771 // the line is "upside down" in terms of block coordinates. vertical-rl and horizontal-bt are the flipped line modes. 772 LayoutUnit outsetLogicalTop = style->isFlippedLinesWritingMode() ? borderOutsetLogicalBottom : borderOutsetLogicalTop; 773 LayoutUnit outsetLogicalBottom = style->isFlippedLinesWritingMode() ? borderOutsetLogicalTop : borderOutsetLogicalBottom; 774 775 LayoutUnit logicalTopVisualOverflow = min(logicalTop() - outsetLogicalTop, logicalVisualOverflow.y()); 776 LayoutUnit logicalBottomVisualOverflow = max(logicalBottom() + outsetLogicalBottom, logicalVisualOverflow.maxY()); 777 778 LayoutUnit borderOutsetLogicalLeft; 779 LayoutUnit borderOutsetLogicalRight; 780 style->getBorderImageInlineDirectionOutsets(borderOutsetLogicalLeft, borderOutsetLogicalRight); 781 782 LayoutUnit outsetLogicalLeft = includeLogicalLeftEdge() ? borderOutsetLogicalLeft : 0; 783 LayoutUnit outsetLogicalRight = includeLogicalRightEdge() ? borderOutsetLogicalRight : 0; 784 785 LayoutUnit logicalLeftVisualOverflow = min(pixelSnappedLogicalLeft() - outsetLogicalLeft, logicalVisualOverflow.x()); 786 LayoutUnit logicalRightVisualOverflow = max(pixelSnappedLogicalRight() + outsetLogicalRight, logicalVisualOverflow.maxX()); 740 787 741 788 logicalVisualOverflow = LayoutRect(logicalLeftVisualOverflow, logicalTopVisualOverflow, … … 836 883 LayoutRect logicalVisualOverflow(logicalLayoutOverflow); 837 884 838 // box-shadow on root line boxes is applying to the block and not to the lines.839 885 addBoxShadowVisualOverflow(logicalVisualOverflow); 886 addBorderOutsetVisualOverflow(logicalVisualOverflow); 840 887 841 888 for (InlineBox* curr = firstChild(); curr; curr = curr->nextOnLine()) { … … 1095 1142 } 1096 1143 1144 static LayoutRect clipRectForNinePieceImageStrip(InlineFlowBox* box, const NinePieceImage& image, const LayoutRect& paintRect) 1145 { 1146 LayoutRect clipRect(paintRect); 1147 RenderStyle* style = box->renderer()->style(); 1148 LayoutUnit topOutset; 1149 LayoutUnit rightOutset; 1150 LayoutUnit bottomOutset; 1151 LayoutUnit leftOutset; 1152 style->getImageOutsets(image, topOutset, rightOutset, bottomOutset, leftOutset); 1153 if (box->isHorizontal()) { 1154 clipRect.setY(paintRect.y() - topOutset); 1155 clipRect.setHeight(paintRect.height() + topOutset + bottomOutset); 1156 if (box->includeLogicalLeftEdge()) { 1157 clipRect.setX(paintRect.x() - leftOutset); 1158 clipRect.setWidth(paintRect.width() + leftOutset); 1159 } 1160 if (box->includeLogicalRightEdge()) 1161 clipRect.setWidth(clipRect.width() + rightOutset); 1162 } else { 1163 clipRect.setX(paintRect.x() - leftOutset); 1164 clipRect.setWidth(paintRect.width() + leftOutset + rightOutset); 1165 if (box->includeLogicalLeftEdge()) { 1166 clipRect.setY(paintRect.y() - topOutset); 1167 clipRect.setHeight(paintRect.height() + topOutset); 1168 } 1169 if (box->includeLogicalRightEdge()) 1170 clipRect.setHeight(clipRect.height() + bottomOutset); 1171 } 1172 return clipRect; 1173 } 1174 1097 1175 void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 1098 1176 { … … 1127 1205 // non-first-line style. 1128 1206 if (parent() && renderer()->style()->hasBorder()) { 1129 StyleImage* borderImage = renderer()->style()->borderImage().image(); 1130 bool hasBorderImage = borderImage && borderImage->canRender(styleToUse->effectiveZoom()); 1131 if (hasBorderImage && !borderImage->isLoaded()) 1207 const NinePieceImage& borderImage = renderer()->style()->borderImage(); 1208 StyleImage* borderImageSource = borderImage.image(); 1209 bool hasBorderImage = borderImageSource && borderImageSource->canRender(styleToUse->effectiveZoom()); 1210 if (hasBorderImage && !borderImageSource->isLoaded()) 1132 1211 return; // Don't paint anything while we wait for the image to load. 1133 1212 … … 1156 1235 LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth; 1157 1236 1237 LayoutRect clipRect = clipRectForNinePieceImageStrip(this, borderImage, paintRect); 1158 1238 GraphicsContextStateSaver stateSaver(*context); 1159 context->clip( paintRect);1239 context->clip(clipRect); 1160 1240 boxModelObject()->paintBorder(paintInfo, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer()->style()); 1161 1241 } … … 1223 1303 LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth; 1224 1304 1305 LayoutRect clipRect = clipRectForNinePieceImageStrip(this, maskNinePieceImage, paintRect); 1225 1306 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1226 paintInfo.context->clip( paintRect);1307 paintInfo.context->clip(clipRect); 1227 1308 boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, compositeOp); 1228 1309 } -
trunk/Source/WebCore/rendering/InlineFlowBox.h
r93333 r94912 275 275 private: 276 276 void addBoxShadowVisualOverflow(LayoutRect& logicalVisualOverflow); 277 void addBorderOutsetVisualOverflow(LayoutRect& logicalVisualOverflow); 277 278 void addTextBoxVisualOverflow(InlineTextBox*, GlyphOverflowAndFallbackFontsMap&, LayoutRect& logicalVisualOverflow); 278 279 void addReplacedChildOverflow(const InlineBox*, LayoutRect& logicalLayoutOverflow, LayoutRect& logicalVisualOverflow); -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r94877 r94912 1427 1427 } 1428 1428 1429 // Add visual overflow from box-shadow and reflections.1430 add ShadowOverflow();1429 // Add visual overflow from box-shadow and border-image-outset. 1430 addBoxShadowAndBorderOverflow(); 1431 1431 } 1432 1432 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r94706 r94912 989 989 LayoutRect RenderBox::maskClipRect() 990 990 { 991 LayoutRect bbox = borderBoxRect(); 992 if (style()->maskBoxImage().image()) 993 return bbox; 991 const NinePieceImage& maskBoxImage = style()->maskBoxImage(); 992 if (maskBoxImage.image()) { 993 LayoutRect borderImageRect = borderBoxRect(); 994 995 // Apply outsets to the border box. 996 LayoutUnit topOutset; 997 LayoutUnit rightOutset; 998 LayoutUnit bottomOutset; 999 LayoutUnit leftOutset; 1000 style()->getMaskBoxImageOutsets(topOutset, rightOutset, bottomOutset, leftOutset); 1001 1002 borderImageRect.setX(borderImageRect.x() - leftOutset); 1003 borderImageRect.setY(borderImageRect.y() - topOutset); 1004 borderImageRect.setWidth(borderImageRect.width() + leftOutset + rightOutset); 1005 borderImageRect.setHeight(borderImageRect.height() + topOutset + bottomOutset); 1006 1007 return borderImageRect; 1008 } 994 1009 995 1010 LayoutRect result; 1011 LayoutRect borderBox = borderBoxRect(); 996 1012 for (const FillLayer* maskLayer = style()->maskLayers(); maskLayer; maskLayer = maskLayer->next()) { 997 1013 if (maskLayer->image()) { 998 1014 BackgroundImageGeometry geometry; 999 calculateBackgroundImageGeometry(maskLayer, b box, geometry);1015 calculateBackgroundImageGeometry(maskLayer, borderBox, geometry); 1000 1016 result.unite(geometry.destRect()); 1001 1017 } … … 3247 3263 } 3248 3264 3249 void RenderBox::addShadowOverflow() 3250 { 3251 LayoutUnit shadowLeft; 3252 LayoutUnit shadowRight; 3253 LayoutUnit shadowTop; 3254 LayoutUnit shadowBottom; 3255 style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft); 3265 void RenderBox::addBoxShadowAndBorderOverflow() 3266 { 3267 if (!style()->boxShadow() && !style()->hasBorderImageOutsets()) 3268 return; 3269 3270 bool isFlipped = style()->isFlippedBlocksWritingMode(); 3271 bool isHorizontal = isHorizontalWritingMode(); 3272 3256 3273 LayoutRect borderBox = borderBoxRect(); 3257 LayoutUnit overflowLeft = borderBox.x() + shadowLeft; 3258 LayoutUnit overflowRight = borderBox.maxX() + shadowRight; 3259 LayoutUnit overflowTop = borderBox.y() + shadowTop; 3260 LayoutUnit overflowBottom = borderBox.maxY() + shadowBottom; 3261 addVisualOverflow(LayoutRect(overflowLeft, overflowTop, overflowRight - overflowLeft, overflowBottom - overflowTop)); 3274 LayoutUnit overflowMinX = borderBox.x(); 3275 LayoutUnit overflowMaxX = borderBox.maxX(); 3276 LayoutUnit overflowMinY = borderBox.y(); 3277 LayoutUnit overflowMaxY = borderBox.maxY(); 3278 3279 // Compute box-shadow overflow first. 3280 if (style()->boxShadow()) { 3281 LayoutUnit shadowLeft; 3282 LayoutUnit shadowRight; 3283 LayoutUnit shadowTop; 3284 LayoutUnit shadowBottom; 3285 style()->getBoxShadowExtent(shadowTop, shadowRight, shadowBottom, shadowLeft); 3286 3287 // In flipped blocks writing modes such as vertical-rl, the physical right shadow value is actually at the lower x-coordinate. 3288 overflowMinX = borderBox.x() + ((!isFlipped || isHorizontal) ? shadowLeft : -shadowRight); 3289 overflowMaxX = borderBox.maxX() + ((!isFlipped || isHorizontal) ? shadowRight : -shadowLeft); 3290 overflowMinY = borderBox.y() + ((!isFlipped || !isHorizontal) ? shadowTop : -shadowBottom); 3291 overflowMaxY = borderBox.maxY() + ((!isFlipped || !isHorizontal) ? shadowBottom : -shadowTop); 3292 } 3293 3294 // Now compute border-image-outset overflow. 3295 if (style()->hasBorderImageOutsets()) { 3296 LayoutUnit borderOutsetLeft; 3297 LayoutUnit borderOutsetRight; 3298 LayoutUnit borderOutsetTop; 3299 LayoutUnit borderOutsetBottom; 3300 style()->getBorderImageOutsets(borderOutsetTop, borderOutsetRight, borderOutsetBottom, borderOutsetLeft); 3301 3302 // In flipped blocks writing modes, the physical sides are inverted. For example in vertical-rl, the right 3303 // border is at the lower x coordinate value. 3304 overflowMinX = min(overflowMinX, borderBox.x() - ((!isFlipped || isHorizontal) ? borderOutsetLeft : borderOutsetRight)); 3305 overflowMaxX = max(overflowMaxX, borderBox.maxX() + ((!isFlipped || isHorizontal) ? borderOutsetRight : borderOutsetLeft)); 3306 overflowMinY = min(overflowMinY, borderBox.y() - ((!isFlipped || !isHorizontal) ? borderOutsetTop : borderOutsetBottom)); 3307 overflowMaxY = max(overflowMaxY, borderBox.maxY() + ((!isFlipped || !isHorizontal) ? borderOutsetBottom : borderOutsetTop)); 3308 } 3309 3310 // Add in the final overflow with shadows and outsets combined. 3311 addVisualOverflow(LayoutRect(overflowMinX, overflowMinY, overflowMaxX - overflowMinX, overflowMaxY - overflowMinY)); 3262 3312 } 3263 3313 -
trunk/Source/WebCore/rendering/RenderBox.h
r94706 r94912 160 160 void addVisualOverflow(const LayoutRect&); 161 161 162 void add ShadowOverflow();162 void addBoxShadowAndBorderOverflow(); 163 163 void addOverflowFromChild(RenderBox* child) { addOverflowFromChild(child, child->locationOffset()); } 164 164 void addOverflowFromChild(RenderBox* child, const LayoutSize& delta); -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r94593 r94912 990 990 ENinePieceImageRule vRule = ninePieceImage.verticalRule(); 991 991 992 LayoutUnit topWidth = computeBorderImageSide(ninePieceImage.borderSlices().top(), style->borderTopWidth(), topSlice, rect.height()); 993 LayoutUnit rightWidth = computeBorderImageSide(ninePieceImage.borderSlices().right(), style->borderRightWidth(), rightSlice, rect.width()); 994 LayoutUnit bottomWidth = computeBorderImageSide(ninePieceImage.borderSlices().bottom(), style->borderBottomWidth(), bottomSlice, rect.height()); 995 LayoutUnit leftWidth = computeBorderImageSide(ninePieceImage.borderSlices().left(), style->borderLeftWidth(), leftSlice, rect.width()); 992 LayoutUnit topOutset; 993 LayoutUnit rightOutset; 994 LayoutUnit bottomOutset; 995 LayoutUnit leftOutset; 996 style->getImageOutsets(ninePieceImage, topOutset, rightOutset, bottomOutset, leftOutset); 997 998 LayoutUnit topWithOutset = rect.y() - topOutset; 999 LayoutUnit bottomWithOutset = rect.maxY() + bottomOutset; 1000 LayoutUnit leftWithOutset = rect.x() - leftOutset; 1001 LayoutUnit rightWithOutset = rect.maxX() + rightOutset; 1002 LayoutRect borderImageRect = LayoutRect(leftWithOutset, topWithOutset, rightWithOutset - leftWithOutset, bottomWithOutset - topWithOutset); 1003 1004 LayoutUnit topWidth = computeBorderImageSide(ninePieceImage.borderSlices().top(), style->borderTopWidth(), topSlice, borderImageRect.height()); 1005 LayoutUnit rightWidth = computeBorderImageSide(ninePieceImage.borderSlices().right(), style->borderRightWidth(), rightSlice, borderImageRect.width()); 1006 LayoutUnit bottomWidth = computeBorderImageSide(ninePieceImage.borderSlices().bottom(), style->borderBottomWidth(), bottomSlice, borderImageRect.height()); 1007 LayoutUnit leftWidth = computeBorderImageSide(ninePieceImage.borderSlices().left(), style->borderLeftWidth(), leftSlice, borderImageRect.width()); 996 1008 997 1009 // Reduce the widths if they're too large. … … 1001 1013 int borderSideWidth = max(1, leftWidth + rightWidth); 1002 1014 int borderSideHeight = max(1, topWidth + bottomWidth); 1003 float borderSideScaleFactor = min((float) rect.width() / borderSideWidth, (float)rect.height() / borderSideHeight);1015 float borderSideScaleFactor = min((float)borderImageRect.width() / borderSideWidth, (float)borderImageRect.height() / borderSideHeight); 1004 1016 if (borderSideScaleFactor < 1) { 1005 1017 topWidth *= borderSideScaleFactor; … … 1013 1025 bool drawRight = rightSlice > 0 && rightWidth > 0; 1014 1026 bool drawBottom = bottomSlice > 0 && bottomWidth > 0; 1015 bool drawMiddle = ninePieceImage.fill() && (imageWidth - leftSlice - rightSlice) > 0 && ( rect.width() - leftWidth - rightWidth) > 01016 && (imageHeight - topSlice - bottomSlice) > 0 && ( rect.height() - topWidth - bottomWidth) > 0;1027 bool drawMiddle = ninePieceImage.fill() && (imageWidth - leftSlice - rightSlice) > 0 && (borderImageRect.width() - leftWidth - rightWidth) > 0 1028 && (imageHeight - topSlice - bottomSlice) > 0 && (borderImageRect.height() - topWidth - bottomWidth) > 0; 1017 1029 1018 1030 RefPtr<Image> image = styleImage->image(this, imageSize); … … 1025 1037 // The rect to use from within the image is obtained from our slice, and is (0, 0, leftSlice, topSlice) 1026 1038 if (drawTop) 1027 graphicsContext->drawImage(image.get(), colorSpace, LayoutRect( rect.location(), LayoutSize(leftWidth, topWidth)),1039 graphicsContext->drawImage(image.get(), colorSpace, LayoutRect(borderImageRect.location(), LayoutSize(leftWidth, topWidth)), 1028 1040 LayoutRect(0, 0, leftSlice, topSlice), op); 1029 1041 … … 1031 1043 // The rect to use from within the image is (0, imageHeight - bottomSlice, leftSlice, botomSlice) 1032 1044 if (drawBottom) 1033 graphicsContext->drawImage(image.get(), colorSpace, LayoutRect( rect.x(), rect.y() + rect.height() - bottomWidth, leftWidth, bottomWidth),1045 graphicsContext->drawImage(image.get(), colorSpace, LayoutRect(borderImageRect.x(), borderImageRect.maxY() - bottomWidth, leftWidth, bottomWidth), 1034 1046 LayoutRect(0, imageHeight - bottomSlice, leftSlice, bottomSlice), op); 1035 1047 1036 1048 // Paint the left edge. 1037 1049 // Have to scale and tile into the border rect. 1038 graphicsContext->drawTiledImage(image.get(), colorSpace, LayoutRect( rect.x(), rect.y() + topWidth, leftWidth,1039 rect.height() - topWidth - bottomWidth),1050 graphicsContext->drawTiledImage(image.get(), colorSpace, LayoutRect(borderImageRect.x(), borderImageRect.y() + topWidth, leftWidth, 1051 borderImageRect.height() - topWidth - bottomWidth), 1040 1052 LayoutRect(0, topSlice, leftSlice, imageHeight - topSlice - bottomSlice), 1041 1053 Image::StretchTile, (Image::TileRule)vRule, op); … … 1047 1059 // The rect to use from within the image is obtained from our slice, and is (imageWidth - rightSlice, 0, rightSlice, topSlice) 1048 1060 if (drawTop) 1049 graphicsContext->drawImage(image.get(), colorSpace, LayoutRect( rect.x() + rect.width() - rightWidth, rect.y(), rightWidth, topWidth),1061 graphicsContext->drawImage(image.get(), colorSpace, LayoutRect(borderImageRect.maxX() - rightWidth, borderImageRect.y(), rightWidth, topWidth), 1050 1062 LayoutRect(imageWidth - rightSlice, 0, rightSlice, topSlice), op); 1051 1063 … … 1053 1065 // The rect to use from within the image is (imageWidth - rightSlice, imageHeight - bottomSlice, rightSlice, bottomSlice) 1054 1066 if (drawBottom) 1055 graphicsContext->drawImage(image.get(), colorSpace, LayoutRect( rect.x() + rect.width() - rightWidth, rect.y() + rect.height() - bottomWidth, rightWidth, bottomWidth),1067 graphicsContext->drawImage(image.get(), colorSpace, LayoutRect(borderImageRect.maxX() - rightWidth, borderImageRect.maxY() - bottomWidth, rightWidth, bottomWidth), 1056 1068 LayoutRect(imageWidth - rightSlice, imageHeight - bottomSlice, rightSlice, bottomSlice), op); 1057 1069 1058 1070 // Paint the right edge. 1059 graphicsContext->drawTiledImage(image.get(), colorSpace, LayoutRect( rect.x() + rect.width() - rightWidth, rect.y() + topWidth, rightWidth,1060 rect.height() - topWidth - bottomWidth),1071 graphicsContext->drawTiledImage(image.get(), colorSpace, LayoutRect(borderImageRect.maxX() - rightWidth, borderImageRect.y() + topWidth, rightWidth, 1072 borderImageRect.height() - topWidth - bottomWidth), 1061 1073 LayoutRect(imageWidth - rightSlice, topSlice, rightSlice, imageHeight - topSlice - bottomSlice), 1062 1074 Image::StretchTile, (Image::TileRule)vRule, op); … … 1065 1077 // Paint the top edge. 1066 1078 if (drawTop) 1067 graphicsContext->drawTiledImage(image.get(), colorSpace, LayoutRect( rect.x() + leftWidth, rect.y(), rect.width() - leftWidth - rightWidth, topWidth),1079 graphicsContext->drawTiledImage(image.get(), colorSpace, LayoutRect(borderImageRect.x() + leftWidth, borderImageRect.y(), borderImageRect.width() - leftWidth - rightWidth, topWidth), 1068 1080 LayoutRect(leftSlice, 0, imageWidth - rightSlice - leftSlice, topSlice), 1069 1081 (Image::TileRule)hRule, Image::StretchTile, op); … … 1071 1083 // Paint the bottom edge. 1072 1084 if (drawBottom) 1073 graphicsContext->drawTiledImage(image.get(), colorSpace, LayoutRect( rect.x() + leftWidth, rect.y() + rect.height() - bottomWidth,1074 rect.width() - leftWidth - rightWidth, bottomWidth),1085 graphicsContext->drawTiledImage(image.get(), colorSpace, LayoutRect(borderImageRect.x() + leftWidth, borderImageRect.maxY() - bottomWidth, 1086 borderImageRect.width() - leftWidth - rightWidth, bottomWidth), 1075 1087 LayoutRect(leftSlice, imageHeight - bottomSlice, imageWidth - rightSlice - leftSlice, bottomSlice), 1076 1088 (Image::TileRule)hRule, Image::StretchTile, op); … … 1078 1090 // Paint the middle. 1079 1091 if (drawMiddle) 1080 graphicsContext->drawTiledImage(image.get(), colorSpace, LayoutRect( rect.x() + leftWidth, rect.y() + topWidth, rect.width() - leftWidth - rightWidth,1081 rect.height() - topWidth - bottomWidth),1092 graphicsContext->drawTiledImage(image.get(), colorSpace, LayoutRect(borderImageRect.x() + leftWidth, borderImageRect.y() + topWidth, borderImageRect.width() - leftWidth - rightWidth, 1093 borderImageRect.height() - topWidth - bottomWidth), 1082 1094 LayoutRect(leftSlice, topSlice, imageWidth - rightSlice - leftSlice, imageHeight - topSlice - bottomSlice), 1083 1095 (Image::TileRule)hRule, (Image::TileRule)vRule, op); -
trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp
r90667 r94912 221 221 222 222 m_overflow.clear(); 223 add ShadowOverflow();223 addBoxShadowAndBorderOverflow(); 224 224 225 225 updateLayerTransform(); -
trunk/Source/WebCore/rendering/RenderIFrame.cpp
r90069 r94912 125 125 126 126 m_overflow.clear(); 127 add ShadowOverflow();127 addBoxShadowAndBorderOverflow(); 128 128 updateLayerTransform(); 129 129 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r94910 r94912 3534 3534 3535 3535 // If we establish a clip at all, then go ahead and make sure our background 3536 // rect is intersected with our layer's bounds. 3537 // FIXME: This could be changed to just use generic visual overflow. 3538 // See https://bugs.webkit.org/show_bug.cgi?id=37467 for more information. 3539 if (const ShadowData* boxShadow = renderer()->style()->boxShadow()) { 3540 LayoutRect overflow = layerBounds; 3541 do { 3542 if (boxShadow->style() == Normal) { 3543 LayoutRect shadowRect = layerBounds; 3544 shadowRect.move(boxShadow->x(), boxShadow->y()); 3545 shadowRect.inflate(boxShadow->blur() + boxShadow->spread()); 3546 overflow.unite(shadowRect); 3547 } 3548 3549 boxShadow = boxShadow->next(); 3550 } while (boxShadow); 3551 backgroundRect.intersect(overflow); 3552 } else 3553 backgroundRect.intersect(layerBounds); 3536 // rect is intersected with our layer's bounds including our visual overflow, 3537 // since any visual overflow like box-shadow or border-outset is not clipped by overflow:auto/hidden. 3538 LayoutRect layerBoundsWithVisualOverflow = renderBox()->visualOverflowRect(); 3539 renderBox()->flipForWritingMode(layerBoundsWithVisualOverflow); // Layers are in physical coordinates, so the overflow has to be flipped. 3540 layerBoundsWithVisualOverflow.moveBy(offset); 3541 backgroundRect.intersect(layerBoundsWithVisualOverflow); 3554 3542 } 3555 3543 } … … 3655 3643 RenderBox* box = renderBox(); 3656 3644 ASSERT(box); 3657 if (box->hasMask()) 3645 if (box->hasMask()) { 3658 3646 result = box->maskClipRect(); 3659 else { 3647 box->flipForWritingMode(result); // The mask clip rect is in physical coordinates, so we have to flip, since localBoundingBox is not. 3648 } else { 3660 3649 LayoutRect bbox = box->borderBoxRect(); 3661 3650 result = bbox; -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r94372 r94912 89 89 90 90 m_overflow.clear(); 91 add ShadowOverflow();91 addBoxShadowAndBorderOverflow(); 92 92 updateLayerTransform(); 93 93 -
trunk/Source/WebCore/rendering/style/NinePieceImage.cpp
r94593 r94912 30 30 { 31 31 return StyleImage::imagesEquivalent(m_image.get(), o.m_image.get()) && m_imageSlices == o.m_imageSlices && m_fill == o.m_fill 32 && m_borderSlices == o.m_borderSlices && m_ horizontalRule == o.m_horizontalRule && m_verticalRule == o.m_verticalRule;32 && m_borderSlices == o.m_borderSlices && m_outset == o.m_outset && m_horizontalRule == o.m_horizontalRule && m_verticalRule == o.m_verticalRule; 33 33 } 34 34 -
trunk/Source/WebCore/rendering/style/NinePieceImage.h
r94593 r94912 25 25 #define NinePieceImage_h 26 26 27 #include "LayoutTypes.h" 27 28 #include "LengthBox.h" 28 29 #include "StyleImage.h" … … 40 41 , m_imageSlices(Length(100, Percent), Length(100, Percent), Length(100, Percent), Length(100, Percent)) 41 42 , m_borderSlices(Length(1, Relative), Length(1, Relative), Length(1, Relative), Length(1, Relative)) 43 , m_outset(0) 42 44 , m_fill(false) 43 45 , m_horizontalRule(StretchImageRule) … … 46 48 } 47 49 48 NinePieceImage(StyleImage* image, LengthBox imageSlices, bool fill, LengthBox borderSlices, ENinePieceImageRule h, ENinePieceImageRule v)50 NinePieceImage(StyleImage* image, LengthBox imageSlices, bool fill, LengthBox borderSlices, LengthBox outset, ENinePieceImageRule h, ENinePieceImageRule v) 49 51 : m_image(image) 50 52 , m_imageSlices(imageSlices) 51 53 , m_borderSlices(borderSlices) 54 , m_outset(outset) 52 55 , m_fill(fill) 53 56 , m_horizontalRule(h) … … 72 75 void setBorderSlices(const LengthBox& slices) { m_borderSlices = slices; } 73 76 77 const LengthBox& outset() const { return m_outset; } 78 void setOutset(const LengthBox& outset) { m_outset = outset; } 79 80 static LayoutUnit computeOutset(Length outsetSide, LayoutUnit borderSide) 81 { 82 if (outsetSide.isRelative()) 83 return outsetSide.value() * borderSide; 84 return outsetSide.value(); 85 } 86 74 87 ENinePieceImageRule horizontalRule() const { return static_cast<ENinePieceImageRule>(m_horizontalRule); } 75 88 void setHorizontalRule(ENinePieceImageRule rule) { m_horizontalRule = rule; } … … 88 101 m_borderSlices = other.m_borderSlices; 89 102 } 103 104 void copyOutsetFrom(const NinePieceImage& other) 105 { 106 m_outset = other.m_outset; 107 } 90 108 91 109 void copyRepeatFrom(const NinePieceImage& other) … … 99 117 LengthBox m_imageSlices; 100 118 LengthBox m_borderSlices; 119 LengthBox m_outset; 101 120 bool m_fill : 1; 102 121 unsigned m_horizontalRule : 2; // ENinePieceImageRule -
trunk/Source/WebCore/rendering/style/RenderStyle.cpp
r94887 r94912 1509 1509 } 1510 1510 1511 void RenderStyle::getImageOutsets(const NinePieceImage& image, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const 1512 { 1513 top = NinePieceImage::computeOutset(image.outset().top(), borderTopWidth()); 1514 right = NinePieceImage::computeOutset(image.outset().right(), borderRightWidth()); 1515 bottom = NinePieceImage::computeOutset(image.outset().bottom(), borderBottomWidth()); 1516 left = NinePieceImage::computeOutset(image.outset().left(), borderLeftWidth()); 1517 } 1518 1519 void RenderStyle::getImageHorizontalOutsets(const NinePieceImage& image, LayoutUnit& left, LayoutUnit& right) const 1520 { 1521 right = NinePieceImage::computeOutset(image.outset().right(), borderRightWidth()); 1522 left = NinePieceImage::computeOutset(image.outset().left(), borderLeftWidth()); 1523 } 1524 1525 void RenderStyle::getImageVerticalOutsets(const NinePieceImage& image, LayoutUnit& top, LayoutUnit& bottom) const 1526 { 1527 top = NinePieceImage::computeOutset(image.outset().top(), borderTopWidth()); 1528 bottom = NinePieceImage::computeOutset(image.outset().bottom(), borderBottomWidth()); 1529 } 1530 1511 1531 } // namespace WebCore -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r94887 r94912 359 359 return true; 360 360 return hasBackgroundImage(); 361 } 362 363 void getImageOutsets(const NinePieceImage&, LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const; 364 bool hasBorderImageOutsets() const 365 { 366 return borderImage().hasImage() && borderImage().outset().nonZero(); 367 } 368 void getBorderImageOutsets(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const 369 { 370 return getImageOutsets(borderImage(), top, right, bottom, left); 371 } 372 void getBorderImageHorizontalOutsets(LayoutUnit& left, LayoutUnit& right) const 373 { 374 return getImageHorizontalOutsets(borderImage(), left, right); 375 } 376 void getBorderImageVerticalOutsets(LayoutUnit& top, LayoutUnit& bottom) const 377 { 378 return getImageVerticalOutsets(borderImage(), top, bottom); 379 } 380 void getBorderImageInlineDirectionOutsets(LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const 381 { 382 return getImageInlineDirectionOutsets(borderImage(), logicalLeft, logicalRight); 383 } 384 void getBorderImageBlockDirectionOutsets(LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const 385 { 386 return getImageBlockDirectionOutsets(borderImage(), logicalTop, logicalBottom); 387 } 388 389 void getMaskBoxImageOutsets(LayoutUnit& top, LayoutUnit& right, LayoutUnit& bottom, LayoutUnit& left) const 390 { 391 return getImageOutsets(maskBoxImage(), top, right, bottom, left); 361 392 } 362 393 … … 1439 1470 } 1440 1471 1472 // Helpers for obtaining border image outsets for overflow. 1473 void getImageHorizontalOutsets(const NinePieceImage&, LayoutUnit& left, LayoutUnit& right) const; 1474 void getImageVerticalOutsets(const NinePieceImage&, LayoutUnit& top, LayoutUnit& bottom) const; 1475 void getImageInlineDirectionOutsets(const NinePieceImage& image, LayoutUnit& logicalLeft, LayoutUnit& logicalRight) const 1476 { 1477 return isHorizontalWritingMode() ? getImageHorizontalOutsets(image, logicalLeft, logicalRight) : getImageVerticalOutsets(image, logicalLeft, logicalRight); 1478 } 1479 void getImageBlockDirectionOutsets(const NinePieceImage& image, LayoutUnit& logicalTop, LayoutUnit& logicalBottom) const 1480 { 1481 return isHorizontalWritingMode() ? getImageVerticalOutsets(image, logicalTop, logicalBottom) : getImageHorizontalOutsets(image, logicalTop, logicalBottom); 1482 } 1483 1441 1484 // Color accessors are all private to make sure callers use visitedDependentColor instead to access them. 1442 1485 const Color& borderLeftColor() const { return surround->border.left().color(); }
Note: See TracChangeset
for help on using the changeset viewer.