Bug 208504

Summary: Avoid full style resolution on Element::focus()
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, cdumez, cfleizach, cmarcelo, commit-queue, dmazzoni, emilio, esprehn+autocc, ews-watchlist, gyuyoung.kim, jcraig, jdiggs, kangil.han, mifenton, rniwa, samuel_white, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=220580
Attachments:
Description Flags
wip
none
wip
none
wip
none
wip
none
patch
none
patch
zalan: review+
patch
none
patch
none
patch
none
followup
none
patch
none
followup none

Description Antti Koivisto 2020-03-03 01:24:17 PST
It can be costly.
Comment 1 Antti Koivisto 2020-03-03 01:25:48 PST
Created attachment 392254 [details]
wip
Comment 2 Antti Koivisto 2020-03-03 03:20:12 PST
Created attachment 392258 [details]
wip
Comment 3 Antti Koivisto 2020-03-03 06:33:20 PST
Created attachment 392270 [details]
wip
Comment 4 Antti Koivisto 2020-03-03 10:37:00 PST
Created attachment 392295 [details]
wip
Comment 5 Antti Koivisto 2020-03-03 12:47:50 PST
Created attachment 392312 [details]
patch
Comment 6 Antti Koivisto 2020-03-03 12:49:27 PST
Created attachment 392313 [details]
patch
Comment 7 zalan 2020-03-03 12:55:36 PST
Comment on attachment 392313 [details]
patch

I've got a bit of a compat/regression concern here, but let's see what happens...also YAY.
Comment 8 Ryosuke Niwa 2020-03-03 13:56:05 PST
Comment on attachment 392313 [details]
patch

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

> Source/WebCore/ChangeLog:14
> +        This appears to be 3-4% Speedometer progression.

Nice!
Comment 9 Antti Koivisto 2020-03-04 00:29:15 PST
Created attachment 392385 [details]
patch
Comment 10 Antti Koivisto 2020-03-04 01:22:10 PST
Created attachment 392393 [details]
patch
Comment 11 Antti Koivisto 2020-03-04 02:25:36 PST
Created attachment 392399 [details]
patch
Comment 12 WebKit Commit Bot 2020-03-04 04:11:19 PST
Comment on attachment 392399 [details]
patch

Clearing flags on attachment: 392399

Committed r257839: <https://trac.webkit.org/changeset/257839>
Comment 13 WebKit Commit Bot 2020-03-04 04:11:21 PST
All reviewed patches have been landed.  Closing bug.
Comment 14 Radar WebKit Bug Importer 2020-03-04 04:12:18 PST
<rdar://problem/60035288>
Comment 15 Emilio Cobos Álvarez (:emilio) 2020-03-04 05:36:54 PST
Comment on attachment 392399 [details]
patch

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

> Source/WebCore/dom/Element.cpp:3352
> +    for (auto& element : ancestorsOfType<Element>(*this)) {

This should probably be the flat / composed tree ancestors, right? I suspect this would crash otherwise in some shadow DOM situations involving slotting.
Comment 16 Antti Koivisto 2020-03-04 06:15:02 PST
Good point!
Comment 17 Antti Koivisto 2020-03-04 06:26:38 PST
Created attachment 392406 [details]
followup
Comment 18 Antti Koivisto 2020-03-04 06:54:48 PST
Reopening for a followup
Comment 19 Antti Koivisto 2020-03-04 06:55:12 PST
Created attachment 392410 [details]
patch
Comment 20 Antti Koivisto 2020-03-04 07:05:30 PST
Created attachment 392411 [details]
followup
Comment 21 WebKit Commit Bot 2020-03-04 08:34:47 PST
Comment on attachment 392411 [details]
followup

Clearing flags on attachment: 392411

Committed r257846: <https://trac.webkit.org/changeset/257846>
Comment 22 WebKit Commit Bot 2020-03-04 08:34:49 PST
All reviewed patches have been landed.  Closing bug.