WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-80242-20120314162028.patch (text/plain), 10.78 KB, created by
Allan Sandfeld Jensen
on 2012-03-14 08:20:30 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Allan Sandfeld Jensen
Created:
2012-03-14 08:20:30 PDT
Size:
10.78 KB
patch
obsolete
>Subversion Revision: 110663 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 085dbbf115fa7058e26777ed36a02aeb9e5bca2a..5da872ffb7205bdc99b29e1a1dbd9b31efa31858 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2012-03-14 Allan Sandfeld Jensen <allan.jensen@nokia.com> >+ >+ REGRESSION(r106232): The resize handler is always called after loading. >+ https://bugs.webkit.org/show_bug.cgi?id=80242 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Instead of using the layout size to judge if a resize events should be emitted, >+ use the logical frame size which includes any scrollbars. >+ >+ Test: fast/events/resize-events.html >+ >+ * WebCore.exp.in: >+ * page/FrameView.cpp: >+ (WebCore::FrameView::reset): >+ (WebCore::FrameView::layout): >+ (WebCore::FrameView::performPostLayoutTasks): >+ * page/FrameView.h: >+ * platform/ScrollView.cpp: >+ (WebCore::ScrollView::logicalFrameRect): >+ * platform/ScrollView.h: >+ > 2012-03-13 Luke Macpherson <macpherson@chromium.org> > > Move opacity clamping into RenderStyle setter. >diff --git a/Source/WebCore/WebCore.exp.in b/Source/WebCore/WebCore.exp.in >index 82e0ee38ddcd3ae644c2d5f5299ed0b335bfc1da..91555717fb3b33a901966665f469d3d731955335 100644 >--- a/Source/WebCore/WebCore.exp.in >+++ b/Source/WebCore/WebCore.exp.in >@@ -1176,6 +1176,7 @@ __ZNK7WebCore10ScrollView14useFixedLayoutEv > __ZNK7WebCore10ScrollView15fixedLayoutSizeEv > __ZNK7WebCore10ScrollView16contentsToWindowERKNS_7IntRectE > __ZNK7WebCore10ScrollView16contentsToWindowERKNS_8IntPointE >+__ZNK7WebCore10ScrollView16logicalFrameRectEv > __ZNK7WebCore10ScrollView16windowToContentsERKNS_7IntRectE > __ZNK7WebCore10ScrollView16windowToContentsERKNS_8IntPointE > __ZNK7WebCore10ScrollView18contentsToRootViewERKNS_7IntRectE >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index 5ecbca36361c5d9b8c8c47eea14af625df0362ac..6ac1481ca731c79774d3fea608f9941c371f534d 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -227,7 +227,7 @@ void FrameView::reset() > m_firstLayout = true; > m_firstLayoutCallbackPending = false; > m_wasScrolledByUser = false; >- m_lastLayoutSize = LayoutSize(); >+ m_lastViewSize = IntSize(); > m_lastZoomFactor = 1.0f; > m_deferringRepaints = 0; > m_repaintCount = 0; >@@ -1019,7 +1019,7 @@ void FrameView::layout(bool allowSubtree) > > m_firstLayout = false; > m_firstLayoutCallbackPending = true; >- m_lastLayoutSize = LayoutSize(layoutWidth(), layoutHeight()); >+ m_lastViewSize = logicalFrameRect().size(); > m_lastZoomFactor = root->style()->zoom(); > > // Set the initial vMode to AlwaysOn if we're auto. >@@ -2306,10 +2306,11 @@ void FrameView::performPostLayoutTasks() > m_actionScheduler->resume(); > > if (!root->printing()) { >- LayoutSize currentSize = LayoutSize(layoutWidth(), layoutHeight()); >+ // DOM Level 2 Events: The resize event occurs when a document view is resized. >+ IntSize currentSize = logicalFrameRect().size(); > float currentZoomFactor = root->style()->zoom(); >- bool resized = !m_firstLayout && (currentSize != m_lastLayoutSize || currentZoomFactor != m_lastZoomFactor); >- m_lastLayoutSize = currentSize; >+ bool resized = !m_firstLayout && (currentSize != m_lastViewSize || currentZoomFactor != m_lastZoomFactor); >+ m_lastViewSize = currentSize; > m_lastZoomFactor = currentZoomFactor; > if (resized) { > m_frame->eventHandler()->sendResizeEvent(); >diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h >index 1f90bc3b80a60389815a80913531ccbd0b570446..26af2a38e33422872f45813f63ada88edb964799 100644 >--- a/Source/WebCore/page/FrameView.h >+++ b/Source/WebCore/page/FrameView.h >@@ -444,7 +444,7 @@ private: > bool m_firstLayout; > bool m_isTransparent; > Color m_baseBackgroundColor; >- LayoutSize m_lastLayoutSize; >+ IntSize m_lastViewSize; > float m_lastZoomFactor; > > String m_mediaType; >diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp >index 6af2aa69604fae68713c39e70d6ab184614f8497..6ab176fa76ad1d685cff0048ae8fd4a47886e14c 100644 >--- a/Source/WebCore/platform/ScrollView.cpp >+++ b/Source/WebCore/platform/ScrollView.cpp >@@ -252,6 +252,11 @@ IntRect ScrollView::visibleContentRect(bool includeScrollbars) const > } > #endif > >+IntRect ScrollView::logicalFrameRect() const >+{ >+ return m_fixedLayoutSize.isEmpty() || !m_useFixedLayout ? frameRect() : IntRect(IntPoint(0,0), m_fixedLayoutSize); >+} >+ > int ScrollView::layoutWidth() const > { > return m_fixedLayoutSize.isEmpty() || !m_useFixedLayout ? visibleWidth() : m_fixedLayoutSize.width(); >diff --git a/Source/WebCore/platform/ScrollView.h b/Source/WebCore/platform/ScrollView.h >index 4c1b5de5cd6096a1e795cf2c822c24e7ccaa35c5..979ae51e5ebcb8264d10346dc9d8038302802ffc 100644 >--- a/Source/WebCore/platform/ScrollView.h >+++ b/Source/WebCore/platform/ScrollView.h >@@ -156,6 +156,10 @@ public: > void setFixedLayoutSize(const IntSize&); > bool useFixedLayout() const; > void setUseFixedLayout(bool enable); >+ >+ // Logical frame rect is by default the same as the Widget::frameRect, but if fixedLayoutSize it used, it is instead >+ // the rect of a virtual frame around the fixed layout area. >+ IntRect logicalFrameRect() const; > > // Functions for getting/setting the size of the document contained inside the ScrollView (as an IntSize or as individual width and height > // values). >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b4365e487c987d35be60247e9ed7eae1aad74c36..60c3b25c0eb8b9bac0871138ee518eb7fd7f5e93 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2012-03-14 Allan Sandfeld Jensen <allan.jensen@nokia.com> >+ >+ REGRESSION(r106232): The resize handler is always called after loading. >+ https://bugs.webkit.org/show_bug.cgi?id=80242 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Tests that no resize events are emitted during page creation, >+ even if the page overflows and adds a scrollbar. >+ >+ * fast/events/resize-events-expected.txt: Added. >+ * fast/events/resize-events.html: Added. >+ > 2012-03-13 Hajime Morrita <morrita@chromium.org> > > Unreviewed, marking some tests flaky. >diff --git a/LayoutTests/fast/events/resize-events-expected.txt b/LayoutTests/fast/events/resize-events-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..faef11cc97e39d132be7c74b4f28e519172ae03e >--- /dev/null >+++ b/LayoutTests/fast/events/resize-events-expected.txt >@@ -0,0 +1,33 @@ >+layer at (0,0) size 784x4260 >+ RenderView at (0,0) size 784x600 >+layer at (0,0) size 784x4260 >+ RenderBlock {HTML} at (0,0) size 784x4260 >+ RenderBody {BODY} at (8,8) size 768x4242 >+ RenderBlock {DIV} at (0,0) size 768x116 >+ RenderBlock (anonymous) at (0,0) size 768x42 >+ RenderText {#text} at (0,0) size 746x42 >+ text run at (0,0) width 652: "Test how many resize events are emitted during page load and dynamic content generation. " >+ text run at (652,0) width 94: "Do not resize" >+ text run at (0,21) width 218: "the page. It invalidates the test." >+ RenderBlock {P} at (0,58) size 768x58 >+ RenderBlock (anonymous) at (0,0) size 768x21 >+ RenderText {#text} at (10,0) size 206x21 >+ text run at (10,0) width 206: "Resize events (should be 0): " >+ RenderInline {SPAN} at (0,0) size 9x21 >+ RenderText {#text} at (216,0) size 9x21 >+ text run at (216,0) width 9: "0" >+ RenderText {#text} at (0,0) size 0x0 >+ RenderBlock {P} at (0,37) size 768x21 [color=#008000] >+ RenderText {#text} at (10,0) size 44x21 >+ text run at (10,0) width 44: "PASS" >+ RenderBlock {DIV} at (0,132) size 768x4110 >+ RenderBlock {DIV} at (10,0) size 748x402 [border: (1px solid #000000)] >+ RenderBlock {DIV} at (10,412) size 748x402 [border: (1px solid #000000)] >+ RenderBlock {DIV} at (10,824) size 748x402 [border: (1px solid #000000)] >+ RenderBlock {DIV} at (10,1236) size 748x402 [border: (1px solid #000000)] >+ RenderBlock {DIV} at (10,1648) size 748x402 [border: (1px solid #000000)] >+ RenderBlock {DIV} at (10,2060) size 748x402 [border: (1px solid #000000)] >+ RenderBlock {DIV} at (10,2472) size 748x402 [border: (1px solid #000000)] >+ RenderBlock {DIV} at (10,2884) size 748x402 [border: (1px solid #000000)] >+ RenderBlock {DIV} at (10,3296) size 748x402 [border: (1px solid #000000)] >+ RenderBlock {DIV} at (10,3708) size 748x402 [border: (1px solid #000000)] >diff --git a/LayoutTests/fast/events/resize-events.html b/LayoutTests/fast/events/resize-events.html >new file mode 100644 >index 0000000000000000000000000000000000000000..fbf5c2e04cf5c6100073281e07f5ebdbb5ebf3fe >--- /dev/null >+++ b/LayoutTests/fast/events/resize-events.html >@@ -0,0 +1,54 @@ >+<html> >+<head> >+ <style> >+ div.block { height: 400px; border: 1px solid black; margin:10px; } >+ </style> >+ <script> >+ var resizecount = 0; >+ var loaded = false; >+ window.onresize = function() { >+ resizecount++; >+ document.getElementById('count1').innerHTML = resizecount; >+ } >+ </script> >+</head> >+<body> >+ <div> >+ Test how many resize events are emitted during page load and dynamic content generation. >+ >+ Do not resize the page. It invalidates the test. >+ <p style="text-indent: 10px" id=result1> >+ Resize events (should be 0): <span id=count1>0</span> >+ </div> >+ <div id=expandingblock> >+ </div> >+ <script> >+ if (window.layoutTestController) { >+ layoutTestController.waitUntilDone(); >+ } >+ >+ var blockcount = 0; >+ function addBlock() { >+ var el = document.createElement('div'); >+ el.setAttribute('class','block'); >+ document.getElementById('expandingblock').appendChild(el); >+ if (++blockcount < 10) >+ setTimeout(addBlock, 20); >+ else >+ finish(); >+ } >+ function finish() { >+ var result; >+ // No resize events are acceptable. >+ if (resizecount < 1) >+ result = '<p style="color: green">PASS'; >+ else >+ result = '<p style="color: red">FAIL'; >+ var resultElement = document.getElementById('result1') >+ resultElement.innerHTML += result; >+ if (window.layoutTestController) >+ layoutTestController.notifyDone(); >+ } >+ onload = addBlock; >+ </script> >+</body> >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 80242
:
130059
|
130363
|
130598
|
130617
|
130618
|
130800
|
130802
|
131854
|
132015
|
132025