REOPENED 145831
Use modern for-loops in WebCore/rendering - 1
https://bugs.webkit.org/show_bug.cgi?id=145831
Summary Use modern for-loops in WebCore/rendering - 1
Hunseop Jeong
Reported 2015-06-09 18:43:32 PDT
Use modern for-loops in WebCore/rendering - 1 of 2
Attachments
Patch (84.03 KB, patch)
2015-06-09 21:20 PDT, Hunseop Jeong
no flags
Archive of layout-test-results from ews100 for mac-mavericks (420.65 KB, application/zip)
2015-06-09 21:34 PDT, Build Bot
no flags
Patch (84.04 KB, patch)
2015-06-09 21:35 PDT, Hunseop Jeong
no flags
Patch (84.14 KB, patch)
2015-06-12 02:51 PDT, Hunseop Jeong
no flags
Patch (84.12 KB, patch)
2015-06-15 02:38 PDT, Hunseop Jeong
no flags
Hunseop Jeong
Comment 1 2015-06-09 21:20:51 PDT
WebKit Commit Bot
Comment 2 2015-06-09 21:23:11 PDT
Attachment 254626 [details] did not pass style-queue: ERROR: Source/WebCore/rendering/RenderBlock.cpp:1312: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/WebCore/rendering/RenderBlock.cpp:1323: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 2 in 22 files If any of these errors are false positives, please file a bug against check-webkit-style.
Build Bot
Comment 3 2015-06-09 21:34:54 PDT
Comment on attachment 254626 [details] Patch Attachment 254626 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/5843822420426752 Number of test failures exceeded the failure limit.
Build Bot
Comment 4 2015-06-09 21:34:57 PDT
Created attachment 254627 [details] Archive of layout-test-results from ews100 for mac-mavericks The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews100 Port: mac-mavericks Platform: Mac OS X 10.9.5
Hunseop Jeong
Comment 5 2015-06-09 21:35:25 PDT
WebKit Commit Bot
Comment 6 2015-06-09 21:38:19 PDT
Attachment 254628 [details] did not pass style-queue: ERROR: Source/WebCore/rendering/RenderBlock.cpp:1312: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/WebCore/rendering/RenderBlock.cpp:1323: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 2 in 22 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 7 2015-06-11 10:29:32 PDT
Comment on attachment 254628 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=254628&action=review que > Source/WebCore/rendering/FloatingObjects.cpp:270 > + ASSERT(!(floatingObject->originatingLine()) || &(floatingObject->originatingLine()->renderer()) == &m_renderer); The extra parentheses here make this harder to read for those used to WebKit coding style. Please write without them. ASSERT(!floatingObject->originatingLine() || &floatingObject->originatingLine()->renderer() == &m_renderer); > Source/WebCore/rendering/FloatingObjects.cpp:271 > + floatingObject->setOriginatingLine(0); Please use nullptr. > Source/WebCore/rendering/RenderBlock.cpp:196 > if (std::unique_ptr<TrackedRendererListHashSet> descendantSet = descendantMap->take(block)) { Should really use auto here instead of that long type! > Source/WebCore/rendering/RenderBlock.cpp:198 > + TrackedContainerMap::iterator it = containerMap->find(box); Better to use auto here. > Source/WebCore/rendering/RenderBlock.cpp:3728 > + for (auto& currBox : *positionedDescendantSet) I would call this just "box" rather than "currBox" to avoid the pointless abbreviation.
Simon Fraser (smfr)
Comment 8 2015-06-11 10:34:11 PDT
I think we need to start ramping down on changes like this, since this time of year is a stabilization period for Apple.
Darin Adler
Comment 9 2015-06-11 10:50:59 PDT
(In reply to comment #8) > I think we need to start ramping down on changes like this, since this time > of year is a stabilization period for Apple. I understand your point. Our main tool for that is branching, though.
Darin Adler
Comment 10 2015-06-11 10:56:30 PDT
But I will probably slow down on reviewing these kinds of patches.
Hunseop Jeong
Comment 11 2015-06-12 02:51:25 PDT
Hunseop Jeong
Comment 12 2015-06-12 02:53:26 PDT
(In reply to comment #7) > Comment on attachment 254628 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=254628&action=review > > que > > > Source/WebCore/rendering/FloatingObjects.cpp:270 > > + ASSERT(!(floatingObject->originatingLine()) || &(floatingObject->originatingLine()->renderer()) == &m_renderer); > > The extra parentheses here make this harder to read for those used to WebKit > coding style. Please write without them. > > ASSERT(!floatingObject->originatingLine() || > &floatingObject->originatingLine()->renderer() == &m_renderer); > > > Source/WebCore/rendering/FloatingObjects.cpp:271 > > + floatingObject->setOriginatingLine(0); > > Please use nullptr. > > > Source/WebCore/rendering/RenderBlock.cpp:196 > > if (std::unique_ptr<TrackedRendererListHashSet> descendantSet = descendantMap->take(block)) { > > Should really use auto here instead of that long type! > > > Source/WebCore/rendering/RenderBlock.cpp:198 > > + TrackedContainerMap::iterator it = containerMap->find(box); > > Better to use auto here. > > > Source/WebCore/rendering/RenderBlock.cpp:3728 > > + for (auto& currBox : *positionedDescendantSet) > > I would call this just "box" rather than "currBox" to avoid the pointless > abbreviation. Done. Thanks for the review. Could you check again?
WebKit Commit Bot
Comment 13 2015-06-12 02:54:31 PDT
Attachment 254784 [details] did not pass style-queue: ERROR: Source/WebCore/rendering/RenderBlock.cpp:1312: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/WebCore/rendering/RenderBlock.cpp:1323: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 2 in 22 files If any of these errors are false positives, please file a bug against check-webkit-style.
Hunseop Jeong
Comment 14 2015-06-12 03:03:49 PDT
(In reply to comment #13) > Attachment 254784 [details] did not pass style-queue: > > > ERROR: Source/WebCore/rendering/RenderBlock.cpp:1312: Multi line control > clauses should use braces. [whitespace/braces] [4] > ERROR: Source/WebCore/rendering/RenderBlock.cpp:1323: Multi line control > clauses should use braces. [whitespace/braces] [4] > Total errors found: 2 in 22 files > > > If any of these errors are false positives, please file a bug against > check-webkit-style. Aren't these errors false positives? I don't know why it make the error.
Darin Adler
Comment 15 2015-06-12 09:18:14 PDT
(In reply to comment #14) > (In reply to comment #13) > > Attachment 254784 [details] did not pass style-queue: > > > > ERROR: Source/WebCore/rendering/RenderBlock.cpp:1312: Multi line control clauses should use braces. [whitespace/braces] [4] > > ERROR: Source/WebCore/rendering/RenderBlock.cpp:1323: Multi line control clauses should use braces. [whitespace/braces] [4] > > Total errors found: 2 in 22 files > > > > If any of these errors are false positives, please file a bug against > > check-webkit-style. > > Aren't these errors false positives? Not 100% sure, but yes they seem to be false positives.
WebKit Commit Bot
Comment 16 2015-06-12 10:10:43 PDT
Comment on attachment 254784 [details] Patch Clearing flags on attachment: 254784 Committed r185512: <http://trac.webkit.org/changeset/185512>
WebKit Commit Bot
Comment 17 2015-06-12 10:10:50 PDT
All reviewed patches have been landed. Closing bug.
Alexey Proskuryakov
Comment 18 2015-06-12 11:35:19 PDT
WebKit Commit Bot
Comment 19 2015-06-12 11:37:58 PDT
Re-opened since this is blocked by bug 145932
Simon Fraser (smfr)
Comment 20 2015-06-12 11:48:26 PDT
Please run tests with a debug build before submitting patches.
Alexey Proskuryakov
Comment 21 2015-06-12 14:41:37 PDT
This also appears to have caused memory corruption detected by GuardMalloc on fast/multicol/newmulticol/multicol-inside-multicol.html: Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 com.apple.WebCore 0x000000010f376365 WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants() + 101 1 com.apple.WebCore 0x000000010fed7120 WebCore::RenderBlockFlow::layoutBlockChildren(bool, WebCore::LayoutUnit&) + 32 2 com.apple.WebCore 0x000000010fed64c6 WebCore::RenderBlockFlow::layoutBlock(bool, WebCore::LayoutUnit) + 918 3 com.apple.WebCore 0x000000010f375956 WebCore::RenderBlock::layout() + 54 4 com.apple.WebCore 0x000000010f3757cd WebCore::RenderView::layout() + 765 5 com.apple.WebCore 0x000000010f37131f WebCore::FrameView::layout(bool) + 3215 6 com.apple.WebCore 0x000000010f36ff7f WebCore::Document::implicitClose() + 943 7 com.apple.WebCore 0x000000010f36f783 WebCore::FrameLoader::checkCompleted() + 275 8 com.apple.WebCore 0x000000010f36e554 WebCore::FrameLoader::finishedParsing() + 100 9 com.apple.WebCore 0x000000010f36d2f1 WebCore::Document::finishedParsing() + 417 10 com.apple.WebCore 0x000000010f3450b5 WebCore::HTMLDocumentParser::prepareToStopParsing() + 165 11 com.apple.WebCore 0x000000010f43b891 WebCore::HTMLDocumentParser::resumeParsingAfterYield() + 129 12 com.apple.WebCore 0x000000010f3243ff WebCore::ThreadTimers::sharedTimerFiredInternal() + 175 13 com.apple.WebCore 0x000000010f324318 WebCore::timerFired(__CFRunLoopTimer*, void*) + 24
Hunseop Jeong
Comment 22 2015-06-12 18:56:22 PDT
(In reply to comment #20) > Please run tests with a debug build before submitting patches. Okay, I will do that.
Hunseop Jeong
Comment 23 2015-06-12 19:13:01 PDT
(In reply to comment #21) > This also appears to have caused memory corruption detected by GuardMalloc > on fast/multicol/newmulticol/multicol-inside-multicol.html: > > Thread 0 Crashed:: Dispatch queue: com.apple.main-thread > 0 com.apple.WebCore 0x000000010f376365 > WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants() + 101 > 1 com.apple.WebCore 0x000000010fed7120 > WebCore::RenderBlockFlow::layoutBlockChildren(bool, WebCore::LayoutUnit&) + > 32 > 2 com.apple.WebCore 0x000000010fed64c6 > WebCore::RenderBlockFlow::layoutBlock(bool, WebCore::LayoutUnit) + 918 > 3 com.apple.WebCore 0x000000010f375956 > WebCore::RenderBlock::layout() + 54 > 4 com.apple.WebCore 0x000000010f3757cd > WebCore::RenderView::layout() + 765 > 5 com.apple.WebCore 0x000000010f37131f > WebCore::FrameView::layout(bool) + 3215 > 6 com.apple.WebCore 0x000000010f36ff7f > WebCore::Document::implicitClose() + 943 > 7 com.apple.WebCore 0x000000010f36f783 > WebCore::FrameLoader::checkCompleted() + 275 > 8 com.apple.WebCore 0x000000010f36e554 > WebCore::FrameLoader::finishedParsing() + 100 > 9 com.apple.WebCore 0x000000010f36d2f1 > WebCore::Document::finishedParsing() + 417 > 10 com.apple.WebCore 0x000000010f3450b5 > WebCore::HTMLDocumentParser::prepareToStopParsing() + 165 > 11 com.apple.WebCore 0x000000010f43b891 > WebCore::HTMLDocumentParser::resumeParsingAfterYield() + 129 > 12 com.apple.WebCore 0x000000010f3243ff > WebCore::ThreadTimers::sharedTimerFiredInternal() + 175 > 13 com.apple.WebCore 0x000000010f324318 > WebCore::timerFired(__CFRunLoopTimer*, void*) + 24 Thank you to your confirmation. After modification, I will upload the patch.
Hunseop Jeong
Comment 24 2015-06-15 02:38:57 PDT
WebKit Commit Bot
Comment 25 2015-06-15 02:40:31 PDT
Attachment 254866 [details] did not pass style-queue: ERROR: Source/WebCore/rendering/RenderBlock.cpp:1312: Multi line control clauses should use braces. [whitespace/braces] [4] ERROR: Source/WebCore/rendering/RenderBlock.cpp:1323: Multi line control clauses should use braces. [whitespace/braces] [4] Total errors found: 2 in 22 files If any of these errors are false positives, please file a bug against check-webkit-style.
Hunseop Jeong
Comment 26 2015-06-15 02:57:44 PDT
(In reply to comment #21) > This also appears to have caused memory corruption detected by GuardMalloc > on fast/multicol/newmulticol/multicol-inside-multicol.html: > > Thread 0 Crashed:: Dispatch queue: com.apple.main-thread > 0 com.apple.WebCore 0x000000010f376365 > WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants() + 101 > 1 com.apple.WebCore 0x000000010fed7120 > WebCore::RenderBlockFlow::layoutBlockChildren(bool, WebCore::LayoutUnit&) + > 32 > 2 com.apple.WebCore 0x000000010fed64c6 > WebCore::RenderBlockFlow::layoutBlock(bool, WebCore::LayoutUnit) + 918 > 3 com.apple.WebCore 0x000000010f375956 > WebCore::RenderBlock::layout() + 54 > 4 com.apple.WebCore 0x000000010f3757cd > WebCore::RenderView::layout() + 765 > 5 com.apple.WebCore 0x000000010f37131f > WebCore::FrameView::layout(bool) + 3215 > 6 com.apple.WebCore 0x000000010f36ff7f > WebCore::Document::implicitClose() + 943 > 7 com.apple.WebCore 0x000000010f36f783 > WebCore::FrameLoader::checkCompleted() + 275 > 8 com.apple.WebCore 0x000000010f36e554 > WebCore::FrameLoader::finishedParsing() + 100 > 9 com.apple.WebCore 0x000000010f36d2f1 > WebCore::Document::finishedParsing() + 417 > 10 com.apple.WebCore 0x000000010f3450b5 > WebCore::HTMLDocumentParser::prepareToStopParsing() + 165 > 11 com.apple.WebCore 0x000000010f43b891 > WebCore::HTMLDocumentParser::resumeParsingAfterYield() + 129 > 12 com.apple.WebCore 0x000000010f3243ff > WebCore::ThreadTimers::sharedTimerFiredInternal() + 175 > 13 com.apple.WebCore 0x000000010f324318 > WebCore::timerFired(__CFRunLoopTimer*, void*) + 24 Source/WebCore/rendering/RenderBlock.cpp:1148 - for (auto& box : *descendants) { + for (auto* box : *descendants) { I changed the reference to pointer because 'box' reassigned the pointer at 1160 line. Source/WebCore/rendering/RenderBlock.cpp:1160 > box = box->containingBlock(); Maybe It makes the problem. I ran tests with a debug build. Tests all passed. I'll be cafeful before uploading the patch.
Note You need to log in before you can comment on or make changes to this bug.