Skip to content
Permalink
Browse files
Subpixel layout: setSimpleLineLayoutEnabled() produces different layo…
…ut when line position has CSS px fractions.

https://bugs.webkit.org/show_bug.cgi?id=126892

Reviewed by Antti Koivisto.

SimpleLineLayout needs to copy normal linebox layout's subpixel rounding strategy to produce
the same layout.

Source/WebCore:

Covered by existing tests.

* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):

LayoutTests:

* platform/mac/TestExpectations: Unskipping some SimpleLineLayout tests.


Canonical link: https://commits.webkit.org/145271@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alanbujtas committed Jan 20, 2014
1 parent f15fcd9 commit 06a6c66ba7bc2054c5a8fc76f8b3d2824eb40343
Showing 15 changed files with 36 additions and 21 deletions.
@@ -1,3 +1,15 @@
2014-01-20 Zalan Bujtas <zalan@apple.com>

Subpixel layout: setSimpleLineLayoutEnabled() produces different layout when line position has CSS px fractions.
https://bugs.webkit.org/show_bug.cgi?id=126892

Reviewed by Antti Koivisto.

SimpleLineLayout needs to copy normal linebox layout's subpixel rounding strategy to produce
the same layout.

* platform/mac/TestExpectations: Unskipping some SimpleLineLayout tests.

2014-01-20 Michał Pakuła vel Rutka <m.pakula@samsung.com>

Unreviewed EFL gardening
@@ -1329,21 +1329,8 @@ webkit.org/b/117756 media/track/media-element-enqueue-event-crash.html [ Skip ]
webkit.org/b/126889 fast/forms/input-widths.html
webkit.org/b/126889 fast/forms/number/number-size.html

# Subpixel: simple line layout produces different layout
webkit.org/b/126892 fast/css/word-spacing-between-blocks.html
webkit.org/b/126892 fast/css/word-spacing-between-inlines.html
webkit.org/b/126892 fast/forms/textAreaLineHeight-simple-lines.html
webkit.org/b/126892 fast/regions/floats-basic-in-variable-width-regions.html
webkit.org/b/126892 fast/regions/overflow-moving-below-floats-in-variable-width-regions.html
webkit.org/b/126892 fast/regions/overflow-not-moving-below-floats-in-variable-width-regions.html
webkit.org/b/126892 fast/regions/overflow-size-change-in-variable-width-regions.html
webkit.org/b/126892 fast/regions/overflow-size-change-with-stacking-context.html
webkit.org/b/126892 fast/regions/selection/selecting-text-through-different-region-flows.html
webkit.org/b/126892 fast/shapes/shape-inside/shape-inside-circle-padding.html
webkit.org/b/126892 fast/shapes/shape-inside/shape-inside-circle.html
webkit.org/b/126892 fast/shapes/shape-inside/shape-inside-ellipse-padding.html
webkit.org/b/126892 fast/shapes/shape-inside/shape-inside-ellipse.html
webkit.org/b/126892 fast/shapes/shape-inside/shape-inside-rounded-rectangle-fit-002.html
# Subpixel: regions with different widths.
webkit.org/b/127212 fast/regions/overflow-moving-below-floats-in-variable-width-regions.html

# webkit.org/b/124784 needs revisiting.
webkit.org/b/124784 fast/shapes/shape-inside/shape-inside-subpixel-rectangle-top.html
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
Deleted file not rendered
@@ -1,3 +1,18 @@
2014-01-20 Zalan Bujtas <zalan@apple.com>

Subpixel layout: setSimpleLineLayoutEnabled() produces different layout when line position has CSS px fractions.
https://bugs.webkit.org/show_bug.cgi?id=126892

Reviewed by Antti Koivisto.

SimpleLineLayout needs to copy normal linebox layout's subpixel rounding strategy to produce
the same layout.

Covered by existing tests.

* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):

2014-01-20 Gurpreet Kaur <k.gurpreet@samsung.com>

Col width is not honored when dynamically updated and it would make table narrower
@@ -54,9 +54,9 @@ static void paintDebugBorders(GraphicsContext& context, const LayoutRect& border
GraphicsContextStateSaver stateSaver(context);
context.setStrokeColor(Color(0, 255, 0), ColorSpaceDeviceRGB);
context.setFillColor(Color::transparent, ColorSpaceDeviceRGB);
IntRect rect(pixelSnappedIntRect(borderRect));
rect.moveBy(flooredIntPoint(paintOffset));
context.drawRect(rect);
LayoutRect rect(borderRect);
rect.moveBy(paintOffset);
context.drawRect(pixelSnappedIntRect(rect));
}

void paintFlow(const RenderBlockFlow& flow, const Layout& layout, PaintInfo& paintInfo, const LayoutPoint& paintOffset)
@@ -80,9 +80,10 @@ void paintFlow(const RenderBlockFlow& flow, const Layout& layout, PaintInfo& pai
GraphicsContextStateSaver stateSaver(context, textPaintStyle.strokeWidth > 0);

updateGraphicsContext(context, textPaintStyle);
LayoutPoint adjustedPaintOffset = roundedIntPoint(paintOffset);

LayoutRect paintRect = paintInfo.rect;
paintRect.moveBy(-paintOffset);
paintRect.moveBy(-adjustedPaintOffset);

auto resolver = runResolver(flow, layout);
auto range = resolver.rangeForRect(paintRect);
@@ -92,9 +93,9 @@ void paintFlow(const RenderBlockFlow& flow, const Layout& layout, PaintInfo& pai
continue;
TextRun textRun(run.text());
textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize());
context.drawText(font, textRun, run.baseline() + paintOffset);
context.drawText(font, textRun, run.baseline() + adjustedPaintOffset);
if (debugBordersEnabled)
paintDebugBorders(context, run.rect(), paintOffset);
paintDebugBorders(context, run.rect(), adjustedPaintOffset);
}
}

0 comments on commit 06a6c66

Please sign in to comment.