Bug 152786 - Factor free standing tree style resolve functions into a class
Summary: Factor free standing tree style resolve functions into a class
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-06 07:19 PST by Antti Koivisto
Modified: 2016-01-07 00:21 PST (History)
8 users (show)

See Also:


Attachments
patch (27.37 KB, patch)
2016-01-06 08:01 PST, Antti Koivisto
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (3.84 MB, application/zip)
2016-01-06 08:49 PST, Build Bot
no flags Details
Archive of layout-test-results from ews107 for mac-yosemite-wk2 (3.06 MB, application/zip)
2016-01-06 08:52 PST, Build Bot
no flags Details
Archive of layout-test-results from ews114 for mac-yosemite (3.95 MB, application/zip)
2016-01-06 08:54 PST, Build Bot
no flags Details
patch (28.55 KB, patch)
2016-01-06 12:52 PST, Antti Koivisto
sam: review+
Details | Formatted Diff | Diff
now including file renames due to popular demand (116.15 KB, patch)
2016-01-06 13:52 PST, Antti Koivisto
simon.fraser: 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-01-06 07:19:41 PST
Add a class for resolving style for a document tree. This will enable future features and optimizations.
Comment 1 Antti Koivisto 2016-01-06 08:01:55 PST
Created attachment 268367 [details]
patch
Comment 2 Build Bot 2016-01-06 08:49:01 PST
Comment on attachment 268367 [details]
patch

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

New failing tests:
printing/compositing-layer-printing.html
printing/setPrinting.html
printing/simple-lines-break.html
printing/width-overflow.html
printing/page-rule-in-media-query.html
Comment 3 Build Bot 2016-01-06 08:49:05 PST
Created attachment 268368 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 4 Build Bot 2016-01-06 08:52:48 PST
Comment on attachment 268367 [details]
patch

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

New failing tests:
printing/page-rule-in-media-query.html
fast/css/scrollbar-dynamic-style-change.html
printing/simple-lines-break.html
printing/width-overflow.html
printing/setPrinting.html
printing/compositing-layer-printing.html
Comment 5 Build Bot 2016-01-06 08:52:51 PST
Created attachment 268369 [details]
Archive of layout-test-results from ews107 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews107  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 6 Build Bot 2016-01-06 08:54:00 PST
Comment on attachment 268367 [details]
patch

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

New failing tests:
printing/compositing-layer-printing.html
printing/page-rule-in-media-query.html
printing/simple-lines-break.html
printing/width-overflow.html
printing/setPrinting.html
Comment 7 Build Bot 2016-01-06 08:54:04 PST
Created attachment 268370 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 8 Simon Fraser (smfr) 2016-01-06 10:34:54 PST
Comment on attachment 268367 [details]
patch

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

> Source/WebCore/style/StyleResolveTree.h:50
> +class TreeResolver {

It's odd that the filename and class name don't match. It think you should rename one of them.

> Source/WebCore/style/StyleResolveTree.h:59
> +    void resolveShadowTree(Change, RenderStyle& inheritedStyle);

Unclear from the signature whether inheritedStyle is 'in' or 'out'.

> Source/WebCore/style/StyleResolveTree.h:61
> +    Ref<RenderStyle> styleForElement(Element&, RenderStyle& inheritedStyle);

Ditto. Can inheritedStyle be const? Can Element& be const? Same for most of the other functions.
Comment 9 Antti Koivisto 2016-01-06 11:49:55 PST
> It's odd that the filename and class name don't match. It think you should
> rename one of them.

I'm going to do renames separately.

> Ditto. Can inheritedStyle be const? Can Element& be const? Same for most of
> the other functions.

They should probably be const but that will require lots of changes (without introducing const_cast). It's better done separately.
Comment 10 Antti Koivisto 2016-01-06 12:52:18 PST
Created attachment 268392 [details]
patch
Comment 11 Dave Hyatt 2016-01-06 13:07:05 PST
Weird that the file name is StyleResolveTree, but the class name is TreeResolver. These should match.

I also don't think a Style namespace adds anything here. Just calling the class StyleTreeResolver is fine IMO.
Comment 12 Simon Fraser (smfr) 2016-01-06 13:09:14 PST
(In reply to comment #9)
> > It's odd that the filename and class name don't match. It think you should
> > rename one of them.
> 
> I'm going to do renames separately.
> 
> > Ditto. Can inheritedStyle be const? Can Element& be const? Same for most of
> > the other functions.
> 
> They should probably be const but that will require lots of changes (without
> introducing const_cast). It's better done separately.

These seem like two good changes to make before doing this one.
Comment 13 Antti Koivisto 2016-01-06 13:18:09 PST
> These seem like two good changes to make before doing this one.

Does the order really matter? There are many many things to improve here. I'd like to make progress.
Comment 14 Sam Weinig 2016-01-06 13:50:54 PST
Comment on attachment 268392 [details]
patch

I think either order is fine.
Comment 15 Antti Koivisto 2016-01-06 13:52:53 PST
Created attachment 268401 [details]
now including file renames due to popular demand
Comment 16 WebKit Commit Bot 2016-01-06 13:55:41 PST
Attachment 268401 [details] did not pass style-queue:


ERROR: Source/WebCore/style/StyleTreeResolver.cpp:56:  "CSSFontSelector.h" already included at Source/WebCore/style/StyleTreeResolver.cpp:32  [build/include] [4]
ERROR: Source/WebCore/style/StyleTreeResolver.cpp:221:  Multi line control clauses should use braces.  [whitespace/braces] [4]
ERROR: Source/WebCore/style/StyleTreeResolver.cpp:858:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/style/StyleTreeResolver.cpp:860:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/style/StyleTreeResolver.cpp:864:  Extra space before ( in function call  [whitespace/parens] [4]
ERROR: Source/WebCore/style/StyleTreeResolver.cpp:878:  Missing space before {  [whitespace/braces] [5]
ERROR: Source/WebCore/style/StyleTreeResolver.h:26:  #ifndef header guard has wrong style, please use: StyleTreeResolver_h  [build/header_guard] [5]
ERROR: Source/WebCore/style/StyleTreeResolver.h:92:  Extra space before ( in function call  [whitespace/parens] [4]
Total errors found: 8 in 14 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 17 Antti Koivisto 2016-01-07 00:21:44 PST
https://trac.webkit.org/r194691