Changeset 165002 in webkit
- Timestamp:
- Mar 3, 2014, 1:11:24 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r164999 r165002 1 2014-03-03 Antti Koivisto <antti@apple.com> 2 3 Find results on simple lines are not marked correctly 4 https://bugs.webkit.org/show_bug.cgi?id=129586 5 6 Reviewed by Andreas Kling. 7 8 * editing/text-iterator/count-mark-lineboxes-expected.txt: Added. 9 * editing/text-iterator/count-mark-lineboxes.html: Added. 10 * editing/text-iterator/count-mark-simple-lines-expected.txt: Added. 11 * editing/text-iterator/count-mark-simple-lines.html: Added. 12 1 13 2014-03-03 Jer Noble <jer.noble@apple.com> 2 14 -
trunk/Source/WebCore/ChangeLog
r165001 r165002 1 2014-03-03 Antti Koivisto <antti@apple.com> 2 3 Find results on simple lines are not marked correctly 4 https://bugs.webkit.org/show_bug.cgi?id=129586 5 6 Reviewed by Andreas Kling. 7 8 Tests: editing/text-iterator/count-mark-lineboxes.html 9 editing/text-iterator/count-mark-simple-lines.html 10 11 TextIterator operating on simple lines failed to take the end of the range into account. 12 This also causes performance issues on long documents as range traversals would miss the end 13 node and end up going through the entire document. 14 15 * editing/TextIterator.cpp: 16 (WebCore::TextIterator::handleTextNode): 17 18 Stop when hitting the range end on simple text nodes. 19 20 (WebCore::SimplifiedBackwardsTextIterator::handleTextNode): 21 22 Use hasRenderedText test instead of linebox-only firstTextBox. 23 24 * testing/Internals.cpp: 25 (WebCore::Internals::countMatchesForText): 26 * testing/Internals.h: 27 * testing/Internals.idl: 28 29 Add testing interface for counting and marking matches. 30 1 31 2014-03-03 Benjamin Poulain <benjamin@webkit.org> 2 32 -
trunk/Source/WebCore/editing/TextIterator.cpp
r164964 r165002 539 539 return true; 540 540 // This code aims to produce same results as handleTextBox() below so test results don't change. It does not make much logical sense. 541 const unsigned end = (m_node == m_endContainer) ? static_cast<unsigned>(m_endOffset) : str.length(); 541 542 unsigned runEnd = m_offset; 542 543 unsigned runStart = m_offset; 543 while (runEnd < str.length()&& (deprecatedIsCollapsibleWhitespace(str[runEnd]) || str[runEnd] == '\t'))544 while (runEnd < end && (deprecatedIsCollapsibleWhitespace(str[runEnd]) || str[runEnd] == '\t')) 544 545 ++runEnd; 545 546 bool addSpaceForPrevious = m_lastTextNodeEndedWithCollapsedSpace && m_lastCharacter && !deprecatedIsCollapsibleWhitespace(m_lastCharacter); … … 557 558 runStart = runEnd; 558 559 } 559 while (runEnd < str.length()&& !deprecatedIsCollapsibleWhitespace(str[runEnd]))560 while (runEnd < end && !deprecatedIsCollapsibleWhitespace(str[runEnd])) 560 561 ++runEnd; 561 if (runStart < str.length())562 if (runStart < end) 562 563 emitText(m_node, renderer, runStart, runEnd); 563 564 m_offset = runEnd; 564 return runEnd == str.length();565 return runEnd == end; 565 566 } 566 567 … … 1301 1302 1302 1303 String text = renderer->text(); 1303 if (!renderer-> firstTextBox() && text.length() > 0)1304 if (!renderer->hasRenderedText() && text.length() > 0) 1304 1305 return true; 1305 1306 -
trunk/Source/WebCore/testing/Internals.cpp
r164830 r165002 1436 1436 } 1437 1437 1438 unsigned Internals::countMatchesForText(const String& text, unsigned findOptions, const String& markMatches, ExceptionCode&) 1439 { 1440 Document* document = contextDocument(); 1441 if (!document || !document->frame()) 1442 return 0; 1443 1444 bool mark = markMatches == "mark"; 1445 return document->frame()->editor().countMatchesForText(text, nullptr, findOptions, std::numeric_limits<unsigned>::max(), mark, nullptr); 1446 } 1447 1438 1448 const ProfilesArray& Internals::consoleProfiles() const 1439 1449 { -
trunk/Source/WebCore/testing/Internals.h
r164830 r165002 188 188 void toggleOverwriteModeEnabled(ExceptionCode&); 189 189 190 unsigned countMatchesForText(const String&, unsigned findOptions, const String& markMatches, ExceptionCode&); 191 190 192 unsigned numberOfScrollableAreas(ExceptionCode&); 191 193 -
trunk/Source/WebCore/testing/Internals.idl
r164830 r165002 99 99 [RaisesException] void setEditingValue(Element inputElement, DOMString value); 100 100 [RaisesException] void setAutofilled(Element inputElement, boolean enabled); 101 [RaisesException] unsigned long countMatchesForText(DOMString text, unsigned long findOptions, DOMString markMatches); 101 102 102 103 [RaisesException] void paintControlTints(); -
trunk/Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in
r164969 r165002 336 336 symbolWithPointer(?toggleContinuousSpellChecking@Editor@WebCore@@QAEXXZ, ?toggleContinuousSpellChecking@Editor@WebCore@@QEAAXXZ) 337 337 symbolWithPointer(?toggleOverwriteModeEnabled@Editor@WebCore@@QAEXXZ, ?toggleOverwriteModeEnabled@Editor@WebCore@@QEAAXXZ) 338 symbolWithPointer(?countMatchesForText@Editor@WebCore@@QAEIABVString@WTF@@PAVRange@2@EI_NPAV?$Vector@V?$RefPtr@VRange@WebCore@@@WTF@@$0A@VCrashOnOverflow@2@@4@@Z, ?countMatchesForText@Editor@WebCore@@QEAAIABVString@WTF@@PAVRange@2@EI_NPAV?$Vector@V?$RefPtr@VRange@WebCore@@@WTF@@$0A@VCrashOnOverflow@2@@4@@Z) 338 339 #if ENABLE(FULLSCREEN_API) 339 340 symbolWithPointer(?webkitWillEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z, ?webkitWillEnterFullScreenForElement@Document@WebCore@@QEAAXPEAVElement@2@@Z)
Note:
See TracChangeset
for help on using the changeset viewer.