Commit df6c6f54 authored by yosin@chromium.org's avatar yosin@chromium.org

Make isEditablePosition to work with Position objects other than PositionIsOffsetInAnchor

This patch makes isEditablePosition to work with Position objects other than
PositionIsOffsetInAnchor by using Position::parentAnchoredEquivalent() to
use right Node object for checking editability.

BUG=348973
TEST=LayoutTests/editing/execCommand/format-block-with-uneditable-crash.html

Review URL: https://codereview.chromium.org/309993002

git-svn-id: svn://svn.chromium.org/blink/trunk@175660 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 29d71574
<!DOCTYPE html>
<html>
<head>
<script>
if (window.testRunner)
testRunner.dumpAsText();
onload = function() {
document.designMode = 'on';
document.execCommand('SelectAll');
document.execCommand('FormatBlock', false, '<pre>');
document.documentElement.textContent = 'PASS if Blink doesn\'t crash.';
};
</script>
</head>
<body>
ab<embed contenteditable="false"></embed>xyz
</body>
</html>
......@@ -154,7 +154,7 @@ Node* lowestEditableAncestor(Node* node)
bool isEditablePosition(const Position& p, EditableType editableType, EUpdateStyle updateStyle)
{
Node* node = p.deprecatedNode();
Node* node = p.parentAnchoredEquivalent().anchorNode();
if (!node)
return false;
if (updateStyle == UpdateStyle)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment