RESOLVED FIXED 152983
Picture element needs to work properly with the preload scanner
https://bugs.webkit.org/show_bug.cgi?id=152983
Summary Picture element needs to work properly with the preload scanner
Dave Hyatt
Reported 2016-01-11 12:18:35 PST
The preloader needs to do source selection properly on picture elements.
Attachments
Patch (100.09 KB, patch)
2016-01-11 12:22 PST, Dave Hyatt
no flags
Patch (122.51 KB, patch)
2016-01-11 12:25 PST, Dave Hyatt
dino: review+
Dave Hyatt
Comment 1 2016-01-11 12:22:25 PST
WebKit Commit Bot
Comment 2 2016-01-11 12:23:37 PST
Attachment 268703 [details] did not pass style-queue: ERROR: Source/WebCore/html/parser/HTMLPreloadScanner.cpp:124: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/WebCore/html/parser/HTMLPreloadScanner.cpp:177: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 2 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Dave Hyatt
Comment 3 2016-01-11 12:25:00 PST
WebKit Commit Bot
Comment 4 2016-01-11 12:26:23 PST
Attachment 268704 [details] did not pass style-queue: ERROR: Source/WebCore/html/parser/HTMLPreloadScanner.cpp:124: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] ERROR: Source/WebCore/html/parser/HTMLPreloadScanner.cpp:177: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 2 in 14 files If any of these errors are false positives, please file a bug against check-webkit-style.
Dean Jackson
Comment 5 2016-01-11 12:36:02 PST
Comment on attachment 268704 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=268704&action=review > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:124 > + if (m_tagId == TagId::Source && !pictureState.isEmpty() && pictureState.last() == false && m_mediaMatched && !m_srcSetAttribute.isEmpty()) { Why not !pictureState.last() ? > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:177 > + bool alreadyMatchedSource = inPicture && pictureState.last() == true; Same here.
Chris Dumez
Comment 6 2016-01-11 13:00:31 PST
Comment on attachment 268704 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=268704&action=review > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:128 > + pictureState.removeLast(); I believe we could replace these 2 lines with: pictureState.last() = true; and avoid any vector resizing. > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:174 > + void processAttribute(const AtomicString& attributeName, const String& attributeValue, Document& document, Vector<bool> pictureState) const Vector<bool>& ? > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:210 > + RefPtr<MediaQuerySet> mediaSet = MediaQuerySet::createAllowingDescriptionSyntax(attributeValue); Ref<> > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:213 > + m_mediaMatched = evaluator.evalCheckingViewportDependentResults(mediaSet.get(), viewportDependentMediaQueryResults); .ptr() instead of .get() if you switch to Ref<>. > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:326 > + bool m_mediaMatched { true }; Would be clearer with a 'is' / 'was' prefix, as per coding style. > Source/WebCore/html/parser/HTMLPreloadScanner.cpp:364 > m_inStyle = false; We probably want to add an early return after this to avoid running your new check.
Dave Hyatt
Comment 7 2016-01-11 13:49:46 PST
Fixed in r194865.
Note You need to log in before you can comment on or make changes to this bug.