Bug 123033 - [CSS Shapes] Match adjustLogicalLineTopAndLogicalHeightIfNeeded's implementation with Blink's
Summary: [CSS Shapes] Match adjustLogicalLineTopAndLogicalHeightIfNeeded's implementat...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Zoltan Horvath
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-18 11:47 PDT by Zoltan Horvath
Modified: 2013-10-22 15:05 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.42 KB, patch)
2013-10-18 11:50 PDT, Zoltan Horvath
no flags Details | Formatted Diff | Diff
Patch (2.31 KB, patch)
2013-10-18 13:21 PDT, Zoltan Horvath
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zoltan Horvath 2013-10-18 11:47:37 PDT
In blink I made this function in a bit different way. This change modifies it to be identical, which helps a lot in the future cross-merging patches.
Comment 1 Zoltan Horvath 2013-10-18 11:50:24 PDT
Created attachment 214591 [details]
Patch
Comment 2 Darin Adler 2013-10-18 12:03:32 PDT
Comment on attachment 214591 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=214591&action=review

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:1472
> -    if (shapeInsideInfo && !wordMeasurements.size() && containsFloats()) {
> -        lastFloatFromPreviousLine = m_floatingObjects->set().last().get();
> -        LayoutUnit floatLogicalTopOffset = shapeInsideInfo->computeFirstFitPositionForFloat(logicalSizeForFloat(lastFloatFromPreviousLine));
> -        if (logicalHeight() < floatLogicalTopOffset)
> -            adjustedLogicalLineTop = floatLogicalTopOffset;
> +    if (shapeInsideInfo) {
> +        lastFloatFromPreviousLine = (containsFloats()) ? m_floatingObjects->set().last().get() : 0;
> +        if (!wordMeasurements.size() && lastFloatFromPreviousLine) {
> +            LayoutUnit floatLogicalTopOffset = shapeInsideInfo->computeFirstFitPositionForFloat(logicalSizeForFloat(lastFloatFromPreviousLine));
> +            if (logicalHeight() < floatLogicalTopOffset)
> +                adjustedLogicalLineTop = floatLogicalTopOffset;
> +        }
>      }

I like the old version better than the new version. The use of ? : and 0 is not as nice as regular if statement. Could you merge in the other direction instead?
Comment 3 Zoltan Horvath 2013-10-18 13:21:35 PDT
Created attachment 214597 [details]
Patch
Comment 4 Zoltan Horvath 2013-10-18 13:24:26 PDT
(In reply to comment #2)
> (From update of attachment 214591 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=214591&action=review
> 
> > Source/WebCore/rendering/RenderBlockLineLayout.cpp:1472
> > -    if (shapeInsideInfo && !wordMeasurements.size() && containsFloats()) {
> > -        lastFloatFromPreviousLine = m_floatingObjects->set().last().get();
> > -        LayoutUnit floatLogicalTopOffset = shapeInsideInfo->computeFirstFitPositionForFloat(logicalSizeForFloat(lastFloatFromPreviousLine));
> > -        if (logicalHeight() < floatLogicalTopOffset)
> > -            adjustedLogicalLineTop = floatLogicalTopOffset;
> > +    if (shapeInsideInfo) {
> > +        lastFloatFromPreviousLine = (containsFloats()) ? m_floatingObjects->set().last().get() : 0;
> > +        if (!wordMeasurements.size() && lastFloatFromPreviousLine) {
> > +            LayoutUnit floatLogicalTopOffset = shapeInsideInfo->computeFirstFitPositionForFloat(logicalSizeForFloat(lastFloatFromPreviousLine));
> > +            if (logicalHeight() < floatLogicalTopOffset)
> > +                adjustedLogicalLineTop = floatLogicalTopOffset;
> > +        }
> >      }
> 
> I like the old version better than the new version. The use of ? : and 0 is not as nice as regular if statement. Could you merge in the other direction instead?

I updated the patch. What do you think about the new version?
I'm working on the refactoring of the RenderBlockLineLayout's nextSegmentBreak method, and because of that change I need to update the lastFloatFromPreviousLine variable in the shapeInsideInfo case. That's the reason because I want to do the merge this direction. This one looks better now, I think.
Comment 5 Zoltan Horvath 2013-10-18 14:24:41 PDT
(In reply to comment #4)
> I'm working on the refactoring of the RenderBlockLineLayout's nextSegmentBreak method, and because of that change I need to update the lastFloatFromPreviousLine variable in the shapeInsideInfo case. That's the reason because I want to do the merge this direction. This one looks better now, I think.
patch preview on bug #123038
Comment 6 Dave Hyatt 2013-10-22 14:21:06 PDT
Comment on attachment 214597 [details]
Patch

r=me
Comment 7 Zoltan Horvath 2013-10-22 15:05:52 PDT
Committed r157820: <http://trac.webkit.org/changeset/157820>