WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
187578
Make it easier to hit the significant rendered text layout milestone on pages with main article elements
https://bugs.webkit.org/show_bug.cgi?id=187578
Summary
Make it easier to hit the significant rendered text layout milestone on pages...
Wenson Hsieh
Reported
2018-07-11 21:17:19 PDT
Our current heuristics are very conservative, with the intention of avoiding false positives. We can probably relax some of these constraints when we've detected the presence of a main article element on the page. (e.g. NYTimes)
Attachments
Patch
(29.77 KB, patch)
2018-07-11 21:38 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Patch
(29.77 KB, patch)
2018-07-11 22:31 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Address feedback.
(30.28 KB, patch)
2018-07-12 15:14 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Move registration logic to HTMLElement.
(31.53 KB, patch)
2018-07-12 17:58 PDT
,
Wenson Hsieh
ews-watchlist
: commit-queue-
Details
Formatted Diff
Diff
Archive of layout-test-results from ews107 for mac-sierra-wk2
(3.02 MB, application/zip)
2018-07-12 19:08 PDT
,
EWS Watchlist
no flags
Details
Archive of layout-test-results from ews102 for mac-sierra
(2.36 MB, application/zip)
2018-07-12 19:11 PDT
,
EWS Watchlist
no flags
Details
Move registration logic to HTMLElement (v2)
(31.48 KB, patch)
2018-07-12 19:58 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Patch for landing
(30.24 KB, patch)
2018-07-12 22:43 PDT
,
Wenson Hsieh
no flags
Details
Formatted Diff
Diff
Show Obsolete
(7)
View All
Add attachment
proposed patch, testcase, etc.
Wenson Hsieh
Comment 1
2018-07-11 21:38:49 PDT
Created
attachment 344822
[details]
Patch
Daniel Bates
Comment 2
2018-07-11 21:46:54 PDT
Comment on
attachment 344822
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=344822&action=review
I have not checked this patch for correctness or read through it as I am tired. Just noticed some very minor issues.
> Source/WebCore/ChangeLog:8 > + Our current heuristics for triggering the signficant rendered text layout milestone are very conservative, with
signficant => significant
> Source/WebCore/dom/Document.cpp:7715 > + static unsigned maxNumberOfArticlesBeforeIgnoringMainContentArticle = 10;
static => const
> Source/WebCore/dom/Document.cpp:7720 > + static float mainContentArticleHeightFactor = 4;
Ditto.
> Source/WebCore/dom/Document.cpp:7721 > + static float mainContentArticleMinimumHeight = 1000;
Ditto.
Wenson Hsieh
Comment 3
2018-07-11 22:31:31 PDT
Created
attachment 344827
[details]
Patch
Wenson Hsieh
Comment 4
2018-07-11 22:31:39 PDT
Comment on
attachment 344822
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=344822&action=review
>> Source/WebCore/ChangeLog:8 >> + Our current heuristics for triggering the signficant rendered text layout milestone are very conservative, with > > signficant => significant
Good catch!
>> Source/WebCore/dom/Document.cpp:7715 >> + static unsigned maxNumberOfArticlesBeforeIgnoringMainContentArticle = 10; > > static => const
Changed to const.
Radar WebKit Bug Importer
Comment 5
2018-07-11 22:34:39 PDT
<
rdar://problem/42104637
>
Ryosuke Niwa
Comment 6
2018-07-12 12:58:55 PDT
Comment on
attachment 344827
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=344827&action=review
I think we need another iteration since this keeping track of elements in a document is really trickily. I can't r+ this until I see the final patch.
> Source/WebCore/dom/Document.cpp:7721 > + const float mainContentArticleMinimumHeight = 1000;
This should probably a factor of the viewport size or width. A hard coded height in px doesn't make much sense.
> Source/WebCore/dom/Element.cpp:1756 > + if (UNLIKELY(hasTagName(articleTag) && newDocument))
Don't do this in Element::insertedIntoAncestor. Add HTMLArticleElement::insertedIntoAncestor instead.
> Source/WebCore/dom/Element.cpp:1806 > + if (UNLIKELY(hasTagName(articleTag)))
Ditto.
Wenson Hsieh
Comment 7
2018-07-12 13:00:04 PDT
Comment on
attachment 344827
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=344827&action=review
>> Source/WebCore/dom/Document.cpp:7721 >> + const float mainContentArticleMinimumHeight = 1000; > > This should probably a factor of the viewport size or width. > A hard coded height in px doesn't make much sense.
Will fix!
>> Source/WebCore/dom/Element.cpp:1756 >> + if (UNLIKELY(hasTagName(articleTag) && newDocument)) > > Don't do this in Element::insertedIntoAncestor. Add HTMLArticleElement::insertedIntoAncestor instead.
HTMLArticleElement doesn't exist. Should I introduce it?
Ryosuke Niwa
Comment 8
2018-07-12 13:24:15 PDT
Comment on
attachment 344827
[details]
Patch Hm... okay. I guess we'd have to keep it in HTMLElement in that case.
Wenson Hsieh
Comment 9
2018-07-12 15:14:18 PDT
Created
attachment 344889
[details]
Address feedback.
Wenson Hsieh
Comment 10
2018-07-12 17:58:11 PDT
Created
attachment 344909
[details]
Move registration logic to HTMLElement.
EWS Watchlist
Comment 11
2018-07-12 19:08:31 PDT
Comment on
attachment 344909
[details]
Move registration logic to HTMLElement.
Attachment 344909
[details]
did not pass mac-wk2-ews (mac-wk2): Output:
https://webkit-queues.webkit.org/results/8522178
New failing tests: accessibility/roles-exposed.html
EWS Watchlist
Comment 12
2018-07-12 19:08:33 PDT
Created
attachment 344914
[details]
Archive of layout-test-results from ews107 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 13
2018-07-12 19:11:43 PDT
Comment on
attachment 344909
[details]
Move registration logic to HTMLElement.
Attachment 344909
[details]
did not pass mac-ews (mac): Output:
https://webkit-queues.webkit.org/results/8522219
New failing tests: accessibility/roles-exposed.html
EWS Watchlist
Comment 14
2018-07-12 19:11:45 PDT
Created
attachment 344915
[details]
Archive of layout-test-results from ews102 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-sierra Platform: Mac OS X 10.12.6
Wenson Hsieh
Comment 15
2018-07-12 19:58:58 PDT
Created
attachment 344920
[details]
Move registration logic to HTMLElement (v2)
Wenson Hsieh
Comment 16
2018-07-12 21:25:50 PDT
(In reply to Ryosuke Niwa from
comment #8
)
> Comment on
attachment 344827
[details]
> Patch > > Hm... okay. I guess we'd have to keep it in HTMLElement in that case.
@Ryosuke — does
https://bugs.webkit.org/attachment.cgi?id=344920&action=review
look reasonable? If so, I'll send it off to commit queue.
Ryosuke Niwa
Comment 17
2018-07-12 22:18:01 PDT
Comment on
attachment 344920
[details]
Move registration logic to HTMLElement (v2) View in context:
https://bugs.webkit.org/attachment.cgi?id=344920&action=review
> Source/WebCore/html/HTMLElement.cpp:404 > +Node::InsertedIntoAncestorResult HTMLElement::insertedIntoAncestor(InsertionType insertionType, ContainerNode& parentOfInsertedTree)
I think we should just go with the check in Element. This patch introduces an extra function call.
Wenson Hsieh
Comment 18
2018-07-12 22:20:57 PDT
(In reply to Ryosuke Niwa from
comment #17
)
> Comment on
attachment 344920
[details]
> Move registration logic to HTMLElement (v2) > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=344920&action=review
> > > Source/WebCore/html/HTMLElement.cpp:404 > > +Node::InsertedIntoAncestorResult HTMLElement::insertedIntoAncestor(InsertionType insertionType, ContainerNode& parentOfInsertedTree) > > I think we should just go with the check in Element. This patch introduces > an extra function call.
👍 Will do.
Wenson Hsieh
Comment 19
2018-07-12 22:43:59 PDT
Created
attachment 344927
[details]
Patch for landing
WebKit Commit Bot
Comment 20
2018-07-12 23:22:41 PDT
Comment on
attachment 344927
[details]
Patch for landing Clearing flags on attachment: 344927 Committed
r233794
: <
https://trac.webkit.org/changeset/233794
>
WebKit Commit Bot
Comment 21
2018-07-12 23:22:43 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug