summaryrefslogtreecommitdiffstats
path: root/WebCore/dom/Element.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-08-04 11:41:34 +0100
committerSteve Block <steveblock@google.com>2010-08-09 12:04:44 +0100
commitdb14019a23d96bc8a444b6576a5da8bd1cfbc8b0 (patch)
tree9f793c5b0f5e1f2aca8247158920e2c4bf962bbf /WebCore/dom/Element.cpp
parentbf916837aa84f1e4b00e6ed6268516c2acd27545 (diff)
downloadexternal_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.zip
external_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.tar.gz
external_webkit-db14019a23d96bc8a444b6576a5da8bd1cfbc8b0.tar.bz2
Merge WebKit at r64523 : Initial merge by git.
Change-Id: Ibb796c6802e757b1d9b40f58205cfbe4da95fcd4
Diffstat (limited to 'WebCore/dom/Element.cpp')
-rw-r--r--WebCore/dom/Element.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index a1ff56d..2fa75ce 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -905,7 +905,7 @@ void Element::recalcStyle(StyleChange change)
detach();
attach(); // FIXME: The style gets computed twice by calling attach. We could do better if we passed the style along.
// attach recalulates the style for all children. No need to do it twice.
- setNeedsStyleRecalc(NoStyleChange);
+ clearNeedsStyleRecalc();
clearChildNeedsStyleRecalc();
return;
}
@@ -971,7 +971,7 @@ void Element::recalcStyle(StyleChange change)
forceCheckOfNextElementSibling = childRulesChanged && hasDirectAdjacentRules;
}
- setNeedsStyleRecalc(NoStyleChange);
+ clearNeedsStyleRecalc();
clearChildNeedsStyleRecalc();
}
@@ -1330,9 +1330,13 @@ void Element::updateFocusAppearance(bool /*restorePreviousSelection*/)
Frame* frame = document()->frame();
if (!frame)
return;
+
+ // When focusing an editable element in an iframe, don't reset the selection if it already contains a selection.
+ if (this == frame->selection()->rootEditableElement())
+ return;
// FIXME: We should restore the previous selection if there is one.
- VisibleSelection newSelection = hasTagName(htmlTag) || hasTagName(bodyTag) ? VisibleSelection(Position(this, 0), DOWNSTREAM) : VisibleSelection::selectionFromContentsOfNode(this);
+ VisibleSelection newSelection = VisibleSelection(Position(this, 0), DOWNSTREAM);
if (frame->shouldChangeSelection(newSelection)) {
frame->selection()->setSelection(newSelection);