Changeset 92059 in webkit


Ignore:
Timestamp:
Jul 30, 2011 4:51:31 PM (13 years ago)
Author:
enrica@apple.com
Message:

REGRESSION: culledInlineAbsoluteRects needs to translate a 0,0 point to absolute
coordinates so that the top left position is accurate.
https://bugs.webkit.org/show_bug.cgi?id=65419
<rdar://problem/9408862>

Source/WebCore:

This patch fixes a regression introduced in r83075.
Make sure that culledInlineAbsoluteRects still does
a translation of a 0,0 point to absolute coordinates so that the top left position is
accurate.
This code path could not be tested via JavaScript. The patch
extends the Internals object to be able to test this case.

Reviewed by Dan Bernstein.

Test: fast/inline/skipped-whitespace-boundingBox.html

  • WebCore.exp.in: Added some exports.
  • rendering/RenderInline.cpp:

(WebCore::RenderInline::culledInlineAbsoluteRects):

  • testing/Internals.cpp:

(WebCore::Internals::boundingBox):

  • testing/Internals.h:
  • testing/Internals.idl:

LayoutTests:

Reviewed by Dan Bernstein.

  • fast/inline/skipped-whitespace-boundingBox-expected.txt: Added.
  • fast/inline/skipped-whitespace-boundingBox.html: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r92051 r92059  
     12011-07-30  Enrica Casucci  <enrica@apple.com>
     2
     3        REGRESSION: culledInlineAbsoluteRects needs to translate a 0,0 point to absolute
     4        coordinates so that the top left position is accurate.
     5        https://bugs.webkit.org/show_bug.cgi?id=65419
     6        <rdar://problem/9408862>
     7
     8        Reviewed by Dan Bernstein.
     9
     10        * fast/inline/skipped-whitespace-boundingBox-expected.txt: Added.
     11        * fast/inline/skipped-whitespace-boundingBox.html: Added.
     12
    1132011-07-26  Pavel Podivilov  <podivilov@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r92051 r92059  
     12011-07-30  Enrica Casucci  <enrica@apple.com>
     2
     3        REGRESSION: culledInlineAbsoluteRects needs to translate a 0,0 point to absolute
     4        coordinates so that the top left position is accurate.
     5        https://bugs.webkit.org/show_bug.cgi?id=65419
     6        <rdar://problem/9408862>
     7
     8        This patch fixes a regression introduced in r83075.
     9        Make sure that culledInlineAbsoluteRects still does
     10        a translation of a 0,0 point to absolute coordinates so that the top left position is
     11        accurate.
     12        This code path could not be tested via JavaScript. The patch
     13        extends the Internals object to be able to test this case.
     14
     15        Reviewed by Dan Bernstein.
     16
     17        Test: fast/inline/skipped-whitespace-boundingBox.html
     18
     19        * WebCore.exp.in: Added some exports.
     20        * rendering/RenderInline.cpp:
     21        (WebCore::RenderInline::culledInlineAbsoluteRects):
     22        * testing/Internals.cpp:
     23        (WebCore::Internals::boundingBox):
     24        * testing/Internals.h:
     25        * testing/Internals.idl:
     26
    1272011-07-26  Pavel Podivilov  <podivilov@chromium.org>
    228
  • trunk/Source/WebCore/WebCore.exp.in

    r92014 r92059  
    153153__ZN7WebCore10setCookiesEPNS_8DocumentERKNS_4KURLERKN3WTF6StringE
    154154__ZN7WebCore10toDocumentEN3JSC7JSValueE
     155__ZN7WebCore10ClientRectC1Ev
     156__ZN7WebCore10ClientRectC1ERKNS_7IntRectE
     157__ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_10ClientRectE
    155158__ZN7WebCore11BitmapImageC1EP7CGImagePNS_13ImageObserverE
    156159__ZN7WebCore11CachedFrame23cachedFramePlatformDataEv
     
    281284__ZN7WebCore12PrintContextD1Ev
    282285__ZN7WebCore12RenderObject16repaintRectangleERKNS_7IntRectEb
     286__ZN7WebCore12RenderObject23absoluteBoundingBoxRectEb
    283287__ZN7WebCore12RenderWidget19showSubstituteImageEN3WTF10PassRefPtrINS_5ImageEEE
    284288__ZN7WebCore12RenderWidget28resumeWidgetHierarchyUpdatesEv
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r91907 r92059  
    487487void RenderInline::culledInlineAbsoluteRects(const RenderInline* container, Vector<IntRect>& rects, const IntSize& offset)
    488488{
     489    if (!culledInlineFirstLineBox()) {
     490        rects.append(IntRect(offset.width(), offset.height(), 0, 0));
     491        return;
     492    }
     493
    489494    bool isHorizontal = style()->isHorizontalWritingMode();
    490495    for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling()) {
  • trunk/Source/WebCore/testing/Internals.cpp

    r91235 r92059  
    2828
    2929#include "CachedResourceLoader.h"
     30#include "ClientRect.h"
    3031#include "Document.h"
    3132#include "Element.h"
     
    3435#include "NodeRenderingContext.h"
    3536#include "Page.h"
     37#include "RenderObject.h"
    3638#include "RenderTreeAsText.h"
    3739#include "ShadowContentElement.h"
     
    148150#endif
    149151
     152PassRefPtr<ClientRect> Internals::boundingBox(Element* element, ExceptionCode& ec)
     153{
     154    if (!element) {
     155        ec = INVALID_ACCESS_ERR;
     156        return ClientRect::create();
     157    }
     158
     159    element->document()->updateLayoutIgnorePendingStylesheets();
     160    RenderObject* renderer = element->renderer();
     161    if (!renderer)
     162        return ClientRect::create();
     163    return ClientRect::create(renderer->absoluteBoundingBoxRect());
    150164}
     165
     166}
  • trunk/Source/WebCore/testing/Internals.h

    r91235 r92059  
    3535namespace WebCore {
    3636
     37class ClientRect;
    3738class Document;
    3839class Element;
     
    6162#endif
    6263
     64    PassRefPtr<ClientRect> boundingBox(Element*, ExceptionCode&);
     65
    6366private:
    6467    Internals();
  • trunk/Source/WebCore/testing/Internals.idl

    r91235 r92059  
    3939
    4040        void setInspectorResourcesDataSizeLimits(in Document document, in long maximumResourcesContentSize, in long maximumSingleResourceContentSize) raises(DOMException);
     41
     42        ClientRect boundingBox(in Element element) raises(DOMException);
    4143    };
    4244}
Note: See TracChangeset for help on using the changeset viewer.