Ignore:
Timestamp:
Oct 3, 2013, 11:24:59 AM (12 years ago)
Author:
[email protected]
Message:

[CSS Shapes] Support block content with inline content around floats in shape-inside
https://bugs.webkit.org/show_bug.cgi?id=121616

Reviewed by David Hyatt.

In r156022 and r156364, I added support for floats inside shape-inside with inline content. This change extends
the existing implementation to support block content with inline content (paragraphs). I added an extra text for
positioning a float inside shape-inside without text content around it.

Source/WebCore:

Tests: fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content.html

fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content.html
fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle.html
fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content.html
fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content.html

  • rendering/FloatingObjects.h:

(WebCore::FloatingObject::logicalSize): Add new function to return the FloatingObject logical size.

  • rendering/LineWidth.cpp:

(WebCore::LineWidth::fitBelowFloats): When the lineBreaker code pushes down the content below the floating object,
we need to update the segments if we are in a shape-inside.

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::computeLogicalLocationForFloat): Do the positioning based on the float actual size, and use the
recent shapeInsideInfo. (Calling layoutShapeInsideInfo which deals with the layoutStates also instead of shapeInsideInfo.)

  • rendering/RenderBlock.h:
  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::adjustLogicalLineTopAndLogicalHeightIfNeeded): If we don't have inline content we still need to positionize
our float content in a shape-inside.
(WebCore::updateSegmentsForShapes): Use the right coordinates for block content with inline content.

LayoutTests:

  • fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content-expected.html: Added.
  • fast/shapes/shape-inside/shape-inside-left-float-in-lower-left-triangle-block-content.html: Added.
  • fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content-expected.html: Added.
  • fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-block-content.html: Added.
  • fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle-expected.html: Added.
  • fast/shapes/shape-inside/shape-inside-left-float-in-lower-right-triangle.html: Added.
  • fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content-expected.html: Added.
  • fast/shapes/shape-inside/shape-inside-left-float-in-upper-left-triangle-block-content.html: Added.
  • fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content-expected.html: Added.
  • fast/shapes/shape-inside/shape-inside-left-float-in-upper-right-triangle-block-content.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r156822 r156846  
    33663366#if ENABLE(CSS_SHAPES)
    33673367    // FIXME Bug 102948: This only works for shape outside directly set on this block.
    3368     ShapeInsideInfo* shapeInsideInfo = this->shapeInsideInfo();
     3368    ShapeInsideInfo* shapeInsideInfo = this->layoutShapeInsideInfo();
    33693369    // FIXME: Implement behavior for right floats.
    33703370    if (shapeInsideInfo) {
    3371         LayoutSize floatLogicalSize = LayoutSize(floatingObject->logicalWidth(isHorizontalWritingMode()), floatingObject->logicalHeight(isHorizontalWritingMode()));
     3371        LayoutSize floatLogicalSize = LayoutSize(childBox->logicalWidth(), childBox->logicalHeight());
    33723372        // FIXME: If the float doesn't fit in the shape we should push it under the content box
    33733373        logicalTopOffset = shapeInsideInfo->computeFirstFitPositionForFloat(floatLogicalSize);
Note: See TracChangeset for help on using the changeset viewer.