Skip to content
Permalink
Browse files
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:

Canonical link: https://commits.webkit.org/46682@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@55381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eseidel committed Mar 1, 2010
1 parent e4e3cec commit a9f5abdf5910c3540c81f6c2a3233aeeb4840831
Showing 11 changed files with 109 additions and 30 deletions.
@@ -1,3 +1,16 @@
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 Gavin Barraclough <barraclough@apple.com>

Reviewed by Oliver Hunt.
@@ -20,3 +20,5 @@ SUCCESS





@@ -48,6 +48,35 @@
');" value="clickme" style="position: absolute; top: 10; left: 10; width: 60px; height: 60px;"/>';
return o;
}

function appendOverlay(overlayDivZIframe, overlayDivZOverlay, overlayInsideDiv, expectClickable, caseId)
{
var id = makeIframeDiv();
var root = document.getElementById(caseId);
if (overlayDivZIframe)
id.style.zIndex = overlayDivZIframe;

var od = makeOverlayDiv(expectClickable ? 'green' : 'red', caseId);
od.style.position = 'absolute';
if (overlayDivZOverlay)
od.style.zIndex = overlayDivZOverlay;

if (overlayInsideDiv) {
var parentdiv = document.createElement('div');
if (overlayDivZOverlay)
parentdiv.style.zIndex = overlayDivZOverlay;

parentdiv.style.position = 'absolute';
parentdiv.style.top = '0px';
parentdiv.style.left = '0px';
parentdiv.appendChild(id);
parentdiv.appendChild(od);
root.appendChild(parentdiv);
} else {
root.appendChild(id);
root.appendChild(od);
}
};

function addCase(x, y, tags)
{
@@ -62,6 +91,7 @@
root.style.position = 'absolute';
root.style.left = x * (width + 40) + 'px';
root.style.top = y * (height + 20) + 'px';
root.id = caseId;
container.appendChild(root);

var pluginDivZ;
@@ -102,40 +132,16 @@
}
};

var appendOverlay = function()
{
var id = makeIframeDiv();
if (overlayDivZIframe)
id.style.zIndex = overlayDivZIframe;

var od = makeOverlayDiv(expectClickable ? 'green' : 'red', caseId);
od.style.position = 'absolute';
if (overlayDivZOverlay)
od.style.zIndex = overlayDivZOverlay;

if (tags.overlayInsideDiv) {
var parentdiv = document.createElement('div');
if (overlayDivZOverlay)
parentdiv.style.zIndex = overlayDivZOverlay;

parentdiv.style.position = 'absolute';
parentdiv.style.top = '0px';
parentdiv.style.left = '0px';
parentdiv.appendChild(id);
parentdiv.appendChild(od);
root.appendChild(parentdiv);
} else {
root.appendChild(id);
root.appendChild(od);
}
};

if (tags.overlayEarlier) {
appendOverlay();
appendOverlay(overlayDivZIframe, overlayDivZOverlay, tags.overlayInsideDiv, expectClickable, caseId);
appendPlugin();
} else {
appendPlugin();
appendOverlay();
if (tags.overlayOnTimeout) {
setTimeout('appendOverlay('+overlayDivZIframe+', '+overlayDivZOverlay +', ' + tags.overlayInsideDiv + ', ' + expectClickable + ', ' + caseId + ')', 0);
} else {
appendOverlay(overlayDivZIframe, overlayDivZOverlay, tags.overlayInsideDiv, expectClickable, caseId);
}
}
}

@@ -177,6 +183,7 @@
addCase(0, 3, {'pluginNorelative':1, expect:'overlay OVER'});
addCase(1, 3, {'overlayEarlier':1, 'pluginNorelative':1, 'pluginInsideDiv':1, expect:'overlay OVER'});
addCase(2, 3, {'pluginNorelative':1, 'pluginInsideDiv':1, expect:'overlay OVER'});
addCase(3, 3, {'pluginLowerz':1, 'overlayOnTimeout':1, expect:'overlay OVER'});

runTest();
}
@@ -1,3 +1,24 @@
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 Fridrich Strba <fridrich.strba@bluewin.ch>

Reviewed by Holger Freyther.
@@ -186,6 +186,9 @@ class Widget : public RefCounted<Widget> {

virtual void frameRectsChanged() {}

// Notifies this widget that other widgets on the page have been repositioned.
virtual void widgetPositionsUpdated() {}

#if PLATFORM(MAC)
NSView* getOuterView() const;

@@ -541,6 +541,8 @@ void RenderView::updateWidgetPositions()
RenderWidgetSet::iterator end = m_widgets.end();
for (RenderWidgetSet::iterator it = m_widgets.begin(); it != end; ++it)
(*it)->updateWidgetPosition();
for (RenderWidgetSet::iterator it = m_widgets.begin(); it != end; ++it)
(*it)->widgetPositionsUpdated();
}

void RenderView::addWidget(RenderWidget* o)
@@ -325,6 +325,13 @@ void RenderWidget::updateWidgetPosition()
}
}

void RenderWidget::widgetPositionsUpdated()
{
if (!m_widget)
return;
m_widget->widgetPositionsUpdated();
}

void RenderWidget::setSelectionState(SelectionState state)
{
if (selectionState() != state) {
@@ -39,6 +39,7 @@ class RenderWidget : public RenderReplaced, private OverlapTestRequestClient {
static RenderWidget* find(const Widget*);

void updateWidgetPosition();
void widgetPositionsUpdated();

void showSubstituteImage(PassRefPtr<Image>);

@@ -1,3 +1,19 @@
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:

2010-02-27 Pavel Feldman <pfeldman@chromium.org>

Reviewed by Timothy Hatcher.
@@ -170,6 +170,12 @@ void WebPluginContainerImpl::frameRectsChanged()
reportGeometry();
}

void WebPluginContainerImpl::widgetPositionsUpdated()
{
Widget::widgetPositionsUpdated();
reportGeometry();
}

void WebPluginContainerImpl::setParentVisible(bool parentVisible)
{
// We override this function to make sure that geometry updates are sent
@@ -73,6 +73,7 @@ class WebPluginContainerImpl : public WebCore::Widget, public WebPluginContainer
virtual void frameRectsChanged();
virtual void setParentVisible(bool);
virtual void setParent(WebCore::ScrollView*);
virtual void widgetPositionsUpdated();

// WebPluginContainer methods
virtual void invalidate();

0 comments on commit a9f5abd

Please sign in to comment.