Bug 174145 - We resolve one extra element's style when calling getComputedStyle on a display: none subtree, I think
Summary: We resolve one extra element's style when calling getComputedStyle on a displ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Emilio Cobos Álvarez
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-04 20:45 PDT by Emilio Cobos Álvarez
Modified: 2017-07-05 11:01 PDT (History)
8 users (show)

See Also:


Attachments
Patch (1.76 KB, patch)
2017-07-04 20:49 PDT, Emilio Cobos Álvarez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Emilio Cobos Álvarez 2017-07-04 20:45:06 PDT
Noticed this while trying to construct a test-case for bug 172753.

In Element::resolveComputedStyle:

        elementsRequiringComputedStyle.prepend(&ancestor);
        if (auto* existingStyle = ancestor.existingComputedStyle()) {
            computedStyle = existingStyle;
            break;
        }

I think that we resolve style when not needed for that ancestor we find an existing computed style for...

Also, I think, that we resolve the first element inheriting from itself, which seems wrong (though I don't think it's observable, fwiw)... Will post a patch here to run through CI, and will update for review when needed.
Comment 1 Emilio Cobos Álvarez 2017-07-04 20:49:57 PDT
Created attachment 314594 [details]
Patch
Comment 2 Antti Koivisto 2017-07-05 10:34:40 PDT
Nice find, r=me
Comment 3 WebKit Commit Bot 2017-07-05 11:01:48 PDT
Comment on attachment 314594 [details]
Patch

Clearing flags on attachment: 314594

Committed r219138: <http://trac.webkit.org/changeset/219138>
Comment 4 WebKit Commit Bot 2017-07-05 11:01:50 PDT
All reviewed patches have been landed.  Closing bug.