Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Issue 889563002: Make RenderObject::style() return a const object (Closed)

Created:
5 years, 10 months ago by Julien - ping for review
Modified:
5 years, 10 months ago
CC:
dstockwell, aandrey+blink_chromium.org, darktears, apavlov+blink_chromium.org, blink-layers+watch_chromium.org, blink-reviews, blink-reviews-animation_chromium.org, blink-reviews-css, blink-reviews-dom_chromium.org, blink-reviews-events_chromium.org, blink-reviews-html_chromium.org, blink-reviews-paint_chromium.org, blink-reviews-rendering, caseq+blink_chromium.org, cbiesinger, chromiumbugtracker_adobe.com, devtools-reviews_chromium.org, dglazkov+blink, Dominik Röttsches, dshwang, krit, eae+blinkwatch, ed+blinkwatch_opera.com, eric.carlson_apple.com, Eric Willigers, eustas+blink_chromium.org, feature-media-reviews_chromium.org, f(malita), fs, gasubic, groby+blinkspell_chromium.org, gyuyoung.kim_webkit.org, jchaffraix+rendering, kenneth.christiansen, kouhei+svg_chromium.org, leviw+renderwatch, loislo+blink_chromium.org, lushnikov+blink_chromium.org, malch+blink_chromium.org, Mike Lawther (Google), paulirish+reviews_chromium.org, pdr+svgwatchlist_chromium.org, pdr+renderingwatchlist_chromium.org, pfeldman+blink_chromium.org, philipj_slow, rjwright, rwlbuis, Stephen Chennney, sergeyv+blink_chromium.org, shans, sof, nessy, slimming-paint-reviews_chromium.org, Steve Block, Timothy Loh, vcarbune.chromium, vsevik+blink_chromium.org, yurys+blink_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Make RenderObject::style() return a const object The current code was sloppy and allowed accidental mutation of RenderStyle outside of style recalc. While this change doesn't fix that class of bugs (as we introduce some mutable accessors), it greatly reduces the risk of them being introduced by mistake. In order to make the change work, 2 fields on RenderStyle had to be made mutable (unique and explicitInheritance) because they are propagated up the tree during style recalc. Also StyleSelectorState had to be changed to store the override parent style independently of the regular parent style. That's required as RefPtr modifies the style by increasing the refCount and we have to hold onto the override as it can be a free style. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=190605

Patch Set 1 #

Patch Set 2 : Blind fix for Mac. #

Total comments: 1

Patch Set 3 : Fix build take II #

Patch Set 4 : Build fix take III (looking at you Mac) #

Patch Set 5 : Fix a crashers (everything is building!) #

Total comments: 10

Patch Set 6 : Updated chagne. #

Patch Set 7 : Rebaselined change. #

Patch Set 8 : Updated patch after splitting #

Total comments: 5

Patch Set 9 : Fixed web/mac/WebSubstringUtil.mm #

Total comments: 6

