Skip to content

Commit

Permalink
Merge r175809 - Crash in WebCore::Node::getFlag
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=137961

Reviewed by Antti Koivisto.

Source/WebCore:

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyBlockStyle): Null pointer check added.

LayoutTests:

* editing/execCommand/crash-137961-expected.txt: Added.
* editing/execCommand/crash-137961.html: Added.
  • Loading branch information
ossy-szeged authored and carlosgcampos committed Jan 5, 2015
1 parent e6017b7 commit d7fa522
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
10 changes: 10 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
2014-11-10 Csaba Osztrogonác <ossy@webkit.org>

Crash in WebCore::Node::getFlag
https://bugs.webkit.org/show_bug.cgi?id=137961

Reviewed by Antti Koivisto.

* editing/execCommand/crash-137961-expected.txt: Added.
* editing/execCommand/crash-137961.html: Added.

2014-04-25 Miyoung Shin <myid.shin@samsung.com>

Web process is crashed during dispatching touchEvent created by JS.
Expand Down
3 changes: 3 additions & 0 deletions LayoutTests/editing/execCommand/crash-137961-expected.txt
@@ -0,0 +1,3 @@
Test for bug Crash in WebCore::Node::getFlag

This test passes if it doesn't crash.
24 changes: 24 additions & 0 deletions LayoutTests/editing/execCommand/crash-137961.html
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html contenteditable>
<head>
<script>
if (window.testRunner)
testRunner.dumpAsText();

function test() {
document.execCommand("selectAll", false, null);
document.execCommand("createlink", true, "http://www.example.com");
document.execCommand("removeFormat", false, null);
document.write("<p>Test for bug <a href=\"https://bugs.webkit.org/show_bug.cgi?id=137961\">Crash in WebCore::Node::getFlag</a></p>");
document.write("<p>This test passes if it doesn't crash.</p>");
}
</script>
<style>
* {
display:table-row-group;
}
</style>
</head>
<body onload='test();' hidden>
</body>
</html>
10 changes: 10 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,13 @@
2014-11-10 Csaba Osztrogonác <ossy@webkit.org>

Crash in WebCore::Node::getFlag
https://bugs.webkit.org/show_bug.cgi?id=137961

Reviewed by Antti Koivisto.

* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyBlockStyle): Null pointer check added.

2014-11-11 David Kilzer <ddkilzer@apple.com>

Protect Document in ProcessingInstruction::setXSLStyleSheet()
Expand Down
3 changes: 3 additions & 0 deletions Source/WebCore/editing/ApplyStyleCommand.cpp
Expand Up @@ -267,6 +267,9 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle *style)
#else
Node* scope = highestEditableRoot(visibleStart.deepEquivalent());
#endif
if (!scope)
return;

RefPtr<Range> startRange = Range::create(document(), firstPositionInNode(scope), visibleStart.deepEquivalent().parentAnchoredEquivalent());
RefPtr<Range> endRange = Range::create(document(), firstPositionInNode(scope), visibleEnd.deepEquivalent().parentAnchoredEquivalent());
int startIndex = TextIterator::rangeLength(startRange.get(), true);
Expand Down

0 comments on commit d7fa522

Please sign in to comment.