Changeset 115689 in webkit


Ignore:
Timestamp:
Apr 30, 2012 4:42:05 PM (12 years ago)
Author:
leviw@chromium.org
Message:

Update LayoutUnit usage in InlineFlowBox and RenderWidget
https://bugs.webkit.org/show_bug.cgi?id=85239

Reviewed by Eric Seidel.

Updating LayoutUnit usage in a pair of remaining functions to minimize the remaining work to switching
to FractionalLayoutUnits for layout instead of integers.

No new tests. No change in behavior.

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::placeBoxesInBlockDirection): Though stored as a float, the top is always
set to an integer value. When we move to sub-pixel, we need to preserve this. Not preserving this
behavior affects text decorations, most notably underlines.

  • rendering/RenderWidget.cpp:

(WebCore::RenderWidget::updateWidgetGeometry): Adding pixel snapping for the content box if it's
not transformed (absoluteContentBox includes pixel snapping), and properly treating the boundingBox
as an IntRect.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r115687 r115689  
     12012-04-30  Levi Weintraub  <leviw@chromium.org>
     2
     3        Update LayoutUnit usage in InlineFlowBox and RenderWidget
     4        https://bugs.webkit.org/show_bug.cgi?id=85239
     5
     6        Reviewed by Eric Seidel.
     7
     8        Updating LayoutUnit usage in a pair of remaining functions to minimize the remaining work to switching
     9        to FractionalLayoutUnits for layout instead of integers.
     10
     11        No new tests. No change in behavior.
     12
     13        * rendering/InlineFlowBox.cpp:
     14        (WebCore::InlineFlowBox::placeBoxesInBlockDirection): Though stored as a float, the top is always
     15        set to an integer value. When we move to sub-pixel, we need to preserve this. Not preserving this
     16        behavior affects text decorations, most notably underlines.
     17        * rendering/RenderWidget.cpp:
     18        (WebCore::RenderWidget::updateWidgetGeometry): Adding pixel snapping for the content box if it's
     19        not transformed (absoluteContentBox includes pixel snapping), and properly treating the boundingBox
     20        as an IntRect.
     21
    1222012-04-30  Levi Weintraub  <leviw@chromium.org>
    223
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r114433 r115689  
    595595    if (isRootBox) {
    596596        const FontMetrics& fontMetrics = renderer()->style(isFirstLineStyle())->fontMetrics();
    597         setLogicalTop(top + maxAscent - fontMetrics.ascent(baselineType));
     597        // RootInlineBoxes are always placed on at pixel boundaries in their logical y direction. Not doing
     598        // so results in incorrect rendering of text decorations, most notably underlines.
     599        setLogicalTop(roundToInt(top + maxAscent - fontMetrics.ascent(baselineType)));
    598600    }
    599601
  • trunk/Source/WebCore/rendering/RenderWidget.cpp

    r112301 r115689  
    177177bool RenderWidget::updateWidgetGeometry()
    178178{
    179     LayoutRect contentBox = contentBoxRect();
     179    IntRect contentBox = pixelSnappedIntRect(contentBoxRect());
    180180    if (!m_widget->transformsAffectFrameRect())
    181181        return setWidgetGeometry(absoluteContentBox());
    182182
    183     LayoutRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox)).boundingBox());
     183    IntRect absoluteContentBox(localToAbsoluteQuad(FloatQuad(contentBox)).boundingBox());
    184184    if (m_widget->isFrameView()) {
    185185        contentBox.setLocation(absoluteContentBox.location());
Note: See TracChangeset for help on using the changeset viewer.