Patch Set 10 : Updated change after Doug's review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+224 lines, -212 lines) Patch
M Source/core/animation/DocumentAnimations.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/animation/css/CSSAnimations.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/animation/css/CSSAnimations.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/css/CSSGradientValue.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/SelectorChecker.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/css/resolver/ElementResolveContext.h View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/css/resolver/ElementResolveContext.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/resolver/SharedStyleFinder.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 3 4 5 6 7 8 9 8 chunks +9 lines, -9 lines 0 comments Download
M Source/core/css/resolver/StyleResolverState.h View 1 2 3 4 5 6 7 4 chunks +12 lines, -7 lines 0 comments Download
M Source/core/css/resolver/StyleResolverState.cpp View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/css/resolver/ViewportStyleResolver.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Document.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 6 chunks +7 lines, -7 lines 0 comments Download
M Source/core/dom/Element.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 8 9 5 chunks +5 lines, -5 lines 0 comments Download
M Source/core/dom/FirstLetterPseudoElement.cpp View 1 2 3 4 5 6 7 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/dom/Node.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/dom/NodeLayoutStyle.h View 1 2 3 4 5 6 7 2 chunks +8 lines, -3 lines 0 comments Download
M Source/core/dom/PseudoElement.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/RenderTreeBuilder.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -4 lines 0 comments Download
M Source/core/dom/Text.h View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Text.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/dom/TreeScope.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/editing/ApplyBlockElementCommand.cpp View 1 2 3 4 5 6 7 4 chunks +4 lines, -4 lines 0 comments Download
M Source/core/editing/EditorCommand.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/editing/SimplifyMarkupCommand.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/editing/VisibleUnits.cpp View 1 2 3 4 5 6 7 4 chunks +6 lines, -6 lines 0 comments Download
M Source/core/editing/iterators/TextIterator.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/frame/FrameView.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/html/HTMLFormControlElementTest.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLOptionElement.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/forms/InputType.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/shadow/SliderThumbElement.cpp View 1 2 3 4 5 6 7 3 chunks +6 lines, -6 lines 0 comments Download
M Source/core/layout/LayoutMedia.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/layout/LayoutObject.h View 1 2 3 4 5 6 7 8 9 3 chunks +6 lines, -5 lines 0 comments Download
M Source/core/layout/LayoutObject.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +6 lines, -6 lines 0 comments Download
M Source/core/layout/LayoutObjectInlines.h View 1 2 3 4 5 6 7 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/layout/LayoutQuote.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/layout/LayoutSliderContainer.cpp View 1 2 3 4 5 6 7 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/layout/LayoutSliderThumb.cpp View 1 2 3 4 5 6 7 1 chunk +5 lines, -5 lines 0 comments Download
M Source/core/layout/LayoutTextControl.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/layout/LayoutTextControlMultiLine.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/layout/LayoutTextControlSingleLine.cpp View 1 2 3 4 5 6 7 8 9 5 chunks +13 lines, -13 lines 0 comments Download
M Source/core/layout/MultiColumnFragmentainerGroup.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/layout/line/BreakingContextInlineHeaders.h View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/layout/style/LayoutStyle.h View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -4 lines 0 comments Download
M Source/core/layout/style/LayoutStyle.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/page/EventHandler.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/page/TouchAdjustment.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderBlock.cpp View 1 2 3 4 5 6 7 8 9 6 chunks +9 lines, -9 lines 0 comments Download
M Source/core/rendering/RenderCombineText.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderDeprecatedFlexibleBox.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/core/rendering/RenderInline.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderListMarker.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/rendering/RenderMenuList.cpp View 1 2 3 4 5 6 7 8 9 6 chunks +6 lines, -6 lines 0 comments Download
M Source/core/svg/SVGElement.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGElementRareData.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGElementRareData.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGFEFloodElement.cpp View 1 2 3 4 5 6 7 1 chunk +3 lines, -4 lines 0 comments Download
M Source/core/svg/SVGGraphicsElement.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGLengthContext.cpp View 1 2 3 4 5 6 7 8 9 5 chunks +5 lines, -5 lines 0 comments Download
M Source/core/svg/SVGStopElement.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/accessibility/AXRenderObject.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/accessibility/AXSlider.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/modules/accessibility/AXTable.cpp View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -3 lines 0 comments Download
M Source/web/WebFormControlElement.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M Source/web/mac/WebSubstringUtil.mm View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -7 lines 0 comments Download
M Source/web/tests/WebDocumentTest.cpp View 1 2 3 4 5 6 7 4 chunks +6 lines, -6 lines 0 comments Download
M Source/web/tests/WebFrameTest.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 28 (7 generated)
Julien - ping for review
dmazzoni: For modules/accessibility/ rune: For core (and for the core/css/ changes so that you can ...
5 years, 10 months ago (2015-01-29 16:45:46 UTC) #2
dmazzoni
lgtm for modules/accessibility
5 years, 10 months ago (2015-01-29 16:52:14 UTC) #3
andersr
Drive-by review of css/resolver/*: https://codereview.chromium.org/889563002/diff/20001/Source/core/css/resolver/StyleResolver.cpp File Source/core/css/resolver/StyleResolver.cpp (right): https://codereview.chromium.org/889563002/diff/20001/Source/core/css/resolver/StyleResolver.cpp#newcode599 Source/core/css/resolver/StyleResolver.cpp:599: if (RenderStyle* styleOfShadowHost = parent->mutableRenderStyle()) ...
5 years, 10 months ago (2015-01-29 18:10:08 UTC) #5
rune
On 2015/01/29 18:10:08, andersr wrote: > Drive-by review of css/resolver/*: > > https://codereview.chromium.org/889563002/diff/20001/Source/core/css/resolver/StyleResolver.cpp > File ...
5 years, 10 months ago (2015-01-29 18:47:01 UTC) #6
rune
I'm through core/ now. That was a lot of files! I think this is a ...
5 years, 10 months ago (2015-01-29 23:16:32 UTC) #7
rune
"becuase" -> "because" in the description.
5 years, 10 months ago (2015-01-29 23:21:00 UTC) #8
Julien - ping for review
On 2015/01/29 at 23:21:00, rune wrote: > "becuase" -> "because" in the description. Done too. ...
5 years, 10 months ago (2015-02-04 04:53:13 UTC) #9
Julien - ping for review
I should have fixed all the issues from the previous review. The patch also has ...
5 years, 10 months ago (2015-02-10 07:33:20 UTC) #10
rune
https://codereview.chromium.org/889563002/diff/140001/Source/core/layout/LayoutObject.h File Source/core/layout/LayoutObject.h (right): https://codereview.chromium.org/889563002/diff/140001/Source/core/layout/LayoutObject.h#newcode814 Source/core/layout/LayoutObject.h:814: const LayoutStyle& styleRef(bool firstLine) const; Why do you need ...
5 years, 10 months ago (2015-02-10 12:03:01 UTC) #11
rune
On 2015/02/10 at 12:03:01, rune wrote: > https://codereview.chromium.org/889563002/diff/140001/Source/core/layout/LayoutObject.h > File Source/core/layout/LayoutObject.h (right): > > https://codereview.chromium.org/889563002/diff/140001/Source/core/layout/LayoutObject.h#newcode814 ...
5 years, 10 months ago (2015-02-10 12:03:59 UTC) #12
Julien - ping for review
https://codereview.chromium.org/889563002/diff/140001/Source/core/layout/LayoutObject.h File Source/core/layout/LayoutObject.h (right): https://codereview.chromium.org/889563002/diff/140001/Source/core/layout/LayoutObject.h#newcode814 Source/core/layout/LayoutObject.h:814: const LayoutStyle& styleRef(bool firstLine) const; On 2015/02/10 12:03:01, rune ...
5 years, 10 months ago (2015-02-10 23:10:43 UTC) #13
rune
On 2015/02/10 at 23:10:43, jchaffraix wrote: > https://codereview.chromium.org/889563002/diff/140001/Source/core/layout/LayoutObject.h > File Source/core/layout/LayoutObject.h (right): > > https://codereview.chromium.org/889563002/diff/140001/Source/core/layout/LayoutObject.h#newcode814 ...
5 years, 10 months ago (2015-02-10 23:31:20 UTC) #14
rune
On 2015/02/10 at 23:31:20, rune wrote: > lgtm You probably need stamping from someone else ...
5 years, 10 months ago (2015-02-10 23:33:03 UTC) #15
pdr.
Source/web LGTM +cc dstockwell, mikelawther. Could you please wait for an LGTM from them as ...
5 years, 10 months ago (2015-02-18 22:30:57 UTC) #17
dstockwell
lgtm Would also like to see a list of what could be improved in the ...
5 years, 10 months ago (2015-02-19 00:41:51 UTC) #18
Julien - ping for review
> Would also like to see a list of what could be improved in the ...
5 years, 10 months ago (2015-02-19 21:04:14 UTC) #20
dstockwell
lgtm https://codereview.chromium.org/889563002/diff/160001/Source/core/css/resolver/StyleResolverState.h File Source/core/css/resolver/StyleResolverState.h (left): https://codereview.chromium.org/889563002/diff/160001/Source/core/css/resolver/StyleResolverState.h#oldcode165 Source/core/css/resolver/StyleResolverState.h:165: RefPtr<LayoutStyle> m_parentStyle; On 2015/02/19 21:04:13, Julien Chaffraix - ...
5 years, 10 months ago (2015-02-19 23:11:19 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/889563002/180001
5 years, 10 months ago (2015-02-20 00:09:26 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_dbg on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_blink_dbg/builds/46049)
5 years, 10 months ago (2015-02-20 03:42:24 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/889563002/180001
5 years, 10 months ago (2015-02-20 22:32:24 UTC) #27
commit-bot: I haz the power
5 years, 10 months ago (2015-02-21 00:41:54 UTC) #28
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=190605

Powered by Google App Engine
This is Rietveld 408576698