Reviewed by Darin Adler.
- WebCore part of fixing <rdar://problem/
5111082> Flash popup video ad doesn't close when clicked at http://www.firestonecompleteautocare.com/
* manual-tests/nested-plug-ins.html: Added.
* manual-tests/resources/nested-plug-ins-inner-frame.html: Added.
* manual-tests/resources/nested-plug-ins-outer-frame.html: Added.
* platform/ScrollView.h:
* platform/Widget.h:
(WebCore::Widget::attachToWindow): Added. Tells the widget that it is connected
via visible ScrollViews to the root ScrollView of the WebView.
(WebCore::Widget::detachFromWindow): Added. Tells the widget that it is no longer
connected via visible ScrollViews to the root ScrollView of the WebView.
* platform/win/ScrollViewWin.cpp:
(WebCore::ScrollView::ScrollViewPrivate::ScrollViewPrivate): Added
m_visible and m_attachedToWindow members.
(WebCore::ScrollView::attachToWindow): Added. Attaches all children if this
view is visible.
(WebCore::ScrollView::detachFromWindow): Added. Detaches all children if this
view is visible (otherwise they would be detached already).
(WebCore::ScrollView::show): Added. Attaches all children if this view
is attached.
(WebCore::ScrollView::hide): Added. Detaches all children if this view
is attached (otherwise they would be detached already).
(WebCore::ScrollView::isAttachedToWindow): Added.
* platform/win/WidgetWin.cpp:
(WebCore::Widget::setParent): Added calls to attachToWindow() and detachFromWindow()
depending on whether the parent is set and attached or not.
* plugins/win/PluginViewWin.cpp:
(WebCore::PluginViewWin::setFocus):
(WebCore::PluginViewWin::show): Changed to show the plug-in only if
this view is attached.
(WebCore::PluginViewWin::hide): Changed to hide the plug-in only if this
view is attached (otherwise it would be hidden already).
(WebCore::PluginViewWin::attachToWindow): Added. Shows the plug-in if this view
is visible.
(WebCore::PluginViewWin::detachFromWindow): Added. Hides the plug-in if this view
is visible (otherwise it would be hidden already).
(WebCore::PluginViewWin::PluginViewWin):
* plugins/win/PluginViewWin.h: Added m_attachedToWindow member.
WebKit/win:
Reviewed by Darin Adler.
- WebKit/win part of fixing <rdar://problem/
5111082> Flash popup video ad doesn't close when clicked at http://www.firestonecompleteautocare.com/
* WebView.cpp:
(WebView::initWithFrame): Attach the main frame's view.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28442
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2007-12-05 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - WebCore part of fixing <rdar://problem/5111082> Flash popup video ad doesn't close when clicked at http://www.firestonecompleteautocare.com/
+
+ * manual-tests/nested-plug-ins.html: Added.
+ * manual-tests/resources/nested-plug-ins-inner-frame.html: Added.
+ * manual-tests/resources/nested-plug-ins-outer-frame.html: Added.
+ * platform/ScrollView.h:
+ * platform/Widget.h:
+ (WebCore::Widget::attachToWindow): Added. Tells the widget that it is connected
+ via visible ScrollViews to the root ScrollView of the WebView.
+ (WebCore::Widget::detachFromWindow): Added. Tells the widget that it is no longer
+ connected via visible ScrollViews to the root ScrollView of the WebView.
+ * platform/win/ScrollViewWin.cpp:
+ (WebCore::ScrollView::ScrollViewPrivate::ScrollViewPrivate): Added
+ m_visible and m_attachedToWindow members.
+ (WebCore::ScrollView::attachToWindow): Added. Attaches all children if this
+ view is visible.
+ (WebCore::ScrollView::detachFromWindow): Added. Detaches all children if this
+ view is visible (otherwise they would be detached already).
+ (WebCore::ScrollView::show): Added. Attaches all children if this view
+ is attached.
+ (WebCore::ScrollView::hide): Added. Detaches all children if this view
+ is attached (otherwise they would be detached already).
+ (WebCore::ScrollView::isAttachedToWindow): Added.
+ * platform/win/WidgetWin.cpp:
+ (WebCore::Widget::setParent): Added calls to attachToWindow() and detachFromWindow()
+ depending on whether the parent is set and attached or not.
+ * plugins/win/PluginViewWin.cpp:
+ (WebCore::PluginViewWin::setFocus):
+ (WebCore::PluginViewWin::show): Changed to show the plug-in only if
+ this view is attached.
+ (WebCore::PluginViewWin::hide): Changed to hide the plug-in only if this
+ view is attached (otherwise it would be hidden already).
+ (WebCore::PluginViewWin::attachToWindow): Added. Shows the plug-in if this view
+ is visible.
+ (WebCore::PluginViewWin::detachFromWindow): Added. Hides the plug-in if this view
+ is visible (otherwise it would be hidden already).
+ (WebCore::PluginViewWin::PluginViewWin):
+ * plugins/win/PluginViewWin.h: Added m_attachedToWindow member.
+
2007-12-04 Alp Toker <alp@atoker.com>
Potential GTK+ build fix for the glib-genmarshal issue.
--- /dev/null
+<script>
+ function toggleDisplay(element, button)
+ {
+ if (element.style.display == "none")
+ element.style.display = "";
+ else
+ element.style.display = "none";
+ }
+
+ function toggleVisibility(element, button)
+ {
+ if (element.style.visibility == "hidden")
+ element.style.visibility = "";
+ else
+ element.style.visibility = "hidden";
+ }
+
+</script>
+<p>
+ Play with the display and visibility toggles. Make sure that turning an inner element visible does not show it if it has a hidden or
+ non-displaying ancestor, and that making an ancestor visible and displaying shows only its descendants the are visible and displaying.
+</p>
+<table>
+ <tr>
+ <td>
+ <input type="checkbox" checked="true" onclick="toggleDisplay(document.getElementById('middle'))"> Outer frame display
+ </td>
+ <td>
+ <input type="checkbox" checked="true" onclick="toggleDisplay(document.getElementById('middle').contentDocument.getElementById('inner'))"> Inner frame display
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <input type="checkbox" checked="true" onclick="toggleVisibility(document.getElementById('middle'))"> Outer frame visibility
+ </td>
+ <td>
+ <input type="checkbox" checked="true" onclick="toggleVisibility(document.getElementById('middle').contentDocument.getElementById('inner'))"> Inner frame visibility
+ </td>
+ <td>
+ <input type="checkbox" checked="true" onclick="toggleVisibility(document.getElementById('middle').contentDocument.getElementById('inner').contentDocument.getElementById('plugin'))"> Inner plug-in visibility
+ </td>
+ </tr>
+</table>
+
+<iframe id="middle" style="height: 400px; width: 400px;" src="resources/nested-plug-ins-outer-frame.html"></iframe>
--- /dev/null
+<embed id="plugin" width='100' height='100' src='spinbox.swf' wmode='window'>
--- /dev/null
+<embed id="plugin" width='100' height='100' src='spinbox.swf' wmode='window'>
+<br>
+<iframe style="height: 200px; width: 200px;" id='inner' src='nested-plug-ins-inner-frame.html'></iframe>
virtual void setParent(ScrollView*);
+ virtual void attachToWindow();
+ virtual void detachFromWindow();
+ bool isAttachedToWindow() const;
+
+ virtual void show();
+ virtual void hide();
+
void addToDirtyRegion(const IntRect&);
void scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect);
void updateBackingStore();
virtual void setParent(ScrollView*);
ScrollView* parent() const;
+ virtual void attachToWindow() { }
+ virtual void detachFromWindow() { }
+
virtual void geometryChanged() const {};
IntRect convertToContainingWindow(const IntRect&) const;
, m_scrollbarsAvoidingResizer(0)
, m_vScrollbarMode(ScrollbarAuto)
, m_hScrollbarMode(ScrollbarAuto)
+ , m_visible(false)
+ , m_attachedToWindow(false)
{
}
RefPtr<PlatformScrollbar> m_hBar;
HRGN m_dirtyRegion;
HashSet<Widget*> m_children;
+ bool m_visible;
+ bool m_attachedToWindow;
};
void ScrollView::ScrollViewPrivate::setHasHorizontalScrollbar(bool hasBar)
Widget::setParent(parentView);
}
+void ScrollView::attachToWindow()
+{
+ if (m_data->m_attachedToWindow)
+ return;
+
+ m_data->m_attachedToWindow = true;
+
+ if (m_data->m_visible) {
+ HashSet<Widget*>::iterator end = m_data->m_children.end();
+ for (HashSet<Widget*>::iterator it = m_data->m_children.begin(); it != end; ++it)
+ (*it)->attachToWindow();
+ }
+}
+
+void ScrollView::detachFromWindow()
+{
+ if (!m_data->m_attachedToWindow)
+ return;
+
+ if (m_data->m_visible) {
+ HashSet<Widget*>::iterator end = m_data->m_children.end();
+ for (HashSet<Widget*>::iterator it = m_data->m_children.begin(); it != end; ++it)
+ (*it)->detachFromWindow();
+ }
+
+ m_data->m_attachedToWindow = false;
+}
+
+void ScrollView::show()
+{
+ if (!m_data->m_visible) {
+ m_data->m_visible = true;
+ if (isAttachedToWindow()) {
+ HashSet<Widget*>::iterator end = m_data->m_children.end();
+ for (HashSet<Widget*>::iterator it = m_data->m_children.begin(); it != end; ++it)
+ (*it)->attachToWindow();
+ }
+ }
+
+ Widget::show();
+}
+
+void ScrollView::hide()
+{
+ if (m_data->m_visible) {
+ if (isAttachedToWindow()) {
+ HashSet<Widget*>::iterator end = m_data->m_children.end();
+ for (HashSet<Widget*>::iterator it = m_data->m_children.begin(); it != end; ++it)
+ (*it)->detachFromWindow();
+ }
+ m_data->m_visible = false;
+ }
+
+ Widget::hide();
+}
+
+bool ScrollView::isAttachedToWindow() const
+{
+ return m_data->m_attachedToWindow;
+}
+
void ScrollView::addToDirtyRegion(const IntRect& containingWindowRect)
{
ASSERT(isFrameView());
void Widget::setParent(ScrollView* v)
{
+ if (!v || !v->isAttachedToWindow())
+ detachFromWindow();
data->parent = v;
+ if (v && v->isAttachedToWindow())
+ attachToWindow();
}
ScrollView* Widget::parent() const
void PluginViewWin::setFocus()
{
- if (HWND window = m_window)
- SetFocus(window);
+ if (m_window)
+ SetFocus(m_window);
Widget::setFocus();
}
{
m_isVisible = true;
- if (HWND window = m_window)
- ShowWindow(window, SW_SHOWNA);
+ if (m_attachedToWindow && m_window)
+ ShowWindow(m_window, SW_SHOWNA);
Widget::show();
}
{
m_isVisible = false;
- if (HWND window = m_window)
- ShowWindow(window, SW_HIDE);
+ if (m_attachedToWindow && m_window)
+ ShowWindow(m_window, SW_HIDE);
Widget::hide();
}
}
+void PluginViewWin::attachToWindow()
+{
+ if (m_attachedToWindow)
+ return;
+
+ m_attachedToWindow = true;
+ if (m_isVisible && m_window)
+ ShowWindow(m_window, SW_SHOWNA);
+}
+
+void PluginViewWin::detachFromWindow()
+{
+ if (!m_attachedToWindow)
+ return;
+
+ if (m_isVisible && m_window)
+ ShowWindow(m_window, SW_HIDE);
+ m_attachedToWindow = false;
+}
+
void PluginViewWin::setNPWindowRect(const IntRect& rect)
{
if (!m_isStarted)
, m_isWindowed(true)
, m_isTransparent(false)
, m_isVisible(false)
+ , m_attachedToWindow(false)
, m_haveInitialized(false)
, m_lastMessage(0)
, m_isCallingPluginWndProc(false)
virtual void handleEvent(Event*);
virtual void setParent(ScrollView*);
+ virtual void attachToWindow();
+ virtual void detachFromWindow();
+
LRESULT wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
WNDPROC pluginWndProc() const { return m_pluginWndProc; }
bool m_isWindowed;
bool m_isTransparent;
bool m_isVisible;
+ bool m_attachedToWindow;
bool m_haveInitialized;
WNDPROC m_pluginWndProc;
+2007-12-05 Dan Bernstein <mitz@apple.com>
+
+ Reviewed by Darin Adler.
+
+ - WebKit/win part of fixing <rdar://problem/5111082> Flash popup video ad doesn't close when clicked at http://www.firestonecompleteautocare.com/
+
+ * WebView.cpp:
+ (WebView::initWithFrame): Attach the main frame's view.
+
2007-12-04 Ada Chan <adachan@apple.com>
Provide API for setting the default storage quota per database origin
webFrame->initWithWebFrameView(0 /*FIXME*/, this, m_page, 0);
m_mainFrame = webFrame;
webFrame->Release(); // The WebFrame is owned by the Frame, so release our reference to it.
+ m_page->mainFrame()->view()->attachToWindow();
m_page->mainFrame()->view()->resize(frame.right - frame.left, frame.bottom - frame.top);
m_page->mainFrame()->tree()->setName(String(frameName, SysStringLen(frameName)));