Bug 156672 - Element should be const in StyleResolver
Summary: Element should be const in StyleResolver
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-16 23:23 PDT by Antti Koivisto
Modified: 2016-04-29 14:11 PDT (History)
3 users (show)

See Also:


Attachments
patch (95.79 KB, patch)
2016-04-16 23:39 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (97.17 KB, patch)
2016-04-17 00:03 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (102.41 KB, patch)
2016-04-17 00:36 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (106.11 KB, patch)
2016-04-17 01:00 PDT, Antti Koivisto
no flags Details | Formatted Diff | Diff
patch (106.47 KB, patch)
2016-04-17 01:23 PDT, Antti Koivisto
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (1.46 MB, application/zip)
2016-04-17 02:10 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews121 for ios-simulator-wk2 (1.77 MB, application/zip)
2016-04-17 02:16 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews112 for mac-yosemite (1.39 MB, application/zip)
2016-04-17 02:26 PDT, Build Bot
no flags Details
patch (106.49 KB, patch)
2016-04-17 02:31 PDT, Antti Koivisto
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2016-04-16 23:23:12 PDT
Resolving element style shouldn't mutate it.
Comment 1 Antti Koivisto 2016-04-16 23:39:14 PDT
Created attachment 276580 [details]
patch
Comment 2 Antti Koivisto 2016-04-17 00:03:16 PDT
Created attachment 276581 [details]
patch
Comment 3 Antti Koivisto 2016-04-17 00:36:37 PDT
Created attachment 276582 [details]
patch
Comment 4 Antti Koivisto 2016-04-17 01:00:49 PDT
Created attachment 276583 [details]
patch
Comment 5 Antti Koivisto 2016-04-17 01:23:03 PDT
Created attachment 276584 [details]
patch
Comment 6 Build Bot 2016-04-17 02:10:30 PDT
Comment on attachment 276584 [details]
patch

Attachment 276584 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1173081

New failing tests:
imported/blink/fast/css3-text/css3-text-decoration/stable/first-letter-text-decoration.html
fast/text/text-underline-first-line-decoration.html
fast/text/text-underline-vertical-first-line-decoration.html
fast/css/text-decorations-on-first-line-and-containing-block.html
Comment 7 Build Bot 2016-04-17 02:10:33 PDT
Created attachment 276585 [details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 8 Build Bot 2016-04-17 02:16:13 PDT
Comment on attachment 276584 [details]
patch

Attachment 276584 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1173080

New failing tests:
imported/blink/fast/css3-text/css3-text-decoration/stable/first-letter-text-decoration.html
fast/text/text-underline-first-line-decoration.html
fast/text/text-underline-vertical-first-line-decoration.html
fast/css/text-decorations-on-first-line-and-containing-block.html
Comment 9 Build Bot 2016-04-17 02:16:15 PDT
Created attachment 276586 [details]
Archive of layout-test-results from ews121 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121  Port: ios-simulator-wk2  Platform: Mac OS X 10.10.5
Comment 10 Build Bot 2016-04-17 02:26:24 PDT
Comment on attachment 276584 [details]
patch

Attachment 276584 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1173107

New failing tests:
imported/blink/fast/css3-text/css3-text-decoration/stable/first-letter-text-decoration.html
fast/text/text-underline-first-line-decoration.html
fast/text/text-underline-vertical-first-line-decoration.html
fast/css/text-decorations-on-first-line-and-containing-block.html
Comment 11 Build Bot 2016-04-17 02:26:27 PDT
Created attachment 276587 [details]
Archive of layout-test-results from ews112 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 12 Antti Koivisto 2016-04-17 02:31:24 PDT
Created attachment 276588 [details]
patch
Comment 13 Darin Adler 2016-04-17 09:24:08 PDT
Comment on attachment 276588 [details]
patch

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

I assume the idea here is to use const to sort of mean "DOM mutation forbidden".

> Source/WebCore/ChangeLog:10
> +        This patch just does Element* -> const Element*, all the groundwork has beend done already.

Typo: beend

> Source/WebCore/css/StyleResolver.cpp:761
> +void StyleResolver::adjustRenderStyle(RenderStyle& style, const RenderStyle& parentStyle, const Element *element)

Space should be after the *, not before it.

> Source/WebCore/rendering/RenderThemeIOS.mm:628
>      else if (element->hasTagName(HTMLNames::inputTag))
> -        adjustInputElementButtonStyle(style, static_cast<HTMLInputElement&>(*element));
> +        adjustInputElementButtonStyle(style, downcast<HTMLInputElement>(*element));

Should also use is<HTMLInputElement> instead of hasTagName(HTMLNames::inputTag).
Comment 14 Antti Koivisto 2016-04-17 10:43:11 PDT
> I assume the idea here is to use const to sort of mean "DOM mutation
> forbidden".

Yes, minus the "sort of". Also compile-time check that that is indeed true.
Comment 15 Antti Koivisto 2016-04-17 10:57:26 PDT
http://trac.webkit.org/changeset/199640
Comment 16 Simon Fraser (smfr) 2016-04-29 14:11:38 PDT
This caused bug 157199