Bug 1461299: Ensure the editor root node is marked as NAC even if BindToFrame fails. r=smaug
☠☠ backed out by d76102e32327 ☠ ☠
authorEmilio Cobos Álvarez <emilio@crisal.io>
Mon, 14 May 2018 17:52:09 +0200
changeset 418270 48f01ac94137e2f6355acc6532dc2733eaaad427
parent 418269 64c4562813fa24925769f3f8d3490d142a8b629a
child 418271 699e9816b7ff862cf30db83e8f365cf50d02e90f
push id33997
push userncsoregi@mozilla.com
push dateTue, 15 May 2018 09:53:53 +0000
treeherdermozilla-central@cf3ee1402348 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1461299
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1461299: Ensure the editor root node is marked as NAC even if BindToFrame fails. r=smaug We do the following: CreateRootNode(); nsresult rv = BindToFrame(this); NS_ENSURE_SUCCESS(rv, rv); aElements.AppendElement(mRootNode); That means that if BindToFrame fails, mRootNode will never be appended to aElements, and thus will never get the native anonymous bits in [1]. BindToFrame should assert, but it indeed can fail due to it being bound to a different frame in print preview, because nsCSSFrameConstructor's ReplicateFixedFrames is a massive hack. :( Just ensure the NAC bit is properly set for now... [1]: https://searchfox.org/mozilla-central/rev/a85db9e29eb3f022dbaf8b9a6390ecbacf51e7dd/layout/base/nsCSSFrameConstructor.cpp#4193 MozReview-Commit-ID: 6sE8iUk4PCG
layout/forms/nsTextControlFrame.cpp
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -446,16 +446,17 @@ nsTextControlFrame::InitializeEagerlyIfN
 }
 
 nsresult
 nsTextControlFrame::CreateRootNode()
 {
   MOZ_ASSERT(!mRootNode);
 
   mRootNode = CreateEmptyDiv(*this);
+  mRootNode->SetIsNativeAnonymousRoot();
 
   mMutationObserver = new nsAnonDivObserver(*this);
   mRootNode->AddMutationObserver(mMutationObserver);
 
   // Make our root node editable
   mRootNode->SetFlags(NODE_IS_EDITABLE);
 
   // Set the necessary classes on the text control. We use class values instead