Bug 56482

Summary: Make CSSMedia queries pass through Chrome and ChromeClient
Product: WebKit Reporter: Robert Hogan <robert>
Component: New BugsAssignee: Robert Hogan <robert>
Status: RESOLVED WONTFIX    
Severity: Normal CC: abarth, cmarcelo, hyatt, mikeperry-webkit, robert
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on:    
Bug Blocks: 50895, 56678    
Attachments:
Description Flags
Patch
none
Patch
none
Patch eric: review-

Robert Hogan
Reported 2011-03-16 13:22:44 PDT
Make CSSMedia queries pass through Chrome and ChromeClient
Attachments
Patch (10.57 KB, patch)
2011-03-16 13:28 PDT, Robert Hogan
no flags
Patch (11.07 KB, patch)
2011-03-17 05:54 PDT, Robert Hogan
no flags
Patch (11.13 KB, patch)
2011-03-18 14:56 PDT, Robert Hogan
eric: review-
Robert Hogan
Comment 1 2011-03-16 13:28:36 PDT
Eric Seidel (no email)
Comment 2 2011-03-17 04:28:47 PDT
Comment on attachment 85963 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=85963&action=review Why? Please explain in your ChangeLog. > Source/WebCore/css/MediaQueryEvaluator.cpp:-232 > - if (!screenIsMonochrome(frame->page()->mainFrame()->view())) { what happens to the screenIsMonochrome function? Is it being removed?
Robert Hogan
Comment 3 2011-03-17 05:54:48 PDT
Robert Hogan
Comment 4 2011-03-17 07:35:14 PDT
Comment on attachment 86050 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=86050&action=review > Source/WebCore/css/MediaQueryEvaluator.cpp:232 > + if (!frame->page()->chrome()->screenIsMonochrome()) { No, it's not removed. It's called from Chrome instead.
Robert Hogan
Comment 5 2011-03-18 11:59:53 PDT
Comment on attachment 86050 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=86050&action=review > Source/WebCore/css/MediaQueryEvaluator.cpp:257 > + FloatRect sg = frame->page()->chrome()->pageRect(); Note to self: this should be windowRect() I think. > Source/WebCore/css/MediaQueryEvaluator.cpp:332 > + FloatRect sg = frame->page()->chrome()->pageRect(); Note to self: this should be windowRect() I think.
Robert Hogan
Comment 6 2011-03-18 12:14:31 PDT
Comment on attachment 86050 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=86050&action=review > Source/WebCore/page/ChromeClient.h:86 > + int screenDepthPerComponent(int bitsPerComponent) { return bitsPerComponent; } > + bool screenIsMonochrome(bool isMonochrome) { return isMonochrome; } > + FloatRect screenRect(FloatRect rect) { return rect; } > + FloatRect screenAvailableRect(FloatRect rect) { return rect; } Oh, these should be virtual.
Eric Seidel (no email)
Comment 7 2011-03-18 14:33:00 PDT
Comment on attachment 86050 [details] Patch So is this only for fighting fingerprinting? Shouldn't anti-fingerprinting measures be in WebCore directly?
Robert Hogan
Comment 8 2011-03-18 14:43:28 PDT
(In reply to comment #7) > (From update of attachment 86050 [details]) > So is this only for fighting fingerprinting? Shouldn't anti-fingerprinting measures be in WebCore directly? It isn't always the right place for them. See https://trac.webkit.org/wiki/Fingerprinting#CreatingaCommonFingerprint A browser needs the flexibility to create a common fingerprint for it's users - WebCore isn't always best placed to decide what this fingerprint should be. I think the 'bare metal' properties of the screen and viewport inspected by CSS media queries in PlatformScreen are a good example. A browser will often have to make a trade-off between user experience and a relatively common set of values for screen/chrome/window dimensions - it ensures these are respected by the Screen and Window DOM objects, and it needs to do the same with CSS media queries. A good example of this is in the Torbutton design document referenced here: https://trac.webkit.org/wiki/Fingerprinting#WindowObject
Robert Hogan
Comment 9 2011-03-18 14:56:03 PDT
Adam Barth
Comment 10 2011-03-30 11:50:23 PDT
Comment on attachment 86217 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=86217&action=review > Source/WebCore/css/MediaQueryEvaluator.cpp:222 > - int bitsPerComponent = screenDepthPerComponent(frame->page()->mainFrame()->view()); > + int bitsPerComponent = frame->page()->chrome()->screenDepthPerComponent(); What if page is null?
Eric Seidel (no email)
Comment 11 2011-05-23 14:49:14 PDT
Comment on attachment 86217 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=86217&action=review I disagree with this approach. If we are doing this for fingerprinting avoidance, we should write the anti-fingerprinting code in WebCore instead of piping everything through WebKit. >> Source/WebCore/css/MediaQueryEvaluator.cpp:222 >> + int bitsPerComponent = frame->page()->chrome()->screenDepthPerComponent(); > > What if page is null? frame->page() can only be null during teardown, or?
Note You need to log in before you can comment on or make changes to this bug.