RESOLVED FIXED 127786
Document::topDocument() should return a reference
https://bugs.webkit.org/show_bug.cgi?id=127786
Summary Document::topDocument() should return a reference
Antti Koivisto
Reported 2014-01-28 12:09:29 PST
it should
Attachments
patch (12.36 KB, patch)
2014-01-28 12:10 PST, Antti Koivisto
darin: review+
Antti Koivisto
Comment 1 2014-01-28 12:10:53 PST
WebKit Commit Bot
Comment 2 2014-01-28 12:13:45 PST
Attachment 222473 [details] did not pass style-queue: ERROR: Source/WebCore/rendering/RenderView.cpp:1269: Should be indented on a separate line, with the colon or comma first on that line. [whitespace/indent] [4] Total errors found: 1 in 8 files If any of these errors are false positives, please file a bug against check-webkit-style.
Darin Adler
Comment 3 2014-01-28 12:16:34 PST
Comment on attachment 222473 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=222473&action=review > Source/WebCore/dom/Document.cpp:4316 > - return m_frame ? m_frame->mainFrame().document() : const_cast<Document*>(this); > + return m_frame ? *m_frame->mainFrame().document() : const_cast<Document&>(*this); We should make this 100% safe by null-checking MainFrame::document and falling back to this in that case too. And if we ever change MainFrame::document to return a reference we can delete that branch.
Antti Koivisto
Comment 4 2014-01-28 14:27:59 PST
Benjamin Poulain
Comment 5 2014-01-28 16:20:34 PST
Looks like it does not build on iOS.
Benjamin Poulain
Comment 6 2014-01-28 16:26:48 PST
Never mind, I am late on the internal updates. Antti already fixed the build.
Note You need to log in before you can comment on or make changes to this bug.