Bug 143463 - Bing video search result pages are not PageCacheable
Summary: Bing video search result pages are not PageCacheable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on: 143779
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-06 19:08 PDT by Chris Dumez
Modified: 2016-02-01 15:43 PST (History)
7 users (show)

See Also:


Attachments
Patch (13.27 KB, patch)
2015-04-06 19:41 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (14.81 KB, patch)
2015-04-06 21:52 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (14.84 KB, patch)
2015-04-06 22:21 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (14.85 KB, patch)
2015-04-06 22:26 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-04-06 19:08:56 PDT
Bing video search result pages are not PageCacheable (tested on iOS). It both:
- is bad for power usage as it causes a reload when clicking one of the results then navigating back in history
- degrades user experience because the results page uses infinite scrolling and the scroll position is not properly restored when navigating back, not to mention the user has to wait for the reload to complete.

Radar: <rdar://problem/20440916>
Comment 1 Chris Dumez 2015-04-06 19:41:54 PDT
Created attachment 250252 [details]
Patch
Comment 2 Alexey Proskuryakov 2015-04-06 20:08:42 PDT
Comment on attachment 250252 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=250252&action=review

> LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition.html:11
> +    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);

Is this preference reset after the test (in both DRT and WKTR)?
Comment 3 Alexey Proskuryakov 2015-04-06 20:09:27 PDT
Please fix the iOS build:

/Volumes/Data/EWS/WebKit/Source/WebKit/mac/Misc/WebCache.mm:204:81: error: no member named 'resourceForURL' in 'WebCore::MemoryCache'
    WebCore::CachedResource* cachedResource = WebCore::MemoryCache::singleton().resourceForURL(url);
Comment 4 Chris Dumez 2015-04-06 21:47:00 PDT
(In reply to comment #2)
> Comment on attachment 250252 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=250252&action=review
> 
> > LayoutTests/http/tests/navigation/page-cache-pending-image-load-cache-partition.html:11
> > +    testRunner.overridePreference("WebKitUsesPageCachePreferenceKey", 1);
> 
> Is this preference reset after the test (in both DRT and WKTR)?

Yes, for WKTR, this is taken care of by WebPreferencesStore::removeTestRunnerOverrides().
For DTR, in void resetWebPreferencesToConsistentValues() in DumpRenderTree.mm:
[preferences setUsesPageCache:NO];
Comment 5 Chris Dumez 2015-04-06 21:52:31 PDT
Created attachment 250254 [details]
Patch
Comment 6 Chris Dumez 2015-04-06 22:21:41 PDT
Created attachment 250255 [details]
Patch
Comment 7 Chris Dumez 2015-04-06 22:26:35 PDT
Created attachment 250256 [details]
Patch
Comment 8 WebKit Commit Bot 2015-04-06 23:23:54 PDT
Comment on attachment 250256 [details]
Patch

Clearing flags on attachment: 250256

Committed r182449: <http://trac.webkit.org/changeset/182449>
Comment 9 WebKit Commit Bot 2015-04-06 23:24:02 PDT
All reviewed patches have been landed.  Closing bug.
Comment 10 Alexey Proskuryakov 2015-04-07 09:39:11 PDT
Looks like this broke a test on Windows:

http/tests/security/xss-DENIED-xsl-external-entity-redirect.xml

@@ -1,2 +1,6 @@
+CONSOLE MESSAGE: line 1: Document is empty
+
+CONSOLE MESSAGE: line 1: Start tag expected, '<' not found
+
 This test includes a cross-origin external entity. It passes if the load fails and thus there is no text below this line.
Comment 11 Chris Dumez 2015-04-07 09:40:26 PDT
(In reply to comment #10)
> Looks like this broke a test on Windows:
> 
> http/tests/security/xss-DENIED-xsl-external-entity-redirect.xml
> 
> @@ -1,2 +1,6 @@
> +CONSOLE MESSAGE: line 1: Document is empty
> +
> +CONSOLE MESSAGE: line 1: Start tag expected, '<' not found
> +
>  This test includes a cross-origin external entity. It passes if the load
> fails and thus there is no text below this line.

Hmm, this is really odd. I'll take a look now.
Comment 12 Chris Dumez 2015-04-07 09:43:00 PDT
The failing test does not use PageCache or internals.isLoadingFromMemoryCache(). Could it be a flake?
Comment 14 Chris Dumez 2015-04-07 09:51:36 PDT
(In reply to comment #13)
> It fails every time, so not really a flake:
> 
> http://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.
> html#tests=http%2Ftests%2Fsecurity%2Fxss-DENIED-xsl-external-entity-redirect.
> xml

Ok, still investigating. stdio shows:
476 2928 worker/0 http/tests/security/xss-DENIED-xsl-external-entity-redirect.xml passed
18:00:06.538 2928 worker/0 http/tests/security/xss-DENIED-xsl-external-entity.xml output stderr lines:
18:00:06.538 2928   ERROR: Failed to create path /tmp/DumpRenderTree-1sDSaK\Databases
18:00:06.538 2928   ..\platform\win\FileSystemWin.cpp(212) : WebCore::makeAllDirectories
18:00:06.538 2928   ERROR: Failed to create path /tmp/DumpRenderTree-1sDSaK\Databases
18:00:06.538 2928   ..\platform\win\FileSystemWin.cpp(212) : WebCore::makeAllDirectories
18:00:06.538 2928   LEAK: 3 CachedPage
18:00:06.538 2928   LEAK: 218 CachedResource
18:00:06.538 2928   LEAK: 4 CachedFrame
18:00:06.538 2928   LEAK: 7 Frame
18:00:06.538 2928   LEAK: 242 WebCoreNode
18:00:06.538 2928   LEAK: 46 RenderObject
18:00:06.538 2928   LEAK: 6 Page
18:00:06.538 2928   file:///C:/Program%20Files%20(x86)/Common%20Files/Apple/Apple%20Application%20Support/../etc/catalog:1: parser error : Document is empty
18:00:06.538 2928   
18:00:06.538 2928   ^
18:00:06.538 2928   file:///C:/Program%20Files%20(x86)/Common%20Files/Apple/Apple%20Application%20Support/../etc/catalog:1: parser error : Start tag expected, '<' not found
18:00:06.538 2928   
18:00:06.538 2928   ^
18:00:06.538 2928   compilation error: file http://127.0.0.1:8000/security/xss-DENIED-xsl-document-securityOrigin.xml line 2 element stylesheet
18:00:06.538 2928   xsl:version: only 1.0 features are supported
18:00:06.538 2928   compilation error: file http://127.0.0.1:8000/security/xss-DENIED-xsl-document-securityOrigin.xml line 2 element stylesheet
18:00:06.538 2928   xsl:version: only 1.0 features are supported
18:00:06.538 2928   compilation error: file http://127.0.0.1:8000/security/xss-DENIED-xsl-document-securityOrigin.xml line 2 element stylesheet
18:00:06.538 2928   xsl:version: only 1.0 features are supported
18:00:06.538 2928 worker/0 http/tests/security/xss-DENIED-xsl-external-entity.xml passed
Comment 15 Chris Dumez 2015-04-07 09:55:51 PDT
(In reply to comment #14)
> (In reply to comment #13)
> > It fails every time, so not really a flake:
> > 
> > http://webkit-test-results.appspot.com/dashboards/flakiness_dashboard.
> > html#tests=http%2Ftests%2Fsecurity%2Fxss-DENIED-xsl-external-entity-redirect.
> > xml
> 
> Ok, still investigating. stdio shows:
> 476 2928 worker/0
> http/tests/security/xss-DENIED-xsl-external-entity-redirect.xml passed
> 18:00:06.538 2928 worker/0
> http/tests/security/xss-DENIED-xsl-external-entity.xml output stderr lines:
> 18:00:06.538 2928   ERROR: Failed to create path
> /tmp/DumpRenderTree-1sDSaK\Databases
> 18:00:06.538 2928   ..\platform\win\FileSystemWin.cpp(212) :
> WebCore::makeAllDirectories
> 18:00:06.538 2928   ERROR: Failed to create path
> /tmp/DumpRenderTree-1sDSaK\Databases
> 18:00:06.538 2928   ..\platform\win\FileSystemWin.cpp(212) :
> WebCore::makeAllDirectories
> 18:00:06.538 2928   LEAK: 3 CachedPage
> 18:00:06.538 2928   LEAK: 218 CachedResource
> 18:00:06.538 2928   LEAK: 4 CachedFrame
> 18:00:06.538 2928   LEAK: 7 Frame
> 18:00:06.538 2928   LEAK: 242 WebCoreNode
> 18:00:06.538 2928   LEAK: 46 RenderObject
> 18:00:06.538 2928   LEAK: 6 Page
> 18:00:06.538 2928  
> file:///C:/Program%20Files%20(x86)/Common%20Files/Apple/
> Apple%20Application%20Support/../etc/catalog:1: parser error : Document is
> empty
> 18:00:06.538 2928   
> 18:00:06.538 2928   ^
> 18:00:06.538 2928  
> file:///C:/Program%20Files%20(x86)/Common%20Files/Apple/
> Apple%20Application%20Support/../etc/catalog:1: parser error : Start tag
> expected, '<' not found
> 18:00:06.538 2928   
> 18:00:06.538 2928   ^
> 18:00:06.538 2928   compilation error: file
> http://127.0.0.1:8000/security/xss-DENIED-xsl-document-securityOrigin.xml
> line 2 element stylesheet
> 18:00:06.538 2928   xsl:version: only 1.0 features are supported
> 18:00:06.538 2928   compilation error: file
> http://127.0.0.1:8000/security/xss-DENIED-xsl-document-securityOrigin.xml
> line 2 element stylesheet
> 18:00:06.538 2928   xsl:version: only 1.0 features are supported
> 18:00:06.538 2928   compilation error: file
> http://127.0.0.1:8000/security/xss-DENIED-xsl-document-securityOrigin.xml
> line 2 element stylesheet
> 18:00:06.538 2928   xsl:version: only 1.0 features are supported
> 18:00:06.538 2928 worker/0
> http/tests/security/xss-DENIED-xsl-external-entity.xml passed

Interestingly, stdio shows the same stdio errors in the builds before mine:
https://build.webkit.org/builders/Apple%20Win%207%20Debug%20%28Tests%29/builds/65579/steps/layout-test/logs/stdio

However, the test was not recognized as failing before (same errors though).
Comment 16 Chris Dumez 2015-04-07 10:12:52 PDT
Looks like the Windows failure is caused by <rdar://problem/4292995>. mac and iOS already have a workaround for it, we likely want to do the same for win?
Tools/Scripts/webkitpy/port/ios.py:        env['XML_CATALOG_FILES'] = ''  # work around missing /etc/catalog <rdar://problem/4292995>
Tools/Scripts/webkitpy/port/mac.py:        env['XML_CATALOG_FILES'] = ''  # work around missing /etc/catalog <rdar://problem/4292995>
Comment 17 Brent Fulgham 2015-04-07 10:16:23 PDT
(In reply to comment #16)
> Looks like the Windows failure is caused by <rdar://problem/4292995>. mac
> and iOS already have a workaround for it, we likely want to do the same for
> win?
> Tools/Scripts/webkitpy/port/ios.py:        env['XML_CATALOG_FILES'] = ''  #
> work around missing /etc/catalog <rdar://problem/4292995>
> Tools/Scripts/webkitpy/port/mac.py:        env['XML_CATALOG_FILES'] = ''  #
> work around missing /etc/catalog <rdar://problem/4292995>

Wow -- we should definitely do the same for Windows!
Comment 18 Chris Dumez 2015-04-07 10:18:28 PDT
(In reply to comment #17)
> (In reply to comment #16)
> > Looks like the Windows failure is caused by <rdar://problem/4292995>. mac
> > and iOS already have a workaround for it, we likely want to do the same for
> > win?
> > Tools/Scripts/webkitpy/port/ios.py:        env['XML_CATALOG_FILES'] = ''  #
> > work around missing /etc/catalog <rdar://problem/4292995>
> > Tools/Scripts/webkitpy/port/mac.py:        env['XML_CATALOG_FILES'] = ''  #
> > work around missing /etc/catalog <rdar://problem/4292995>
> 
> Wow -- we should definitely do the same for Windows!

Filed https://bugs.webkit.org/show_bug.cgi?id=143484.
Comment 19 Alexey Proskuryakov 2015-04-07 10:51:52 PDT
Good catch!

Not sure if we have an explanation of why this started being a test failure, seems quite surprising.
Comment 20 Chris Dumez 2015-04-07 10:57:12 PDT
(In reply to comment #19)
> Good catch!
> 
> Not sure if we have an explanation of why this started being a test failure,
> seems quite surprising.

Yes, somehow the stderr output ended up as CONSOLE messages, causing the layout tests to fail. Not sure how this can happen. It may even be the stderr output from the previous test if I read correctly...
Comment 21 Alexey Proskuryakov 2015-04-07 11:07:30 PDT
These may be coming from XSLTProcessor::parseErrorFunc, so they are proper console messages from the beginning, not stderr messages.
Comment 22 Alexey Proskuryakov 2015-04-07 13:14:55 PDT
The test is still failing with that fixed.
Comment 23 Alexey Proskuryakov 2015-04-14 20:52:27 PDT
The test is still failing on Windows Debug.
Comment 24 Chris Dumez 2015-04-15 09:45:59 PDT
(In reply to comment #23)
> The test is still failing on Windows Debug.

I believe Brent was looking into the XML error. However, I have another speculative fix at https://bugs.webkit.org/show_bug.cgi?id=143779.
Comment 25 Chris Dumez 2015-04-15 12:16:03 PDT
(In reply to comment #24)
> (In reply to comment #23)
> > The test is still failing on Windows Debug.
> 
> I believe Brent was looking into the XML error. However, I have another
> speculative fix at https://bugs.webkit.org/show_bug.cgi?id=143779.

Looks like the test is no longer failing starting with the following build:
https://build.webkit.org/builders/Apple%20Win%207%20Debug%20%28Tests%29/builds/65705

I don't know what fixed it but the test still passes in the builds that follow.
Comment 26 Alexey Proskuryakov 2015-04-15 17:06:59 PDT
It's failing again.
Comment 27 Chris Dumez 2015-04-15 17:31:51 PDT
(In reply to comment #26)
> It's failing again.

I don't know what Brent thinks about this but I would propose marking it was flaky. I don't believe the failure was caused by my change. The test clearly is flaky as it starts passing / failing for no apparent reason.