Summary: | Introduce Document::body() for call sites interested in the <body> element | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||
Component: | DOM | Assignee: | 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
Chris Dumez
2015-01-26 19:35:52 PST
Created attachment 245404 [details]
Patch
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 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. Created attachment 245418 [details]
Patch
Created attachment 245419 [details]
Patch
Comment on attachment 245419 [details] Patch Clearing flags on attachment: 245419 Committed r179172: <http://trac.webkit.org/changeset/179172> All reviewed patches have been landed. Closing bug. |