Changeset 112758 in webkit


Ignore:
Timestamp:
Mar 30, 2012 5:57:47 PM (12 years ago)
Author:
eae@chromium.org
Message:

Change WebKit/WebKit2 platform code to use pixel snapped values
https://bugs.webkit.org/show_bug.cgi?id=82549

Source/WebCore:

Reviewed by Eric Seidel.

Change WebKit and WebKit2 platform code to use rounded locations and
pixel snapped rects and sizes. This largely avoids having to expose the
fractional layout types to the platform code.

No new tests. No change in functionality.

  • dom/Node.h:

(WebCore::Node::pixelSnappedRenderRect):
Add pixel snapped version of renderRect

  • rendering/RenderBox.h:

(WebCore::RenderBox::pixelSnappedFrameRect):
Add pixel snapped version of frameRect

Source/WebKit/chromium:

Reviewed by Eric Seidel.

  • src/WebAccessibilityObject.cpp:

(WebKit::WebAccessibilityObject::boundingBoxRect):
Use pixelSnappedBoundingBoxRect instead of boundingBoxRect which returns
a LayoutRect.

  • src/WebFrameImpl.cpp:

(WebKit::WebFrameImpl::characterIndexForPoint):
Use roundedPoint instead of point for hit testing as ranges use screen
cordinates which are represented with pixel accuracy.

Source/WebKit/mac:

Change WebKit and WebKit2 platform code to use rounded locations and
pixel snapped rects and sizes. This largely avoids having to expose the
fractional layout types to the platform code.

Reviewed by Eric Seidel.

  • DOM/WebDOMOperations.mm:

(-[DOMNode _renderRect:]):

Source/WebKit/qt:

Reviewed by Eric Seidel.

  • Api/qwebelement.cpp:

(QWebElement::geometry):
Replace getRect with getPixelSnappedRect to avoid having to expose
subpixel types to the platform layer.

  • Api/qwebpage.cpp:

(QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch):
Use pixel snapped element rect when comparing with the touch rect as the
touch rect use screen cordinates which are represented with pixel
accuracy.

  • WebCoreSupport/ChromeClientQt.h:

(WebCore::ChromeClientQt::scrollRectIntoView):
Change scrollRectIntoView to take a LayoutRect to match base class
interface.

Source/WebKit2:

Change WebKit and WebKit2 platform code to use rounded locations and
pixel snapped rects and sizes. This largely avoids having to expose the
fractional layout types to the platform code.

Reviewed by Eric Seidel.

  • Shared/WebRenderObject.cpp:

(WebKit::WebRenderObject::WebRenderObject):

  • UIProcess/win/WebPopupMenuProxyWin.cpp:

(WebKit::WebPopupMenuProxyWin::calculatePositionAndSize):

  • WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:

(WebKit::InjectedBundleNodeHandle::renderRect):

  • WebProcess/Plugins/PDF/BuiltInPDFView.cpp:

(WebKit::BuiltInPDFView::invalidateScrollbarRect):

  • WebProcess/WebPage/mac/WebPageMac.mm:

(WebKit::WebPage::characterIndexForPoint):

