RESOLVED FIXED Bug 110995
[css exclusions] Move ExclusionShapeInsideInfo into RenderBlockRareData
https://bugs.webkit.org/show_bug.cgi?id=110995
Summary [css exclusions] Move ExclusionShapeInsideInfo into RenderBlockRareData
Bear Travis
Reported 2013-02-27 11:10:18 PST
If we move the shape info into the rare data construct, we can avoid creating and checking the map. This will also help with bug 108128, which relies on keeping shape info around for one more layout pass after the style has been changed.
Attachments
Initial Patch (6.63 KB, patch)
2013-02-27 11:20 PST, Bear Travis
no flags
Update (6.69 KB, patch)
2013-02-27 11:37 PST, Bear Travis
no flags
Update (6.34 KB, patch)
2013-02-27 12:03 PST, Bear Travis
no flags
Removing 0 for null pointer (6.37 KB, patch)
2013-02-27 15:13 PST, Bear Travis
no flags
Incorporating feedback (10.88 KB, patch)
2013-03-01 00:04 PST, Bear Travis
jchaffraix: review+
Making final adjustments (10.41 KB, patch)
2013-03-01 16:14 PST, Bear Travis
webkit-ews: commit-queue-
Changing 0 to nullptr (10.42 KB, patch)
2013-03-01 16:44 PST, Bear Travis
no flags
Making RenderBlockRareData public (11.48 KB, patch)
2013-03-11 16:47 PDT, Bear Travis
no flags
Bear Travis
Comment 1 2013-02-27 11:20:32 PST
Created attachment 190560 [details] Initial Patch
Early Warning System Bot
Comment 2 2013-02-27 11:29:07 PST
Early Warning System Bot
Comment 3 2013-02-27 11:29:12 PST
Bear Travis
Comment 4 2013-02-27 11:37:51 PST
Created attachment 190565 [details] Update Wrapping some code in compiler guards for the non-enabled case.
Early Warning System Bot
Comment 5 2013-02-27 11:45:38 PST
Early Warning System Bot
Comment 6 2013-02-27 11:50:45 PST
EFL EWS Bot
Comment 7 2013-02-27 12:01:25 PST
Bear Travis
Comment 8 2013-02-27 12:03:06 PST
Created attachment 190570 [details] Update Removing unnecessary initialization in RenderBlockRareData.
Early Warning System Bot
Comment 9 2013-02-27 12:10:09 PST
Early Warning System Bot
Comment 10 2013-02-27 12:10:56 PST
WebKit Review Bot
Comment 11 2013-02-27 12:20:24 PST
Comment on attachment 190570 [details] Update Attachment 190570 [details] did not pass chromium-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/16753083
WebKit Review Bot
Comment 12 2013-02-27 13:16:17 PST
Comment on attachment 190570 [details] Update Attachment 190570 [details] did not pass cr-linux-debug-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/16807301
Bear Travis
Comment 13 2013-02-27 15:13:19 PST
Created attachment 190614 [details] Removing 0 for null pointer
Julien Chaffraix
Comment 14 2013-02-28 16:53:40 PST
Comment on attachment 190614 [details] Removing 0 for null pointer View in context: https://bugs.webkit.org/attachment.cgi?id=190614&action=review The change is going in the right direction but I think we can do better. > Source/WebCore/rendering/RenderBlock.cpp:1394 > + return m_rareData && m_rareData->m_shapeInsideInfo && ExclusionShapeInsideInfo::isEnabledFor(this) ? static_cast<ExclusionShapeInsideInfo*>(m_rareData->m_shapeInsideInfo.get()) : 0; This is a downcast thus very nasty, especially if you don't check what you are doing casting. > Source/WebCore/rendering/RenderBlock.h:442 > ExclusionShapeInsideInfo* exclusionShapeInsideInfo() const; > + ExclusionShapeInsideInfo* rawExclusionShapeInsideInfo() const; Those 2 functions are extremely similar in name and functionality. It looks like the only place where the new function is used is updateExclusionShapeInsideInfoAfterStyleChange. How about using a pattern in the code where you have a function called: ensureExclusionShapeInsideInfo(); That would do the checks and create the required classes if needed. > Source/WebCore/rendering/RenderBlock.h:1232 > + OwnPtr<ExclusionShapeInfo<RenderBlock, &RenderStyle::resolvedShapeInside> > m_shapeInsideInfo; Couldn't you store an ExclusionShapeInsideInfo here to avoid the cast when getting the value back?
Bear Travis
Comment 15 2013-03-01 00:04:22 PST
Created attachment 190895 [details] Incorporating feedback Based on feedback from jchaffraix, I have moved to remove the static casting by getting rid of the cirular depencency on InlineIterator that made it necessary. I have also changed rawExclusionShapeInsideInfo to ensureExclusionShapeInsideInfo.
Julien Chaffraix
Comment 16 2013-03-01 15:08:49 PST
Comment on attachment 190895 [details] Incorporating feedback View in context: https://bugs.webkit.org/attachment.cgi?id=190895&action=review > Source/WebCore/rendering/ExclusionShapeInsideInfo.cpp:43 > + { } AFAICT this should be on 2 lines. Though I don't think it's a style violation, just the more usual way so it's probably a 'nit'. > Source/WebCore/rendering/ExclusionShapeInsideInfo.h:45 > +struct LineSegmentIterator { Not a super fan of the new Iterator to break a circular dependency but I couldn't think of something smarter. > Source/WebCore/rendering/ExclusionShapeInsideInfo.h:53 > + { } Same comment about this being on 2 lines here. > Source/WebCore/rendering/RenderBlock.cpp:1404 > - ExclusionShapeInsideInfo::removeInfo(this); > + setExclusionShapeInsideInfo(PassOwnPtr<ExclusionShapeInsideInfo>()); The way you instantiate the PassOwnPtr is weird. setExclusionShapeInsideInfo(0); should work (using the PassOwnPtr(T*) constructor). > Source/WebCore/rendering/RenderBlock.h:454 > + if (!m_rareData) > + m_rareData = adoptPtr(new RenderBlockRareData(this)); > + if (!m_rareData->m_shapeInsideInfo) > + m_rareData->m_shapeInsideInfo = ExclusionShapeInsideInfo::createInfo(this); if (!m_rareData || !m_rareData->m_shapeInsideInfo) setExclusionShapeInsideInfo(ExclusionShapeInsideInfo::createInfo(this));
Bear Travis
Comment 17 2013-03-01 16:14:24 PST
Created attachment 191062 [details] Making final adjustments
Early Warning System Bot
Comment 18 2013-03-01 16:23:58 PST
Comment on attachment 191062 [details] Making final adjustments Attachment 191062 [details] did not pass qt-ews (qt): Output: http://webkit-commit-queue.appspot.com/results/16796263
Early Warning System Bot
Comment 19 2013-03-01 16:28:46 PST
Comment on attachment 191062 [details] Making final adjustments Attachment 191062 [details] did not pass qt-wk2-ews (qt): Output: http://webkit-commit-queue.appspot.com/results/16687593
EFL EWS Bot
Comment 20 2013-03-01 16:35:53 PST
Comment on attachment 191062 [details] Making final adjustments Attachment 191062 [details] did not pass efl-ews (efl): Output: http://webkit-commit-queue.appspot.com/results/16794285
WebKit Review Bot
Comment 21 2013-03-01 16:40:44 PST
Comment on attachment 191062 [details] Making final adjustments Attachment 191062 [details] did not pass cr-linux-debug-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/16687597
Bear Travis
Comment 22 2013-03-01 16:44:29 PST
Created attachment 191069 [details] Changing 0 to nullptr
WebKit Review Bot
Comment 23 2013-03-01 17:18:28 PST
Comment on attachment 191069 [details] Changing 0 to nullptr Clearing flags on attachment: 191069 Committed r144520: <http://trac.webkit.org/changeset/144520>
WebKit Review Bot
Comment 24 2013-03-01 17:18:33 PST
All reviewed patches have been landed. Closing bug.
Adam Barth
Comment 25 2013-03-03 00:18:57 PST
Re-opened since this is blocked by bug 111261
Ryosuke Niwa
Comment 26 2013-03-03 00:36:29 PST
Comment #2 From Adam Barth 2013-03-03 00:22:53 PST (-) [reply] 179>C:\b\build\slave\webkit-win-latest-rel\build\src\third_party\WebKit\Source\WTF\wtf/OwnPtrCommon.h(63):error C2248: 'WebCore::RenderBlock::RenderBlockRareData' : cannot access protected struct declared in class 'WebCore::RenderBlock' 179> c:\b\build\slave\webkit-win-latest-rel\build\src\third_party\webkit\source\webcore\rendering\RenderBlock.h(1214) : see declaration of 'WebCore::RenderBlock::RenderBlockRareData' 179> c:\b\build\slave\webkit-win-latest-rel\build\src\third_party\webkit\source\webcore\rendering\RenderBlock.h(83) : see declaration of 'WebCore::RenderBlock' 179> C:\b\build\slave\webkit-win-latest-rel\build\src\third_party\WebKit\Source\WTF\wtf/PassOwnPtr.h(56) : see reference to function template instantiation 'void WTF::deleteOwnedPtr<WebCore::RenderBlock::RenderBlockRareData>(T *)' being compiled 179> with 179> [ 179> T=WebCore::RenderBlock::RenderBlockRareData 179> ] 179> C:\b\build\slave\webkit-win-latest-rel\build\src\third_party\WebKit\Source\WTF\wtf/PassOwnPtr.h(56) : while compiling class template member function 'WTF::PassOwnPtr<T>::~PassOwnPtr(void)' 179> with 179> [ 179> T=WebCore::RenderBlock::RenderBlockRareData 179> ] 179> c:\b\build\slave\webkit-win-latest-rel\build\src\third_party\webkit\source\webcore\rendering\RenderBlock.h(336) : see reference to class template instantiation 'WTF::PassOwnPtr<T>' being compiled 179> with 179> [ 179> T=WebCore::RenderBlock::RenderBlockRareData 179> ] Comment #3 From Adam Barth 2013-03-03 00:23:19 PST (-) [reply] See. for example, http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Win%20Builder/builds/36652/steps/compile/logs/stdio#error1 Comment #4 From Adam Barth 2013-03-03 00:35:33 PST (-) [reply] (From update of attachment 191129 [details]) Clearing flags on attachment: 191129 Committed r144561: <http://trac.webkit.org/changeset/144561>
Bear Travis
Comment 27 2013-03-11 16:47:28 PDT
Created attachment 192593 [details] Making RenderBlockRareData public The compiler for cr-win requires a public struct definition in order to properly instantiate OwnPtr<RenderBlockRareData>.
Bear Travis
Comment 28 2013-03-12 15:43:06 PDT
Comment on attachment 192593 [details] Making RenderBlockRareData public Moving back to the commit queue. Should fix the cr-win build failure.
WebKit Review Bot
Comment 29 2013-03-12 16:29:47 PDT
Comment on attachment 192593 [details] Making RenderBlockRareData public Clearing flags on attachment: 192593 Committed r145610: <http://trac.webkit.org/changeset/145610>
WebKit Review Bot
Comment 30 2013-03-12 16:29:53 PDT
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.