Commit 16989217 authored by cfleizach@apple.com's avatar cfleizach@apple.com

2009-01-23 Chris Fleizach <cfleizach@apple.com>

        Reviewed by Beth Dakin.

        Bug 23509: Crash at -[WebCoreAXObject doAXNextSentenceEndTextMarkerForTextMarker:]
        https://bugs.webkit.org/show_bug.cgi?id=23509
  
        Add null checking around next/previous sentence retrieval in AX code

        * page/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::nextSentenceEndPosition):
        (WebCore::AccessibilityObject::previousSentenceStartPosition):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a422eff1
2009-01-23 Chris Fleizach <cfleizach@apple.com>
Reviewed by Beth Dakin.
Bug 23509: Crash at -[WebCoreAXObject doAXNextSentenceEndTextMarkerForTextMarker:]
https://bugs.webkit.org/show_bug.cgi?id=23509
Add null checking around next/previous sentence retrieval in AX code
* page/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::nextSentenceEndPosition):
(WebCore::AccessibilityObject::previousSentenceStartPosition):
2009-01-23 David Hyatt <hyatt@apple.com> 2009-01-23 David Hyatt <hyatt@apple.com>
Fix for <rdar://problem/6518850> REGRESSION: hover feedback not showing on many sites Fix for <rdar://problem/6518850> REGRESSION: hover feedback not showing on many sites
...@@ -739,7 +739,13 @@ VisiblePosition AccessibilityObject::nextSentenceEndPosition(const VisiblePositi ...@@ -739,7 +739,13 @@ VisiblePosition AccessibilityObject::nextSentenceEndPosition(const VisiblePositi
// an empty line is considered a sentence. If it's skipped, then the sentence parser will not // an empty line is considered a sentence. If it's skipped, then the sentence parser will not
// see this empty line. Instead, return the end position of the empty line. // see this empty line. Instead, return the end position of the empty line.
VisiblePosition endPosition; VisiblePosition endPosition;
String lineString = plainText(makeRange(startOfLine(visiblePos), endOfLine(visiblePos)).get()); VisiblePosition startOfLinePosition = startOfLine(nextVisiblePos);
VisiblePosition endOfLinePosition = endOfLine(nextVisiblePos);
String lineString;
if (startOfLinePosition.isNotNull() && endOfLinePosition.isNotNull())
lineString = plainText(makeRange(startOfLinePosition, endOfLinePosition).get());
if (lineString.isEmpty()) if (lineString.isEmpty())
endPosition = nextVisiblePos; endPosition = nextVisiblePos;
else else
...@@ -762,7 +768,13 @@ VisiblePosition AccessibilityObject::previousSentenceStartPosition(const Visible ...@@ -762,7 +768,13 @@ VisiblePosition AccessibilityObject::previousSentenceStartPosition(const Visible
// treat empty line as a separate sentence. // treat empty line as a separate sentence.
VisiblePosition startPosition; VisiblePosition startPosition;
String lineString = plainText(makeRange(startOfLine(previousVisiblePos), endOfLine(previousVisiblePos)).get()); VisiblePosition startOfLinePosition = startOfLine(previousVisiblePos);
VisiblePosition endOfLinePosition = endOfLine(previousVisiblePos);
String lineString;
if (startOfLinePosition.isNotNull() && endOfLinePosition.isNotNull())
lineString = plainText(makeRange(startOfLinePosition, endOfLinePosition).get());
if (lineString.isEmpty()) if (lineString.isEmpty())
startPosition = previousVisiblePos; startPosition = previousVisiblePos;
else else
......
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