Bug 140920

Summary: Introduce Document::body() for call sites interested in the <body> element
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: DOMAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, kling, koivisto
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Chris Dumez
Reported 2015-01-26 19:35:52 PST
Introduce Document::body() for call sites interested in the <body> element only (not <frameset> like Document::bodyOrFrameset() does).
Attachments
Patch (26.89 KB, patch)
2015-01-26 19:53 PST, Chris Dumez
no flags
Patch (26.86 KB, patch)
2015-01-26 21:53 PST, Chris Dumez
no flags
Patch (26.13 KB, patch)
2015-01-26 21:56 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2015-01-26 19:53:35 PST
Darin Adler
Comment 2 2015-01-26 21:41:57 PST
Comment on attachment 245404 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245404&action=review > Source/WebCore/rendering/RenderLayerBacking.cpp:1793 > + auto* rootObject = renderer().document().documentElement() ? renderer().document().documentElement()->renderer() : nullptr; Surprised you didn’t add a local variable for documentElement here given what you did everywhere else > Source/WebCore/rendering/RenderLayerBacking.cpp:1806 > + auto* bodyRenderer = body ? body->renderer() : nullptr; > + if (!bodyRenderer) > return false; Could just return false one more time a line earlier instead of using ? : here
Chris Dumez
Comment 3 2015-01-26 21:50:03 PST
Comment on attachment 245404 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245404&action=review >> Source/WebCore/rendering/RenderLayerBacking.cpp:1793 >> + auto* rootObject = renderer().document().documentElement() ? renderer().document().documentElement()->renderer() : nullptr; > > Surprised you didn’t add a local variable for documentElement here given what you did everywhere else documentElement() is a trivial getter. I cached the return value of body() and bodyOrFrameset() because those do tree traversal. >> Source/WebCore/rendering/RenderLayerBacking.cpp:1806 >> return false; > > Could just return false one more time a line earlier instead of using ? : here Ok.
Chris Dumez
Comment 4 2015-01-26 21:53:10 PST
Chris Dumez
Comment 5 2015-01-26 21:56:16 PST
WebKit Commit Bot
Comment 6 2015-01-26 23:05:10 PST
Comment on attachment 245419 [details] Patch Clearing flags on attachment: 245419 Committed r179172: <http://trac.webkit.org/changeset/179172>
WebKit Commit Bot
Comment 7 2015-01-26 23:05:16 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.