WebKit Bugzilla
Attachment 360184 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]
v2
bug-193843-20190125162346.patch (text/plain), 3.00 KB, created by
Wenson Hsieh
on 2019-01-25 16:23:46 PST
(
hide
)
Description:
v2
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2019-01-25 16:23:46 PST
Size:
3.00 KB
patch
obsolete
>Subversion Revision: 240492 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 52ec35abb0b376bc09f377454bdc25ce220f4d0f..0c0b84905f1b61599da9d21711481e7dd9a7981c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+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 by not invoking this function in >+ FrameView::performPostLayoutTasks. >+ >+ * page/FrameView.cpp: >+ (WebCore::FrameView::performPostLayoutTasks): >+ > 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..95e4db7bc76578bb70c491035ac8f26136694c08 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -8401,6 +8401,8 @@ void Document::unregisterArticleElement(Element& article) > > void Document::updateMainArticleElementAfterLayout() > { >+ ASSERT(page() && page()->requestedLayoutMilestones() & DidRenderSignificantAmountOfText); >+ > // 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; > >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index 7ca56c19a217262ea4dca167608d61fc534087eb..c7fa21711aaaa2dc66085a14652e8b7aae9202e2 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -3310,7 +3310,14 @@ void FrameView::performPostLayoutTasks() > // FIXME: We should not run any JavaScript code in this function. > LOG(Layout, "FrameView %p performPostLayoutTasks", this); > >- frame().document()->updateMainArticleElementAfterLayout(); >+ auto* page = frame().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. >+ frame().document()->updateMainArticleElementAfterLayout(); >+ } >+ > frame().selection().updateAppearanceAfterLayout(); > > flushPostLayoutTasksQueue();
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