Changeset 55381 in webkit


Ignore:
Timestamp:
Mar 1, 2010 2:51:25 PM (14 years ago)
Author:
eric@webkit.org
Message:

2010-03-01 Thatcher Ulrich <tulrich@google.com>

Reviewed by Darin Fisher.

Fix chromium iframe shims. Add another test case to the
iframes-shims test. After r53637, the plugin widget doesn't get
moved every paint. This used to hide the bug that if an iframe
gets added, the plugin's cutout rectangles don't get updated until
a layout happens.
https://bugs.webkit.org/show_bug.cgi?id=35184

  • plugins/iframe-shims.html: test case that adds an iframe shim dynamically

2010-03-01 Thatcher Ulrich <tulrich@google.com>

Reviewed by Darin Fisher.

Fix chromium iframe shims. Add another test case to the
iframes-shims test. After r53637, the plugin widget doesn't get
moved every paint. This used to hide the bug that if an iframe
gets added, the plugin's cutout rectangles don't get updated until
a layout happens.
https://bugs.webkit.org/show_bug.cgi?id=35184

  • platform/Widget.h: (WebCore::Widget::widgetPositionsUpdated): new virtual method

widgetPositionsUpdated() to notify widgets when other widgets on
the page have been repositioned.

  • rendering/RenderView.cpp: (WebCore::RenderView::updateWidgetPositions): call widgetPositionsUpdated() on the widgets
  • rendering/RenderWidget.cpp: (WebCore::RenderWidget::widgetPositionsUpdated): call widgetPositionsUpdated() on the widget
  • rendering/RenderWidget.h:

2010-03-01 Thatcher Ulrich <tulrich@google.com>

Reviewed by Darin Fisher.

Fix chromium iframe shims. Add another test case to the
iframes-shims test. After r53637, the plugin widget doesn't get
moved every paint. This used to hide the bug that if an iframe
gets added, the plugin's cutout rectangles don't get updated until
a layout happens.
https://bugs.webkit.org/show_bug.cgi?id=35184

  • src/WebPluginContainerImpl.cpp: (WebKit::WebPluginContainerImpl::widgetPositionsUpdated): do reportGeometry() to ensure that

