[Webkit-unassigned] [Bug 50758] Defer loading print stylesheets
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Dec 13 09:25:02 PST 2010
--- Comment #15 from Alexey Proskuryakov <ap at webkit.org> 2010-12-13 09:25:01 PST ---
(From update of attachment 76378)
View in context: https://bugs.webkit.org/attachment.cgi?id=76378&action=review
I've been reviewing the previous version (without build fixes). Looks good, and I'm especially happy about test coverage.
Please fix minor comments. I'm not quite sure what to do about the two bigger ones (possibility of printing problems, and breaking preloading for complex media). Is this something to discuss with Hyatt, or are you sure about this being fine?
> + - Use this mechanism to load print stylesheets using very low priority so they get loaded after everything else.
I'm slightly worried that this may increase problem rate when actually printing. It will be more likely that a page will not be printable yet when it looks complete on screen. The user would press Cmd+P, and observe broken layout.
> + * WebCore.xcodeproj/project.pbxproj:
Please modify other project files.
> - bool eval(const MediaList*, CSSStyleSelector* = 0) const;
> + bool eval(PassRefPtr<MediaList>, CSSStyleSelector* = 0) const;
This change is wrong. PassRefPtr should be used when passing ownership - but MediaQueryEvaluator doesn't take ownership of the MediaList.
> + // FIXME: We shouldn't load unnecessary stylesheets at all.
Please remove this FIXME. There is no such thing as "unnecessary stylesheet".
> + // Load print stylesheets with low priority so they don't affect normal page loading.
> + ResourceLoadPriority priority = mediaIsScreen ? ResourceLoadPriorityUnresolved : ResourceLoadPriorityVeryLow;
> + m_cachedSheet = document()->cachedResourceLoader()->requestCSSStyleSheet(m_url, charset, priority);
> + bool linkMediaAttributeMatches(const String& attributeValue)
This function doesn't use class members, so it should be static. Also, the name implies matching something in class state, which is misleading. I suggest something like "linkMediaAttributeMatchesRenderingIntent" or linkMediaAttributeIsScreen".
> + // Only preload screen media stylesheets. Used this way, the evaluator evaluates to false for any
> + // rules containing complex queries (full evaluation is possible but it requires frame and style selector which
> + // may be problematic here). Cases where picking these for preloading would help are probably rare.
Will this prevent preloading for screen size and resolution specific stylesheets? How bad is that for embedded devices?
> + Add setSerializeHTTPLoads function to allow testing resource load order on OS X.
Please consider also implementing this at least for WebKit2.
> + [WebView _setLoadResourcesSerially:serialize forHost:@"127.0.0.1"];
What is the use case for passing a host here? We'll want at least localhost, too.
> +2010-12-13 Antti Koivisto <antti at apple.com>
Duplicated ChangeLog in LayoutTests.
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned