From 2cb2e9f876af4e63f1a4d1f0494c047a7b794faa Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 13 Sep 2011 17:42:43 -0400 Subject: [PATCH] Backout changeset 2705abe8d3f2 (bug 686247) again because of the accessibility test failures --- .../mochitest/tree/test_cssoverflow.html | 24 ++++++++++------- .../html/content/src/nsTextEditorState.cpp | 27 +++++++------------ content/html/content/src/nsTextEditorState.h | 2 -- .../editor/dynamic-overflow-change-ref.html | 13 --------- .../editor/dynamic-overflow-change.html | 13 --------- layout/reftests/editor/reftest.list | 1 - layout/style/nsStyleStruct.cpp | 4 +-- 7 files changed, 27 insertions(+), 57 deletions(-) delete mode 100644 layout/reftests/editor/dynamic-overflow-change-ref.html delete mode 100644 layout/reftests/editor/dynamic-overflow-change.html diff --git a/accessible/tests/mochitest/tree/test_cssoverflow.html b/accessible/tests/mochitest/tree/test_cssoverflow.html index 8a5cf491d95c..1a955f80cee1 100644 --- a/accessible/tests/mochitest/tree/test_cssoverflow.html +++ b/accessible/tests/mochitest/tree/test_cssoverflow.html @@ -35,6 +35,10 @@ new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode) ]; + this.unexpectedEventSeq = [ + new invokerChecker(EVENT_REORDER, this.linkNode.parentNode) + ]; + this.invoke = function focusAnchor_invoke() { this.linkNode.focus(); @@ -42,9 +46,8 @@ this.check = function focusAnchor_check(aEvent) { - todo_is(this.link, aEvent.accessible, - "Focus should be fired against new link accessible!"); - todo(false, "Doubled reorder events!"); + is(this.link, aEvent.accessible, + "The link accessible shouldn't be recreated!"); } this.getID = function focusAnchor_getID() @@ -62,6 +65,10 @@ new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode) ]; + this.unexpectedEventSeq = [ + new invokerChecker(EVENT_REORDER, this.linkNode.parentNode) + ]; + this.invoke = function tabAnchor_invoke() { synthesizeKey("VK_TAB", { shiftKey: false }); @@ -69,9 +76,8 @@ this.check = function tabAnchor_check(aEvent) { - todo_isnot(this.link, aEvent.accessible, - "Focus should be fired against new link accessible!"); - todo(false, "Doubled reorder events!"); + is(this.link, aEvent.accessible, + "The link accessible shouldn't be recreated!"); } this.getID = function tabAnchor_getID() @@ -120,9 +126,9 @@ Mozilla Bug 570275
- Mozilla Bug 686247 + title="Don't recreate frames for inlines with overflow style applied" + href="https://bugzilla.mozilla.org/show_bug.cgi?id=606087"> + Mozilla Bug 606087

diff --git a/content/html/content/src/nsTextEditorState.cpp b/content/html/content/src/nsTextEditorState.cpp index 28b24cf6ef24..b91a54bd083c 100644 --- a/content/html/content/src/nsTextEditorState.cpp +++ b/content/html/content/src/nsTextEditorState.cpp @@ -1058,9 +1058,6 @@ nsTextEditorState::BindToFrame(nsTextControlFrame* aFrame) nsIContent *rootNode = GetRootNode(); - nsresult rv = InitializeRootNode(); - NS_ENSURE_SUCCESS(rv, rv); - nsIPresShell *shell = mBoundFrame->PresContext()->GetPresShell(); NS_ENSURE_TRUE(shell, NS_ERROR_FAILURE); @@ -1548,17 +1545,6 @@ nsTextEditorState::CreateRootNode() NOT_FROM_PARSER); NS_ENSURE_SUCCESS(rv, rv); - if (!IsSingleLineTextControl()) { - mMutationObserver = new nsAnonDivObserver(this); - mRootNode->AddMutationObserver(mMutationObserver); - } - - return rv; -} - -nsresult -nsTextEditorState::InitializeRootNode() -{ // Set the necessary classes on the text control. We use class values // instead of a 'style' attribute so that the style comes from a user-agent // style sheet and is still applied even if author styles are disabled. @@ -1578,12 +1564,19 @@ nsTextEditorState::InitializeRootNode() disp->mOverflowX != NS_STYLE_OVERFLOW_CLIP) { classValue.AppendLiteral(" inherit-overflow"); } + + mMutationObserver = new nsAnonDivObserver(this); + NS_ENSURE_TRUE(mMutationObserver, NS_ERROR_OUT_OF_MEMORY); + mRootNode->AddMutationObserver(mMutationObserver); } - nsresult rv = mRootNode->SetAttr(kNameSpaceID_None, nsGkAtoms::_class, - classValue, PR_FALSE); + rv = mRootNode->SetAttr(kNameSpaceID_None, nsGkAtoms::_class, + classValue, PR_FALSE); NS_ENSURE_SUCCESS(rv, rv); - return mBoundFrame->UpdateValueDisplay(PR_FALSE); + rv = mBoundFrame->UpdateValueDisplay(PR_FALSE); + NS_ENSURE_SUCCESS(rv, rv); + + return rv; } nsresult diff --git a/content/html/content/src/nsTextEditorState.h b/content/html/content/src/nsTextEditorState.h index 56d162dddb38..2e6a6b3a408f 100644 --- a/content/html/content/src/nsTextEditorState.h +++ b/content/html/content/src/nsTextEditorState.h @@ -253,8 +253,6 @@ private: void DestroyEditor(); void Clear(); - nsresult InitializeRootNode(); - void FinishedRestoringSelection() { mRestoringSelection = nsnull; } class InitializationGuard { diff --git a/layout/reftests/editor/dynamic-overflow-change-ref.html b/layout/reftests/editor/dynamic-overflow-change-ref.html deleted file mode 100644 index 52e5f5bb0dd1..000000000000 --- a/layout/reftests/editor/dynamic-overflow-change-ref.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/layout/reftests/editor/dynamic-overflow-change.html b/layout/reftests/editor/dynamic-overflow-change.html deleted file mode 100644 index 57a1b8f74efe..000000000000 --- a/layout/reftests/editor/dynamic-overflow-change.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - diff --git a/layout/reftests/editor/reftest.list b/layout/reftests/editor/reftest.list index 4c51f4040478..95c0302400d0 100644 --- a/layout/reftests/editor/reftest.list +++ b/layout/reftests/editor/reftest.list @@ -69,4 +69,3 @@ skip-if(Android) == 674212-spellcheck.html 674212-spellcheck-ref.html skip-if(Android) == 338427-2.html 338427-2-ref.html skip-if(Android) == 338427-3.html 338427-3-ref.html skip-if(Android) == 462758-grabbers-resizers.html 462758-grabbers-resizers-ref.html -== dynamic-overflow-change.html dynamic-overflow-change-ref.html diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index f6217f120d76..06a7f5cb2341 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -2180,8 +2180,8 @@ nsChangeHint nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const || mPosition != aOther.mPosition || mDisplay != aOther.mDisplay || (mFloats == NS_STYLE_FLOAT_NONE) != (aOther.mFloats == NS_STYLE_FLOAT_NONE) - || mOverflowX != aOther.mOverflowX - || mOverflowY != aOther.mOverflowY + || (mOverflowX != aOther.mOverflowX && mDisplay != NS_STYLE_DISPLAY_INLINE) + || (mOverflowY != aOther.mOverflowY && mDisplay != NS_STYLE_DISPLAY_INLINE) || mResize != aOther.mResize) NS_UpdateHint(hint, nsChangeHint_ReconstructFrame);