https://bugs.webkit.org/show_bug.cgi?id=75903
Patch by Luiz Agostini <luiz.agostini@palm.com> on 2012-04-16
Reviewed by Antti Koivisto.
Source/WebCore:
Test: fast/media/media-query-list-08.html
Viewport related MediaQueryList listeners were not triggered and the value
of matches were not updated if the document's style selector were not
affected by viewport changes.
The new method evaluateMediaQueries() is now called by FrameView instead of
styleSelectorChanged() if the style selector is not affected by viewport changes.
* dom/Document.cpp:
(WebCore::Document::evaluateMediaQueries):
(WebCore):
(WebCore::Document::styleSelectorChanged):
* dom/Document.h:
(Document):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
LayoutTests:
Testing MediaQueryLists listeners related to viewport changes.
* fast/media/media-query-list-08-expected.txt: Added.
* fast/media/media-query-list-08.html: Added.
Skipping the new test in Qt due to an issue in its DumpRenderTree.
* platform/qt/Skipped:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114285
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-04-16 Luiz Agostini <luiz.agostini@palm.com>
+
+ matchMedia() MediaQueryList not updating
+ https://bugs.webkit.org/show_bug.cgi?id=75903
+
+ Reviewed by Antti Koivisto.
+
+ Testing MediaQueryLists listeners related to viewport changes.
+
+ * fast/media/media-query-list-08-expected.txt: Added.
+ * fast/media/media-query-list-08.html: Added.
+
+ Skipping the new test in Qt due to an issue in its DumpRenderTree.
+
+ * platform/qt/Skipped:
+
2012-04-13 Simon Fraser <simon.fraser@apple.com>
Avoid using backing store for compositing layers that just need to clip
--- /dev/null
+Test the MediaQueryList interface: http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface.
+
+Testing viewport related callbacks
+
+PASS
+
--- /dev/null
+<html>
+<head>
+<title>Test CSSOM View module: MediaQueryList interface</title>
+<script type="text/javascript" charset="utf-8">
+ if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+ }
+
+ function log(m) {
+ document.getElementById('results').innerHTML += m + '<br>';
+ }
+
+ function callback(query) {
+ log("PASS");
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+
+ function runTests()
+ {
+ window.matchMedia("(max-width: 250px)").addListener(callback);
+ window.resizeTo(200, 300);
+ }
+
+</script>
+</head>
+<body onload="runTests()">
+ <p>Test the MediaQueryList interface: <a href="http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface" title="CSSOM View Module">http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface</a>.</p>
+ <p>Testing viewport related callbacks</p>
+ <div id="results">
+ </div>
+</body>
+</html>
fast/canvas/2d.backingStorePixelRatio.html
fast/canvas/2d.imageDataHD.html
+# window.resizeTo() does not trigger a relayout in our DumpRenderTree
+fast/media/media-query-list-08.html
+
# This requires didClearWindowObjectForFrameInIsolatedWorld foo in FrameLoaderClient
http/tests/security/isolatedWorld/didClearWindowObject.html
# This needs more investigation
+2012-04-16 Luiz Agostini <luiz.agostini@palm.com>
+
+ matchMedia() MediaQueryList not updating
+ https://bugs.webkit.org/show_bug.cgi?id=75903
+
+ Reviewed by Antti Koivisto.
+
+ Test: fast/media/media-query-list-08.html
+
+ Viewport related MediaQueryList listeners were not triggered and the value
+ of matches were not updated if the document's style selector were not
+ affected by viewport changes.
+
+ The new method evaluateMediaQueries() is now called by FrameView instead of
+ styleSelectorChanged() if the style selector is not affected by viewport changes.
+
+ * dom/Document.cpp:
+ (WebCore::Document::evaluateMediaQueries):
+ (WebCore):
+ (WebCore::Document::styleSelectorChanged):
+ * dom/Document.h:
+ (Document):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::layout):
+
2012-04-16 James Robinson <jamesr@chromium.org>
[chromium] Delete uncalled unreserveContentsTextures function
view()->scrollToFragment(m_url);
}
+void Document::evaluateMediaQueryList()
+{
+ if (m_mediaQueryMatcher)
+ m_mediaQueryMatcher->styleSelectorChanged();
+}
+
void Document::styleSelectorChanged(StyleSelectorUpdateFlag updateFlag)
{
// Don't bother updating, since we haven't loaded all our style info yet
view()->scheduleRelayout();
}
- if (m_mediaQueryMatcher)
- m_mediaQueryMatcher->styleSelectorChanged();
+ evaluateMediaQueryList();
}
void Document::addStyleSheetCandidateNode(Node* node, bool createdByParser)
*/
void styleSelectorChanged(StyleSelectorUpdateFlag);
+ void evaluateMediaQueryList();
+
bool usesSiblingRules() const { return m_usesSiblingRules || m_usesSiblingRulesOverride; }
void setUsesSiblingRules(bool b) { m_usesSiblingRulesOverride = b; }
bool usesFirstLineRules() const { return m_usesFirstLineRules; }
if (document->styleSelector()->affectedByViewportChange()) {
document->styleSelectorChanged(RecalcStyleImmediately);
InspectorInstrumentation::mediaQueryResultChanged(document);
- }
+ } else
+ document->evaluateMediaQueryList();
// Always ensure our style info is up-to-date. This can happen in situations where
// the layout beats any sort of style recalc update that needs to occur.