Skip to content
  • betravis@adobe.com's avatar
    [CSS Shapes] Layout using [<box> || <shape>] value · d86e74f7
    betravis@adobe.com authored
    https://bugs.webkit.org/show_bug.cgi?id=124428
    
    Reviewed by David Hyatt.
    
    Source/WebCore:
    
    When a box value is supplied, use it to size and position the shape. Otherwise,
    use a default value (content-box for shape-inside, margin-box for shape-outside).
    This patch extends the sizing and positioning code used for the box patch (Bug 124227)
    to also apply to shapes. With this patch, we also no longer use the box-sizing
    property to size and position shapes.
    
    Tests: fast/shapes/shape-outside-floats/shape-outside-shape-boxes-001.html
           fast/shapes/shape-outside-floats/shape-outside-shape-boxes-002.html
           fast/shapes/shape-outside-floats/shape-outside-shape-boxes-003.html
    
    * css/CSSComputedStyleDeclaration.cpp:
    (WebCore::ComputedStyleExtractor::propertyValue): Adjust for ShapeValues storing
    BasicShape::ReferenceBox as their box value, rather than a CSSValueID.
    * css/DeprecatedStyleBuilder.cpp:
    (WebCore::ApplyPropertyShape::applyValue): Ditto.
    * rendering/shapes/ShapeInfo.h:
    (WebCore::ShapeInfo::setShapeSize): Adjust for BasicShapes with reference boxes
    as well as plain box values. Also, remove old box-sizing code.
    (WebCore::ShapeInfo::logicalTopOffset): Ditto.
    (WebCore::ShapeInfo::logicalLeftOffset): Ditto.
    * rendering/shapes/ShapeInsideInfo.h:
    * rendering/shapes/ShapeOutsideInfo.h:
    * rendering/style/ShapeValue.h:
    (WebCore::ShapeValue::createBoxValue): Adjust for boxes being stored as
    BasicShape::ReferenceBoxes.
    (WebCore::ShapeValue::box): Ditto.
    (WebCore::ShapeValue::ShapeValue): Ditto.
    
    LayoutTests:
    
    Adding tests to make sure that shapes properly size and position themselves across box values
    and writing modes. Some shape-outside tests needed to be updated to explicitly size themselves
    to content-box, as they were relying on that being the default value. Some shape-inside tests
    needed to be adjusted as box-sizing no longer affects the shape size and position.
    
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-circle-001.html:
    Explicitly size to content-box.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-001.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-002.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-003.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-004.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-010.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-011.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-012.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-014.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-015.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-016.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-017.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-018.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-margin-021.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-001.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-002.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-003.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-padding-004.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-polygon-000.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-polygon-001.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-polygon-002.html: Ditto.
    * csswg/contributors/adobe/submitted/shapes/shape-outside/shape-outside-floats-square-border-000.html: Ditto.
    * fast/shapes/shape-inside/shape-inside-box-sizing-expected.html: Small test cleanup.
    * fast/shapes/shape-inside/shape-inside-box-sizing.html: Modify shapes to provide their sizing box.
    * fast/shapes/shape-inside/shape-inside-empty-expected.html: Small test cleanup.
    * fast/shapes/shape-inside/shape-inside-empty.html: Modify shapes to provide their sizing box.
    * fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html: Ditto.
    * fast/shapes/shape-outside-floats/shape-outside-shape-boxes-001-expected.html: Added.
    * fast/shapes/shape-outside-floats/shape-outside-shape-boxes-001.html: Added.
    * fast/shapes/shape-outside-floats/shape-outside-shape-boxes-002-expected.html: Added.
    * fast/shapes/shape-outside-floats/shape-outside-shape-boxes-002.html: Added.
    * fast/shapes/shape-outside-floats/shape-outside-shape-boxes-003-expected.html: Added.
    * fast/shapes/shape-outside-floats/shape-outside-shape-boxes-003.html: Added.
    * inspector-protocol/model/highlight-shape-outside.html: Modify shapes to provide their sizing box.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159792 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d86e74f7