Summary: | matchMedia('print').addListener() fires in WK1 but never in WK2 when printing (breaks printing Google maps, QuickLooks) | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Antti Koivisto <koivisto> | ||||||
Component: | Printing | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | ap, commit-queue, sam | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Attachments: |
|
Description
Antti Koivisto
2017-05-19 09:31:21 PDT
Created attachment 310665 [details]
patch
Comment on attachment 310665 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=310665&action=review > Source/WebCore/ChangeLog:14 > + (WebCore::FrameView::layout): > + > + Evaluate matchMedia queries unconditionally. No idea why it wasn't like that. Out of curiosity, what made this work in WK1 but not WK2? If anything triggers an additional layout the bug goes away. I think WK1 worked by just by having different printing code that ended up doing more layouts. I had to add a clean printing simulation to Internals to test this. Comment on attachment 310665 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=310665&action=review > Source/WebCore/testing/Internals.h:348 > + void setPrinting(int width, int height); What resets m_printContext between tests? > LayoutTests/fast/media/matchMedia-print.html:15 > +if (window.internals) > + window.internals.setPrinting(500,500); Is it doable with one of the existing print testing functions? There are some in Internals (search for PeintContext in Internals.cpp), and there is setPrinting in TestRunner too. > What resets m_printContext between tests? Internals gets recreated for each test. Lifetime of m_printContext might still be problematic as GC could keep Internals alive too long. I'll look into it. > Is it doable with one of the existing print testing functions? There are > some in Internals (search for PeintContext in Internals.cpp), and there is > setPrinting in TestRunner too. No, as mentioned above and in the ChangeLog. Created attachment 310806 [details]
patch
Comment on attachment 310806 [details] patch Clearing flags on attachment: 310806 Committed r217197: <http://trac.webkit.org/changeset/217197> All reviewed patches have been landed. Closing bug. |