Location:
trunk/Source
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112757 r112758  
     12012-03-30  Emil A Eklund  <eae@chromium.org>
     2
     3        Change WebKit/WebKit2 platform code to use pixel snapped values
     4        https://bugs.webkit.org/show_bug.cgi?id=82549
     5
     6        Reviewed by Eric Seidel.
     7
     8        Change WebKit and WebKit2 platform code to use rounded locations and
     9        pixel snapped rects and sizes. This largely avoids having to expose the
     10        fractional layout types to the platform code.
     11
     12        No new tests. No change in functionality.
     13
     14        * dom/Node.h:
     15        (WebCore::Node::pixelSnappedRenderRect):
     16        Add pixel snapped version of renderRect
     17       
     18        * rendering/RenderBox.h:
     19        (WebCore::RenderBox::pixelSnappedFrameRect):
     20        Add pixel snapped version of frameRect
     21
    1222012-03-30  Simon Fraser  <simon.fraser@apple.com>
    223
  • trunk/Source/WebCore/dom/Node.h

    r112424 r112758  
    380380    IntRect getPixelSnappedRect() const { return pixelSnappedIntRect(getRect()); }
    381381    LayoutRect renderRect(bool* isReplaced);
     382    IntRect pixelSnappedRenderRect(bool* isReplaced) { return pixelSnappedIntRect(renderRect(isReplaced)); }
    382383
    383384    // Returns true if the node has a non-empty bounding box in layout.
  • trunk/Source/WebCore/rendering/RenderBox.h

    r112756 r112758  
    131131
    132132    LayoutRect frameRect() const { return m_frameRect; }
     133    IntRect pixelSnappedFrameRect() const { return pixelSnappedIntRect(m_frameRect); }
    133134    void setFrameRect(const LayoutRect& rect) { m_frameRect = rect; }
    134135
  • trunk/Source/WebKit/chromium/ChangeLog

    r112754 r112758  
     12012-03-30  Emil A Eklund  <eae@chromium.org>
     2
     3        Change WebKit/WebKit2 platform code to use pixel snapped values
     4        https://bugs.webkit.org/show_bug.cgi?id=82549
     5
     6        Reviewed by Eric Seidel.
     7
     8        * src/WebAccessibilityObject.cpp:
     9        (WebKit::WebAccessibilityObject::boundingBoxRect):
     10        Use pixelSnappedBoundingBoxRect instead of boundingBoxRect which returns
     11        a LayoutRect.
     12       
     13        * src/WebFrameImpl.cpp:
     14        (WebKit::WebFrameImpl::characterIndexForPoint):
     15        Use roundedPoint instead of point for hit testing as ranges use screen
     16        cordinates which are represented with pixel accuracy.
     17
    1182012-03-30  Adam Barth  <abarth@webkit.org>
    219
  • trunk/Source/WebKit/chromium/src/WebAccessibilityObject.cpp

    r105295 r112758  
    494494
    495495    m_private->updateBackingStore();
    496     return m_private->boundingBoxRect();
     496    return m_private->pixelSnappedBoundingBoxRect();
    497497}
    498498
  • trunk/Source/WebKit/chromium/src/WebFrameImpl.cpp

    r112690 r112758  
    11911191    IntPoint point = frame()->view()->windowToContents(webPoint);
    11921192    HitTestResult result = frame()->eventHandler()->hitTestResultAtPoint(point, false);
    1193     RefPtr<Range> range = frame()->rangeForPoint(result.point());
     1193    RefPtr<Range> range = frame()->rangeForPoint(result.roundedPoint());
    11941194    if (!range)
    11951195        return notFound;
  • trunk/Source/WebKit/mac/ChangeLog

    r112720 r112758  
     12012-03-30  Emil A Eklund  <eae@chromium.org>
     2
     3        Change WebKit/WebKit2 platform code to use pixel snapped values
     4        https://bugs.webkit.org/show_bug.cgi?id=82549
     5
     6        Change WebKit and WebKit2 platform code to use rounded locations and
     7        pixel snapped rects and sizes. This largely avoids having to expose the
     8        fractional layout types to the platform code.
     9
     10        Reviewed by Eric Seidel.
     11
     12        * DOM/WebDOMOperations.mm:
     13        (-[DOMNode _renderRect:]):
     14
    1152012-03-30  Mark Pilgrim  <pilgrim@chromium.org>
    216
  • trunk/Source/WebKit/mac/DOM/WebDOMOperations.mm

    r108850 r112758  
    132132- (NSRect)_renderRect:(bool *)isReplaced
    133133{
    134     return NSRect(core(self)->renderRect(isReplaced));
     134    return NSRect(core(self)->pixelSnappedRenderRect(isReplaced));
    135135}
    136136
  • trunk/Source/WebKit/qt/Api/qwebelement.cpp

    r111268 r112758  
    553553    if (!m_element)
    554554        return QRect();
    555     return m_element->getRect();
     555    return m_element->getPixelSnappedRect();
    556556}
    557557
  • trunk/Source/WebKit/qt/Api/qwebpage.cpp

    r112720 r112758  
    15881588            continue;
    15891589
    1590         IntRect currentElementBoundingRect = currentElement->getRect();
     1590        IntRect currentElementBoundingRect = currentElement->getPixelSnappedRect();
    15911591        currentElementBoundingRect.intersect(touchRect);
    15921592
  • trunk/Source/WebKit/qt/ChangeLog

    r112720 r112758  
     12012-03-30  Emil A Eklund  <eae@chromium.org>
     2
     3        Change WebKit/WebKit2 platform code to use pixel snapped values
     4        https://bugs.webkit.org/show_bug.cgi?id=82549
     5
     6        Reviewed by Eric Seidel.
     7
     8        * Api/qwebelement.cpp:
     9        (QWebElement::geometry):
     10        Replace getRect with getPixelSnappedRect to avoid having to expose
     11        subpixel types to the platform layer.
     12       
     13        * Api/qwebpage.cpp:
     14        (QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch):
     15        Use pixel snapped element rect when comparing with the touch rect as the
     16        touch rect use screen cordinates which are represented with pixel
     17        accuracy.
     18       
     19        * WebCoreSupport/ChromeClientQt.h:
     20        (WebCore::ChromeClientQt::scrollRectIntoView):
     21        Change scrollRectIntoView to take a LayoutRect to match base class
     22        interface.
     23
    1242012-03-30  Mark Pilgrim  <pilgrim@chromium.org>
    225
  • trunk/Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h

    r110595 r112758  
    172172    virtual void setCursorHiddenUntilMouseMoves(bool) { }
    173173
    174     virtual void scrollRectIntoView(const IntRect&) const { }
     174    virtual void scrollRectIntoView(const LayoutRect) const { }
    175175
    176176    virtual bool selectItemWritingDirectionIsNatural();
  • trunk/Source/WebKit2/ChangeLog

    r112722 r112758  
     12012-03-30  Emil A Eklund  <eae@chromium.org>
     2
     3        Change WebKit/WebKit2 platform code to use pixel snapped values
     4        https://bugs.webkit.org/show_bug.cgi?id=82549
     5
     6        Change WebKit and WebKit2 platform code to use rounded locations and
     7        pixel snapped rects and sizes. This largely avoids having to expose the
     8        fractional layout types to the platform code.
     9
     10        Reviewed by Eric Seidel.
     11
     12        * Shared/WebRenderObject.cpp:
     13        (WebKit::WebRenderObject::WebRenderObject):
     14        * UIProcess/win/WebPopupMenuProxyWin.cpp:
     15        (WebKit::WebPopupMenuProxyWin::calculatePositionAndSize):
     16        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
     17        (WebKit::InjectedBundleNodeHandle::renderRect):
     18        * WebProcess/Plugins/PDF/BuiltInPDFView.cpp:
     19        (WebKit::BuiltInPDFView::invalidateScrollbarRect):
     20        * WebProcess/WebPage/mac/WebPageMac.mm:
     21        (WebKit::WebPage::characterIndexForPoint):
     22
    1232012-03-30  Anders Carlsson  <andersca@apple.com>
    224
  • trunk/Source/WebKit2/Shared/WebRenderObject.cpp

    r110085 r112758  
    6262
    6363    if (renderer->isBox())
    64         m_frameRect = toRenderBox(renderer)->frameRect();
     64        m_frameRect = toRenderBox(renderer)->pixelSnappedFrameRect();
    6565    else if (renderer->isText()) {
    6666        m_frameRect = toRenderText(renderer)->linesBoundingBox();
  • trunk/Source/WebKit2/UIProcess/win/WebPopupMenuProxyWin.cpp

    r107577 r112758  
    402402    monitorInfo.cbSize = sizeof(MONITORINFOEX);
    403403    ::GetMonitorInfo(monitor, &monitorInfo);
    404     FloatRect screen = monitorInfo.rcWork;
     404    FloatRect screen = static_cast<IntRect>(monitorInfo.rcWork);
    405405
    406406    // Check that we don't go off the screen vertically
  • trunk/Source/WebKit2/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp

    r112555 r112758  
    115115IntRect InjectedBundleNodeHandle::renderRect(bool* isReplaced) const
    116116{
    117     return m_node.get()->renderRect(isReplaced);
     117    return m_node.get()->pixelSnappedRenderRect(isReplaced);
    118118}
    119119
  • trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.cpp

    r112338 r112758  
    711711}
    712712
    713 void BuiltInPDFView::invalidateScrollbarRect(Scrollbar* scrollbar, const LayoutRect& rect)
     713void BuiltInPDFView::invalidateScrollbarRect(Scrollbar* scrollbar, const IntRect& rect)
    714714{
    715715    IntRect dirtyRect = rect;
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

    r112338 r112758  
    359359    frame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController()->focusedOrMainFrame();
    360360   
    361     RefPtr<Range> range = frame->rangeForPoint(result.point());
     361    RefPtr<Range> range = frame->rangeForPoint(result.roundedPoint());
    362362    if (!range)
    363363        return;
Note: See TracChangeset for help on using the changeset viewer.