the plugin is aware of the positions of cutouts on the page (for iframe shim behavior).

  • src/WebPluginContainerImpl.h:
Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r55379 r55381  
     12010-03-01  Thatcher Ulrich  <tulrich@google.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Fix chromium iframe shims.  Add another test case to the
     6        iframes-shims test.  After r53637, the plugin widget doesn't get
     7        moved every paint.  This used to hide the bug that if an iframe
     8        gets added, the plugin's cutout rectangles don't get updated until
     9        a layout happens.
     10        https://bugs.webkit.org/show_bug.cgi?id=35184
     11
     12        * plugins/iframe-shims.html: test case that adds an iframe shim dynamically
     13
    1142010-03-01  Gavin Barraclough  <barraclough@apple.com>
    215
  • trunk/LayoutTests/plugins/iframe-shims-expected.txt

    r48638 r55381  
    2121
    2222
     23
     24
  • trunk/LayoutTests/plugins/iframe-shims.html

    r48638 r55381  
    4949        return o;
    5050    }
     51   
     52    function appendOverlay(overlayDivZIframe, overlayDivZOverlay, overlayInsideDiv, expectClickable, caseId)
     53    {
     54        var id = makeIframeDiv();
     55        var root = document.getElementById(caseId);
     56        if (overlayDivZIframe)
     57            id.style.zIndex = overlayDivZIframe;
     58
     59        var od = makeOverlayDiv(expectClickable ? 'green' : 'red', caseId);
     60        od.style.position = 'absolute';
     61        if (overlayDivZOverlay)
     62            od.style.zIndex = overlayDivZOverlay;
     63
     64        if (overlayInsideDiv) {
     65            var parentdiv = document.createElement('div');
     66            if (overlayDivZOverlay)
     67                parentdiv.style.zIndex = overlayDivZOverlay;
     68
     69            parentdiv.style.position = 'absolute';
     70            parentdiv.style.top = '0px';
     71            parentdiv.style.left = '0px';
     72            parentdiv.appendChild(id);
     73            parentdiv.appendChild(od);
     74            root.appendChild(parentdiv);
     75        } else {
     76            root.appendChild(id);
     77            root.appendChild(od);
     78        }
     79    };
    5180
    5281    function addCase(x, y, tags)
     
    6392        root.style.left = x * (width + 40) + 'px';
    6493        root.style.top = y * (height + 20) + 'px';
     94        root.id = caseId;
    6595        container.appendChild(root);
    6696
     
    103133        };
    104134
    105         var appendOverlay = function()
    106         {
    107             var id = makeIframeDiv();
    108             if (overlayDivZIframe)
    109                 id.style.zIndex = overlayDivZIframe;
    110 
    111             var od = makeOverlayDiv(expectClickable ? 'green' : 'red', caseId);
    112             od.style.position = 'absolute';
    113             if (overlayDivZOverlay)
    114                 od.style.zIndex = overlayDivZOverlay;
    115 
    116             if (tags.overlayInsideDiv) {
    117                 var parentdiv = document.createElement('div');
    118                 if (overlayDivZOverlay)
    119                     parentdiv.style.zIndex = overlayDivZOverlay;
    120 
    121                 parentdiv.style.position = 'absolute';
    122                 parentdiv.style.top = '0px';
    123                 parentdiv.style.left = '0px';
    124                 parentdiv.appendChild(id);
    125                 parentdiv.appendChild(od);
    126                 root.appendChild(parentdiv);
    127             } else {
    128                 root.appendChild(id);
    129                 root.appendChild(od);
    130             }
    131         };
    132 
    133135        if (tags.overlayEarlier) {
    134             appendOverlay();
     136            appendOverlay(overlayDivZIframe, overlayDivZOverlay, tags.overlayInsideDiv, expectClickable, caseId);
    135137            appendPlugin();
    136138        } else {
    137139            appendPlugin();
    138             appendOverlay();
     140            if (tags.overlayOnTimeout) {
     141                setTimeout('appendOverlay('+overlayDivZIframe+', '+overlayDivZOverlay +', ' + tags.overlayInsideDiv + ', ' + expectClickable + ', ' + caseId + ')', 0);
     142            } else {
     143                appendOverlay(overlayDivZIframe, overlayDivZOverlay, tags.overlayInsideDiv, expectClickable, caseId);
     144            }
    139145        }
    140146     }
     
    178184        addCase(1, 3, {'overlayEarlier':1, 'pluginNorelative':1, 'pluginInsideDiv':1, expect:'overlay OVER'});
    179185        addCase(2, 3, {'pluginNorelative':1, 'pluginInsideDiv':1, expect:'overlay OVER'});
     186        addCase(3, 3, {'pluginLowerz':1, 'overlayOnTimeout':1, expect:'overlay OVER'});
    180187
    181188        runTest();
  • trunk/WebCore/ChangeLog

    r55377 r55381  
     12010-03-01  Thatcher Ulrich  <tulrich@google.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Fix chromium iframe shims.  Add another test case to the
     6        iframes-shims test.  After r53637, the plugin widget doesn't get
     7        moved every paint.  This used to hide the bug that if an iframe
     8        gets added, the plugin's cutout rectangles don't get updated until
     9        a layout happens.
     10        https://bugs.webkit.org/show_bug.cgi?id=35184
     11
     12        * platform/Widget.h:
     13        (WebCore::Widget::widgetPositionsUpdated): new virtual method
     14            widgetPositionsUpdated() to notify widgets when other widgets on
     15            the page have been repositioned.
     16        * rendering/RenderView.cpp:
     17        (WebCore::RenderView::updateWidgetPositions): call widgetPositionsUpdated() on the widgets
     18        * rendering/RenderWidget.cpp:
     19        (WebCore::RenderWidget::widgetPositionsUpdated): call widgetPositionsUpdated() on the widget
     20        * rendering/RenderWidget.h:
     21
    1222010-03-01  Fridrich Strba  <fridrich.strba@bluewin.ch>
    223
  • trunk/WebCore/platform/Widget.h

    r52885 r55381  
    187187    virtual void frameRectsChanged() {}
    188188
     189    // Notifies this widget that other widgets on the page have been repositioned.
     190    virtual void widgetPositionsUpdated() {}
     191
    189192#if PLATFORM(MAC)
    190193    NSView* getOuterView() const;
  • trunk/WebCore/rendering/RenderView.cpp

    r52757 r55381  
    542542    for (RenderWidgetSet::iterator it = m_widgets.begin(); it != end; ++it)
    543543        (*it)->updateWidgetPosition();
     544    for (RenderWidgetSet::iterator it = m_widgets.begin(); it != end; ++it)
     545        (*it)->widgetPositionsUpdated();
    544546}
    545547
  • trunk/WebCore/rendering/RenderWidget.cpp

    r53637 r55381  
    326326}
    327327
     328void RenderWidget::widgetPositionsUpdated()
     329{
     330    if (!m_widget)
     331        return;
     332    m_widget->widgetPositionsUpdated();
     333}
     334
    328335void RenderWidget::setSelectionState(SelectionState state)
    329336{
  • trunk/WebCore/rendering/RenderWidget.h

    r50470 r55381  
    4040
    4141    void updateWidgetPosition();
     42    void widgetPositionsUpdated();
    4243
    4344    void showSubstituteImage(PassRefPtr<Image>);
  • trunk/WebKit/chromium/ChangeLog

    r55364 r55381  
     12010-03-01  Thatcher Ulrich  <tulrich@google.com>
     2
     3        Reviewed by Darin Fisher.
     4
     5        Fix chromium iframe shims.  Add another test case to the
     6        iframes-shims test.  After r53637, the plugin widget doesn't get
     7        moved every paint.  This used to hide the bug that if an iframe
     8        gets added, the plugin's cutout rectangles don't get updated until
     9        a layout happens.
     10        https://bugs.webkit.org/show_bug.cgi?id=35184
     11
     12        * src/WebPluginContainerImpl.cpp:
     13        (WebKit::WebPluginContainerImpl::widgetPositionsUpdated): do reportGeometry() to ensure that
     14            the plugin is aware of the positions of cutouts on the page (for iframe shim behavior).
     15        * src/WebPluginContainerImpl.h:
     16
    1172010-02-27  Pavel Feldman  <pfeldman@chromium.org>
    218
  • trunk/WebKit/chromium/src/WebPluginContainerImpl.cpp

    r52791 r55381  
    171171}
    172172
     173void WebPluginContainerImpl::widgetPositionsUpdated()
     174{
     175    Widget::widgetPositionsUpdated();
     176    reportGeometry();
     177}
     178
    173179void WebPluginContainerImpl::setParentVisible(bool parentVisible)
    174180{
  • trunk/WebKit/chromium/src/WebPluginContainerImpl.h

    r50722 r55381  
    7474    virtual void setParentVisible(bool);
    7575    virtual void setParent(WebCore::ScrollView*);
     76    virtual void widgetPositionsUpdated();
    7677
    7778    // WebPluginContainer methods
Note: See TracChangeset for help on using the changeset viewer.