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

Issue 23956012: Stop passing NodeRenderingContext except in textRendererIsNeeded (Closed)

Created:
7 years, 3 months ago by esprehn
Modified:
7 years, 3 months ago
Reviewers:
ojan, eseidel
CC:
blink-reviews, shans, webcomponents-bugzilla_chromium.org, eae+blinkwatch, apavlov+blink_chromium.org, adamk+blink_chromium.org, pdr, Steve Block, dino_apple.com, alancutter (OOO until 2018), dglazkov+blink, dstockwell, Timothy Loh, Eric Willigers, nessy, rjwright, feature-media-reviews_chromium.org, darktears, vcarbune.chromium, chromiumbugtracker_adobe.com, Mike Lawther (Google), f(malita), Stephen Chennney
Visibility:
Public.

Description

Stop passing NodeRenderingContext except in textRendererIsNeeded We don't need the NodeRenderingContext in childShouldCreateRenderer or rendererIsNeeded, we only need the node or the style so pass them explicitly. This makes textRendererIsNeeded the only place we pass the NodeRenderingContext. Future patches should be able to clean that up allowing NodeRenderingContext to only be the creator of renderers and not a multi-purpose bag of things. This also changes both methods to take a Node& or a RenderStyle& instead of pointers so users of these APIs know the values can never be null. Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157424

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+199 lines, -215 lines) Patch
M Source/core/css/resolver/StyleResolver.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/dom/ContainerNode.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Element.h View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/dom/Element.cpp View 2 chunks +6 lines, -6 lines 0 comments Download
M Source/core/dom/NodeRenderingContext.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M Source/core/dom/PseudoElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/PseudoElement.cpp View 2 chunks +2 lines, -3 lines 0 comments Download
M Source/core/dom/shadow/InsertionPoint.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/shadow/InsertionPoint.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLAppletElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLAppletElement.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLDetailsElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLDetailsElement.cpp View 2 chunks +5 lines, -5 lines 0 comments Download
M Source/core/html/HTMLElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLElement.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLEmbedElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLEmbedElement.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/html/HTMLFormElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLFormElement.cpp View 3 chunks +4 lines, -4 lines 0 comments Download
M Source/core/html/HTMLFrameElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLFrameElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLFrameSetElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLFrameSetElement.cpp View 2 chunks +2 lines, -3 lines 0 comments Download
M Source/core/html/HTMLIFrameElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLIFrameElement.cpp View 2 chunks +2 lines, -3 lines 0 comments Download
M Source/core/html/HTMLInputElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLInputElement.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLMediaElement.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLMediaElement.cpp View 3 chunks +4 lines, -5 lines 0 comments Download
M Source/core/html/HTMLMeterElement.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/HTMLObjectElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLObjectElement.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLOptGroupElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLOptionElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLProgressElement.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/HTMLSelectElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLSelectElement.cpp View 2 chunks +3 lines, -4 lines 0 comments Download
M Source/core/html/HTMLSummaryElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLTextFormControlElement.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/html/HTMLVideoElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLVideoElement.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/shadow/DetailsMarkerControl.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/shadow/DetailsMarkerControl.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/shadow/MeterShadowElement.h View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/shadow/MeterShadowElement.cpp View 2 chunks +7 lines, -7 lines 0 comments Download
M Source/core/html/shadow/ProgressShadowElement.h View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/html/shadow/ProgressShadowElement.cpp View 2 chunks +5 lines, -5 lines 0 comments Download
M Source/core/svg/SVGAElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGAElement.cpp View 2 chunks +4 lines, -5 lines 0 comments Download
M Source/core/svg/SVGAltGlyphDefElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGAltGlyphElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGAltGlyphElement.cpp View 2 chunks +2 lines, -3 lines 0 comments Download
M Source/core/svg/SVGAltGlyphItemElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGComponentTransferFunctionElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGCursorElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGDescElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGDocument.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGDocument.cpp View 2 chunks +3 lines, -4 lines 0 comments Download
M Source/core/svg/SVGElement.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGElement.cpp View 5 chunks +5 lines, -6 lines 0 comments Download
M Source/core/svg/SVGFELightElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGFEMergeNodeElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGFilterElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGFilterElement.cpp View 2 chunks +3 lines, -4 lines 0 comments Download
M Source/core/svg/SVGFilterPrimitiveStandardAttributes.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGFontElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGFontFaceElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGFontFaceFormatElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGFontFaceNameElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGFontFaceSrcElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGFontFaceUriElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGForeignObjectElement.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGForeignObjectElement.cpp View 3 chunks +6 lines, -7 lines 0 comments Download
M Source/core/svg/SVGGElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGGElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGGlyphElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGGlyphRefElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGHKernElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGMPathElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGMarkerElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGMetadataElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGMissingGlyphElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGSVGElement.h View 2 chunks +7 lines, -2 lines 0 comments Download
M Source/core/svg/SVGSVGElement.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGScriptElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGStopElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGStopElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGStyleElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGSwitchElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGSwitchElement.cpp View 3 chunks +2 lines, -3 lines 0 comments Download
M Source/core/svg/SVGTRefElement.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGTRefElement.cpp View 3 chunks +4 lines, -5 lines 0 comments Download
M Source/core/svg/SVGTSpanElement.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGTSpanElement.cpp View 3 chunks +8 lines, -9 lines 0 comments Download
M Source/core/svg/SVGTextElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGTextElement.cpp View 2 chunks +7 lines, -8 lines 0 comments Download
M Source/core/svg/SVGTextPathElement.h View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/svg/SVGTextPathElement.cpp View 2 chunks +7 lines, -8 lines 0 comments Download
M Source/core/svg/SVGTitleElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGUnknownElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGVKernElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGViewElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/animation/SVGSMILElement.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/testing/Internals.cpp View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 6 (0 generated)
esprehn
7 years, 3 months ago (2013-09-08 21:49:51 UTC) #1
ojan
lgtm
7 years, 3 months ago (2013-09-08 23:07:57 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/esprehn@chromium.org/23956012/1
7 years, 3 months ago (2013-09-08 23:08:04 UTC) #3
commit-bot: I haz the power
Change committed as 157424
7 years, 3 months ago (2013-09-09 00:11:01 UTC) #4
eseidel
I have mixed feelings about passing RefCounted subclasses by reference. :shrug:
7 years, 3 months ago (2013-09-09 03:13:48 UTC) #5
esprehn
7 years, 3 months ago (2013-09-09 04:45:20 UTC) #6
Message was sent while issue was closed.
On 2013/09/09 03:13:48, eseidel wrote:
> I have mixed feelings about passing RefCounted subclasses by reference.
> 
> :shrug:

I'm actually not a fan of it either, but adamk and others had expressed interest
in making it more clear when things couldn't be null by using references.

I'd actually be more interested in adding something like NotNull<T> and then
using that for these kinds of things. Then Node::document() would return
NotNull<Document> which overloads -> and has .get() and the normal RefPtr like
things but doesn't overload operator! so you can't null check it. That would
make things like node->document() == node->document() sensible since you
wouldn't need ampersands on both sides.

Powered by Google App Engine
This is Rietveld 408576698