Changeset 162340 in webkit


Ignore:
Timestamp:
Jan 20, 2014 7:42:13 AM (10 years ago)
Author:
Alan Bujtas
Message:

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.

Source/WebCore:

Covered by existing tests.

  • rendering/SimpleLineLayoutFunctions.cpp:

(WebCore::SimpleLineLayout::paintFlow):

LayoutTests:

  • platform/mac/TestExpectations: Unskipping some SimpleLineLayout tests.
Location:
trunk
Files:
11 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r162338 r162340  
     12014-01-20  Zalan Bujtas  <zalan@apple.com>
     2
     3        Subpixel layout: setSimpleLineLayoutEnabled() produces different layout when line position has CSS px fractions.
     4        https://bugs.webkit.org/show_bug.cgi?id=126892
     5
     6        Reviewed by Antti Koivisto.
     7
     8        SimpleLineLayout needs to copy normal linebox layout's subpixel rounding strategy to produce
     9        the same layout.
     10
     11        * platform/mac/TestExpectations: Unskipping some SimpleLineLayout tests.
     12
    1132014-01-20  Michał Pakuła vel Rutka  <m.pakula@samsung.com>
    214
  • trunk/LayoutTests/platform/mac/TestExpectations

    r162273 r162340  
    13301330webkit.org/b/126889 fast/forms/number/number-size.html
    13311331
    1332 # Subpixel: simple line layout produces different layout
    1333 webkit.org/b/126892 fast/css/word-spacing-between-blocks.html
    1334 webkit.org/b/126892 fast/css/word-spacing-between-inlines.html
    1335 webkit.org/b/126892 fast/forms/textAreaLineHeight-simple-lines.html
    1336 webkit.org/b/126892 fast/regions/floats-basic-in-variable-width-regions.html
    1337 webkit.org/b/126892 fast/regions/overflow-moving-below-floats-in-variable-width-regions.html
    1338 webkit.org/b/126892 fast/regions/overflow-not-moving-below-floats-in-variable-width-regions.html
    1339 webkit.org/b/126892 fast/regions/overflow-size-change-in-variable-width-regions.html
    1340 webkit.org/b/126892 fast/regions/overflow-size-change-with-stacking-context.html
    1341 webkit.org/b/126892 fast/regions/selection/selecting-text-through-different-region-flows.html
    1342 webkit.org/b/126892 fast/shapes/shape-inside/shape-inside-circle-padding.html
    1343 webkit.org/b/126892 fast/shapes/shape-inside/shape-inside-circle.html
    1344 webkit.org/b/126892 fast/shapes/shape-inside/shape-inside-ellipse-padding.html
    1345 webkit.org/b/126892 fast/shapes/shape-inside/shape-inside-ellipse.html
    1346 webkit.org/b/126892 fast/shapes/shape-inside/shape-inside-rounded-rectangle-fit-002.html
     1332# Subpixel: regions with different widths.
     1333webkit.org/b/127212 fast/regions/overflow-moving-below-floats-in-variable-width-regions.html
    13471334
    13481335# webkit.org/b/124784 needs revisiting.
  • trunk/Source/WebCore/ChangeLog

    r162334 r162340  
     12014-01-20  Zalan Bujtas  <zalan@apple.com>
     2
     3        Subpixel layout: setSimpleLineLayoutEnabled() produces different layout when line position has CSS px fractions.
     4        https://bugs.webkit.org/show_bug.cgi?id=126892
     5
     6        Reviewed by Antti Koivisto.
     7
     8        SimpleLineLayout needs to copy normal linebox layout's subpixel rounding strategy to produce
     9        the same layout.
     10
     11        Covered by existing tests.
     12
     13        * rendering/SimpleLineLayoutFunctions.cpp:
     14        (WebCore::SimpleLineLayout::paintFlow):
     15
    1162014-01-20  Gurpreet Kaur  <k.gurpreet@samsung.com>
    217
  • trunk/Source/WebCore/rendering/SimpleLineLayoutFunctions.cpp

    r159560 r162340  
    5555    context.setStrokeColor(Color(0, 255, 0), ColorSpaceDeviceRGB);
    5656    context.setFillColor(Color::transparent, ColorSpaceDeviceRGB);
    57     IntRect rect(pixelSnappedIntRect(borderRect));
    58     rect.moveBy(flooredIntPoint(paintOffset));
    59     context.drawRect(rect);
     57    LayoutRect rect(borderRect);
     58    rect.moveBy(paintOffset);
     59    context.drawRect(pixelSnappedIntRect(rect));
    6060}
    6161
     
    8181
    8282    updateGraphicsContext(context, textPaintStyle);
     83    LayoutPoint adjustedPaintOffset = roundedIntPoint(paintOffset);
    8384
    8485    LayoutRect paintRect = paintInfo.rect;
    85     paintRect.moveBy(-paintOffset);
     86    paintRect.moveBy(-adjustedPaintOffset);
    8687
    8788    auto resolver = runResolver(flow, layout);
     
    9394        TextRun textRun(run.text());
    9495        textRun.setTabSize(!style.collapseWhiteSpace(), style.tabSize());
    95         context.drawText(font, textRun, run.baseline() + paintOffset);
     96        context.drawText(font, textRun, run.baseline() + adjustedPaintOffset);
    9697        if (debugBordersEnabled)
    97             paintDebugBorders(context, run.rect(), paintOffset);
     98            paintDebugBorders(context, run.rect(), adjustedPaintOffset);
    9899    }
    99100}
Note: See TracChangeset for help on using the changeset viewer.