Changeset 112170 in webkit


Ignore:
Timestamp:
Mar 26, 2012 4:35:04 PM (12 years ago)
Author:
leviw@chromium.org
Message:

Update LayoutUnit usage in ContainerNode, Element, and ElementRareData
https://bugs.webkit.org/show_bug.cgi?id=82219

Reviewed by Eric Seidel.

No new tests. No change in behavior.

  • dom/ContainerNode.cpp:

(WebCore::ContainerNode::getLowerRightCorner): linesBoundingBox returns the enclosing IntRect
of the contained lines. Inline's aren't bounded in LayoutUnits nor pixel snapped.

  • dom/Element.cpp:

(WebCore::Element::boundsInRootViewSpace): Coordinates in root view space are akin to absolute
coordinates, which are always expressed in integers.

  • dom/Element.h:

(Element):

  • dom/ElementRareData.h:

(WebCore::defaultMinimumSizeForResizing): Using numeric_limits<LayoutUnit>::max instead of
INT_MAX to avoid overflowing when LayoutUnits are sub-pixel.

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112167 r112170  
     12012-03-26  Levi Weintraub  <leviw@chromium.org>
     2
     3        Update LayoutUnit usage in ContainerNode, Element, and ElementRareData
     4        https://bugs.webkit.org/show_bug.cgi?id=82219
     5
     6        Reviewed by Eric Seidel.
     7
     8        No new tests. No change in behavior.
     9
     10        * dom/ContainerNode.cpp:
     11        (WebCore::ContainerNode::getLowerRightCorner): linesBoundingBox returns the enclosing IntRect
     12        of the contained lines. Inline's aren't bounded in LayoutUnits nor pixel snapped.
     13        * dom/Element.cpp:
     14        (WebCore::Element::boundsInRootViewSpace): Coordinates in root view space are akin to absolute
     15        coordinates, which are always expressed in integers.
     16        * dom/Element.h:
     17        (Element):
     18        * dom/ElementRareData.h:
     19        (WebCore::defaultMinimumSizeForResizing): Using numeric_limits<LayoutUnit>::max instead of
     20        INT_MAX to avoid overflowing when LayoutUnits are sub-pixel.
     21
    1222012-03-26  Adam Klein  <adamk@chromium.org>
    223
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r112051 r112170  
    933933            if (o->isText()) {
    934934                RenderText* text = toRenderText(o);
    935                 LayoutRect linesBox = text->linesBoundingBox();
     935                IntRect linesBox = text->linesBoundingBox();
    936936                if (!linesBox.maxX() && !linesBox.maxY())
    937937                    continue;
  • trunk/Source/WebCore/dom/Element.cpp

    r112155 r112170  
    476476}
    477477
    478 LayoutRect Element::boundsInRootViewSpace()
     478IntRect Element::boundsInRootViewSpace()
    479479{
    480480    document()->updateLayoutIgnorePendingStylesheets();
     
    482482    FrameView* view = document()->view();
    483483    if (!view)
    484         return LayoutRect();
     484        return IntRect();
    485485
    486486    Vector<FloatQuad> quads;
     
    501501
    502502    if (quads.isEmpty())
    503         return LayoutRect();
    504 
    505     LayoutRect result = quads[0].enclosingBoundingBox();
     503        return IntRect();
     504
     505    IntRect result = quads[0].enclosingBoundingBox();
    506506    for (size_t i = 1; i < quads.size(); ++i)
    507507        result.unite(quads[i].enclosingBoundingBox());
  • trunk/Source/WebCore/dom/Element.h

    r111930 r112170  
    187187    virtual int scrollHeight();
    188188
    189     LayoutRect boundsInRootViewSpace();
     189    IntRect boundsInRootViewSpace();
    190190
    191191    PassRefPtr<ClientRectList> getClientRects();
  • trunk/Source/WebCore/dom/ElementRareData.h

    r110172 r112170  
    8282inline IntSize defaultMinimumSizeForResizing()
    8383{
    84     return IntSize(INT_MAX, INT_MAX);
     84    return IntSize(std::numeric_limits<LayoutUnit>::max(), std::numeric_limits<LayoutUnit>::max());
    8585}
    8686
Note: See TracChangeset for help on using the changeset viewer.