mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 686247 - Text control frames should accept dynamic changes to the CSS overflow property; r=bzbarsky,surkov
This commit is contained in:
parent
21de2eb9d5
commit
4df687ca99
@ -35,10 +35,6 @@
|
||||
new invokerChecker(EVENT_FOCUS, getAccessible, this.linkNode)
|
||||
];
|
||||
|
||||
this.unexpectedEventSeq = [
|
||||
new invokerChecker(EVENT_REORDER, this.linkNode.parentNode)
|
||||
];
|
||||
|
||||
this.invoke = function focusAnchor_invoke()
|
||||
{
|
||||
this.linkNode.focus();
|
||||
@ -46,8 +42,8 @@
|
||||
|
||||
this.check = function focusAnchor_check(aEvent)
|
||||
{
|
||||
is(this.link, aEvent.accessible,
|
||||
"The link accessible shouldn't be recreated!");
|
||||
todo_is(this.link, aEvent.accessible,
|
||||
"Focus should be fired against new link accessible!");
|
||||
}
|
||||
|
||||
this.getID = function focusAnchor_getID()
|
||||
@ -65,10 +61,6 @@
|
||||
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 });
|
||||
@ -76,8 +68,8 @@
|
||||
|
||||
this.check = function tabAnchor_check(aEvent)
|
||||
{
|
||||
is(this.link, aEvent.accessible,
|
||||
"The link accessible shouldn't be recreated!");
|
||||
todo_is(this.link, aEvent.accessible,
|
||||
"Focus should be fired against new link accessible!");
|
||||
}
|
||||
|
||||
this.getID = function tabAnchor_getID()
|
||||
@ -126,9 +118,9 @@
|
||||
Mozilla Bug 570275
|
||||
</a><br>
|
||||
<a target="_blank"
|
||||
title="Don't recreate frames for inlines with overflow style applied"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=606087">
|
||||
Mozilla Bug 606087
|
||||
title="Text control frames should accept dynamic changes to the CSS overflow property"
|
||||
href="https://bugzilla.mozilla.org/show_bug.cgi?id=686247">
|
||||
Mozilla Bug 686247
|
||||
</a><br>
|
||||
|
||||
<p id="display"></p>
|
||||
|
@ -1058,6 +1058,9 @@ 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);
|
||||
|
||||
@ -1545,6 +1548,17 @@ 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.
|
||||
@ -1564,19 +1578,12 @@ nsTextEditorState::CreateRootNode()
|
||||
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);
|
||||
}
|
||||
rv = mRootNode->SetAttr(kNameSpaceID_None, nsGkAtoms::_class,
|
||||
classValue, PR_FALSE);
|
||||
nsresult rv = mRootNode->SetAttr(kNameSpaceID_None, nsGkAtoms::_class,
|
||||
classValue, PR_FALSE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = mBoundFrame->UpdateValueDisplay(PR_FALSE);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return rv;
|
||||
return mBoundFrame->UpdateValueDisplay(PR_FALSE);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -253,6 +253,8 @@ private:
|
||||
void DestroyEditor();
|
||||
void Clear();
|
||||
|
||||
nsresult InitializeRootNode();
|
||||
|
||||
void FinishedRestoringSelection() { mRestoringSelection = nsnull; }
|
||||
|
||||
class InitializationGuard {
|
||||
|
13
layout/reftests/editor/dynamic-overflow-change-ref.html
Normal file
13
layout/reftests/editor/dynamic-overflow-change-ref.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<textarea rows="2" style="overflow: hidden;">
|
||||
this
|
||||
is
|
||||
a
|
||||
textarea
|
||||
with
|
||||
overflow
|
||||
</textarea>
|
||||
</body>
|
||||
</html>
|
13
layout/reftests/editor/dynamic-overflow-change.html
Normal file
13
layout/reftests/editor/dynamic-overflow-change.html
Normal file
@ -0,0 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body onload="document.querySelector('textarea').style.overflow='hidden'">
|
||||
<textarea rows="2">
|
||||
this
|
||||
is
|
||||
a
|
||||
textarea
|
||||
with
|
||||
overflow
|
||||
</textarea>
|
||||
</body>
|
||||
</html>
|
@ -69,3 +69,4 @@ 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
|
||||
|
@ -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 && mDisplay != NS_STYLE_DISPLAY_INLINE)
|
||||
|| (mOverflowY != aOther.mOverflowY && mDisplay != NS_STYLE_DISPLAY_INLINE)
|
||||
|| mOverflowX != aOther.mOverflowX
|
||||
|| mOverflowY != aOther.mOverflowY
|
||||
|| mResize != aOther.mResize)
|
||||
NS_UpdateHint(hint, nsChangeHint_ReconstructFrame);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user