Commit 034e133e authored by morrita@google.com's avatar morrita@google.com

2010-05-20 MORITA Hajime <morrita@google.com>

        Reviewed by Kent Tamura.

        2x execCommand ReadAV@NULL
        https://bugs.webkit.org/show_bug.cgi?id=35791

        This test passes if it doesn't crash.

        * editing/execCommand/35791-expected.txt: Added.
        * editing/execCommand/35791.html: Added.
2010-05-20  MORITA Hajime  <morrita@google.com>

        Reviewed by Kent Tamura.

        2x execCommand ReadAV@NULL
        https://bugs.webkit.org/show_bug.cgi?id=35791

        In applyBlockStyle(), a node which is referred from
        nextParagraphStart sometimes removed from the document and goes
        orphan, and that causes an assertion failed. This is because
        moveParagraphs() replaces the node with a new one with some new
        styles applied. So we re-compute nextParagraphStart in that case.

        Test: editing/execCommand/35791.html

        * dom/Position.h:
        (WebCore::Position::isOrphan):
        * editing/ApplyStyleCommand.cpp:
        (WebCore::ApplyStyleCommand::applyBlockStyle):
        * editing/VisiblePosition.h:
        (WebCore::VisiblePosition::isOrphan):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 8d37911c
2010-05-20 MORITA Hajime <morrita@google.com>
Reviewed by Kent Tamura.
2x execCommand ReadAV@NULL
https://bugs.webkit.org/show_bug.cgi?id=35791
This test passes if it doesn't crash.
* editing/execCommand/35791-expected.txt: Added.
* editing/execCommand/35791.html: Added.
2010-05-19 Mario Sanchez Prada <msanchez@igalia.com>
Reviewed by Darin Adler.
<BODY></BODY>
<SCRIPT>
// Test for https://bugs.webkit.org/show_bug.cgi?id=35791; It's OK if it doesn't crash.
document.designMode = "on";
document.execCommand("selectall");
document.execCommand("InsertLineBreak")
document.execCommand("InsertLineBreak");
document.execCommand("InsertText", false, "hello");
document.execCommand("SelectAll");
document.execCommand("createlink", false, "http://webkit.org/");
document.execCommand("justifycenter", false);
document.designMode = "off";
if (window.layoutTestController)
window.layoutTestController.dumpAsText();
</SCRIPT>
2010-05-20 MORITA Hajime <morrita@google.com>
Reviewed by Kent Tamura.
2x execCommand ReadAV@NULL
https://bugs.webkit.org/show_bug.cgi?id=35791
In applyBlockStyle(), a node which is referred from
nextParagraphStart sometimes removed from the document and goes
orphan, and that causes an assertion failed. This is because
moveParagraphs() replaces the node with a new one with some new
styles applied. So we re-compute nextParagraphStart in that case.
Test: editing/execCommand/35791.html
* dom/Position.h:
(WebCore::Position::isOrphan):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyBlockStyle):
* editing/VisiblePosition.h:
(WebCore::VisiblePosition::isOrphan):
2010-05-20 Steve Block <steveblock@google.com>
Reviewed by Eric Seidel.
......@@ -117,6 +117,7 @@ public:
bool isNull() const { return !m_anchorNode; }
bool isNotNull() const { return m_anchorNode; }
bool isOrphan() const { return m_anchorNode && !m_anchorNode->inDocument(); }
Element* element() const;
PassRefPtr<CSSComputedStyleDeclaration> computedStyle() const;
......
......@@ -619,7 +619,11 @@ void ApplyStyleCommand::applyBlockStyle(CSSMutableStyleDeclaration *style)
if (!m_removeOnly)
addBlockStyle(styleChange, static_cast<HTMLElement*>(block.get()));
}
if (nextParagraphStart.isOrphan())
nextParagraphStart = endOfParagraph(paragraphStart).next();
}
paragraphStart = nextParagraphStart;
nextParagraphStart = endOfParagraph(paragraphStart).next();
}
......
......@@ -61,6 +61,7 @@ public:
bool isNull() const { return m_deepPosition.isNull(); }
bool isNotNull() const { return m_deepPosition.isNotNull(); }
bool isOrphan() const { return m_deepPosition.isOrphan(); }
Position deepEquivalent() const { return m_deepPosition; }
EAffinity affinity() const { ASSERT(m_affinity == UPSTREAM || m_affinity == DOWNSTREAM); return m_affinity; }
......
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