WebKit Bugzilla
Attachment 360183 Details for
Bug 193843
: Document::updateMainArticleElementAfterLayout() should be a no-op when no client depends on knowing the main article element
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixes the bug
bug-193843-20190125160408.patch (text/plain), 2.10 KB, created by
Wenson Hsieh
on 2019-01-25 16:04:09 PST
(
hide
)
Description:
Fixes the bug
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2019-01-25 16:04:09 PST
Size:
2.10 KB
patch
obsolete
>Subversion Revision: 240492 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 52ec35abb0b376bc09f377454bdc25ce220f4d0f..349c2d2d88e8ff86d5f3db8d6c6a92650cc7a3b7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,17 @@ >+2019-01-25 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ Document::updateMainArticleElementAfterLayout() should be a no-op when no client depends on knowing the main article element >+ https://bugs.webkit.org/show_bug.cgi?id=193843 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * dom/Document.cpp: >+ (WebCore::Document::updateMainArticleElementAfterLayout): >+ >+ This function currently does a bit of wasted work after every layout, on clients that don't listen to the >+ "significant rendered text" layout milestone and therefore don't need to guess the main article element. Simply >+ don't bother keeping the main article element up to date in this scenario. >+ > 2019-01-25 Wenson Hsieh <wenson_hsieh@apple.com> > > [iOS] Rename some WebKit-internal functions and variables that reference "data interaction" >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index dae77578ce76a6070ee9e9b3b2998f05b5e2a0c4..cb255a81bea392f43bd994a5c781ac6c937b550a 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -8401,6 +8401,14 @@ void Document::unregisterArticleElement(Element& article) > > void Document::updateMainArticleElementAfterLayout() > { >+ auto* page = this->page(); >+ if (!page || !(page->requestedLayoutMilestones() & DidRenderSignificantAmountOfText)) { >+ // This main article element heuristic is currently only used for the purposes of firing the significant rendered text >+ // layout milestone. If this layout milestone has not been requested, we don't need to bother keeping the main article >+ // element up to date. >+ return; >+ } >+ > // If there are too many article elements on the page, don't consider any one of them to be "main content". > const unsigned maxNumberOfArticlesBeforeIgnoringMainContentArticle = 10; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193843
:
360183
|
360184
|
360193