Changeset 167210 in webkit
- Timestamp:
- Apr 13, 2014, 11:55:15 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 14 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/editing/text-iterator/count-matches-in-form-expected.txt (added)
-
LayoutTests/editing/text-iterator/count-matches-in-form.html (added)
-
LayoutTests/fast/text/window-find.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityObject.cpp (modified) (1 diff)
-
Source/WebCore/dom/Element.cpp (modified) (1 diff)
-
Source/WebCore/dom/Element.h (modified) (1 diff)
-
Source/WebCore/dom/Position.cpp (modified) (2 diffs)
-
Source/WebCore/dom/Range.cpp (modified) (1 diff)
-
Source/WebCore/editing/TextIterator.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLHRElement.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLHRElement.h (modified) (2 diffs)
-
Source/WebCore/html/HTMLObjectElement.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLObjectElement.h (modified) (1 diff)
-
Source/WebCore/testing/Internals.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r167199 r167210 1 2014-04-13 Darin Adler <darin@apple.com> 2 3 REGRESSION (r158617): Find on Page can get stuck in a loop when the search string occurs in an <input> in a <fieldset> 4 https://bugs.webkit.org/show_bug.cgi?id=126322 5 6 Reviewed by Ryosuke Niwa. 7 8 * editing/text-iterator/count-matches-in-form-expected.txt: Added. 9 * editing/text-iterator/count-matches-in-form.html: Added. 10 11 * fast/text/window-find.html: Tweaked the test a bit, making it a little easier to 12 see if the test hasn't even run. 13 1 14 2014-04-08 Oliver Hunt <oliver@apple.com> 2 15 -
trunk/LayoutTests/fast/text/window-find.html
r124680 r167210 2 2 <head> 3 3 <script> 4 if (window.testRunner) { 5 testRunner.dumpAsText(); 6 testRunner.waitUntilDone(); 7 } 4 5 if (window.testRunner) 6 testRunner.dumpAsText(); 8 7 9 8 function fail(s) { 10 document.body.innerHTML = "FAIL: " + s;9 document.body.innerHTML = "FAIL: " + s; 11 10 } 12 11 13 12 function runTest() { 14 // Need to force layout for window.find() to operate correctly. 15 var forceLayout = document.body.offsetHeight; 16 if (window.find('nonsense')) fail('found: nonsense'); 17 // https://bugs.webkit.org/show_bug.cgi?id=53654 -- failure when flipping 18 // case sensitivity back-to-back. 19 if (window.find('nonsense', true)) fail('found: nonsense'); 20 if (window.find('nonsense', false)) fail('found: nonsense'); 21 if (!window.find('for')) fail('not found: for'); 22 if (window.find('for')) fail('found: for'); 23 // Go backwards. 24 if (!window.find('test', true, true, false)) fail('not found: test'); 25 if (window.find('for', true, true, false)) fail('found: for'); 26 // Backwards and case sensitivity. 27 if (window.find('this', true, true, false)) fail('found: this'); 28 if (!window.find('This', true, true, false)) fail('not found: This'); 29 // Wrap-around forwards. 30 if (!window.find('for', true, false, true)) fail('not found: for'); 31 if (!window.find('for', true, false, true)) fail('not found: for'); 32 // Wrap-around backwards. 33 if (!window.find('for', true, true, true)) fail('not found: for'); 34 if (!window.find('for', true, true, true)) fail('not found: for'); 35 // Case sensitivity, forwards. 36 if (!window.find('for', true, false, true)) fail('not found: for'); 37 if (!window.find('fOR', false, false, true)) fail('not found: for'); 38 if (!window.find('for', false, false, true)) fail('not found: for'); 39 if (!window.find('for', true, false, true)) fail('not found: for'); 40 if (window.find('FOR', true, false, true)) fail('found: FOR'); 13 if (window.find('nonsense')) fail('found: nonsense'); 14 if (window.find('nonsense', true)) fail('found: nonsense'); 15 if (window.find('nonsense', false)) fail('found: nonsense'); 16 if (!window.find('for')) fail('not found: for'); 17 if (window.find('for')) fail('found: for'); 18 // Go backwards. 19 if (!window.find('test', true, true, false)) fail('not found: test'); 20 if (window.find('for', true, true, false)) fail('found: for'); 21 // Backwards and case sensitivity. 22 if (window.find('this', true, true, false)) fail('found: this'); 23 if (!window.find('This', true, true, false)) fail('not found: This'); 24 // Wrap-around forwards. 25 if (!window.find('for', true, false, true)) fail('not found: for'); 26 if (!window.find('for', true, false, true)) fail('not found: for'); 27 // Wrap-around backwards. 28 if (!window.find('for', true, true, true)) fail('not found: for'); 29 if (!window.find('for', true, true, true)) fail('not found: for'); 30 // Case sensitivity, forwards. 31 if (!window.find('for', true, false, true)) fail('not found: for'); 32 if (!window.find('fOR', false, false, true)) fail('not found: for'); 33 if (!window.find('for', false, false, true)) fail('not found: for'); 34 if (!window.find('for', true, false, true)) fail('not found: for'); 35 if (window.find('FOR', true, false, true)) fail('found: FOR'); 41 36 42 if (window.testRunner) 43 testRunner.notifyDone(); 37 document.body.innerHTML = "This is a test for window.find(). SUCCESS!"; 44 38 } 39 45 40 </script> 46 41 </head> 47 42 <body onload="runTest()"> 48 This is a test for window.find() . SUCCESS!43 This is a test for window.find(); the test has not run yet. 49 44 </body> 50 45 </html> -
trunk/Source/WebCore/ChangeLog
r167208 r167210 1 2014-04-13 Darin Adler <darin@apple.com> 2 3 REGRESSION (r158617): Find on Page can get stuck in a loop when the search string occurs in an <input> in a <fieldset> 4 https://bugs.webkit.org/show_bug.cgi?id=126322 5 6 Reviewed by Ryosuke Niwa. 7 8 * dom/Element.cpp: 9 (WebCore::Element::canContainRangeEndPoint): Now returns false when the role of the element 10 is "img". This is the same rule that's hard-coded in isRenderReplacedElement for the same 11 reason. Need more test coverage to make sure this role feature works consistently. 12 13 * dom/Element.h: Made canContainRangeEndPoint no longer inline since it's not just a 14 return statement any more. 15 16 * dom/Position.cpp: 17 (WebCore::Position::isCandidate): Took out code that calls isRendererReplacedElement 18 that was added in r158617; not needed now that we updated canContainRangeEndPoint. 19 20 * dom/Range.cpp: 21 (WebCore::Range::firstNode): Removed code here that called isRendererReplacedElement. 22 This was the wrong level to be adding editing logic, and there's a FIXME here to that 23 effect, which we are now deleting. This was the change that broke Find. 24 25 * editing/TextIterator.cpp: Added a comment about the redundancy between the 26 isRendererReplacedElement and editingIgnoresContent functions. 27 28 * html/HTMLHRElement.cpp: 29 (WebCore::HTMLHRElement::canContainRangeEndPoint): Call through to base class instead 30 of just returning true when we have child nodes. Lets Element::canContainRangeEndPoint 31 do its thing. 32 * html/HTMLHRElement.h: Ditto. 33 34 * html/HTMLObjectElement.cpp: 35 (WebCore::HTMLObjectElement::canContainRangeEndPoint): Call through to base class instead 36 of just returning true when we have fallback content. Lets Element::canContainRangeEndPoint 37 do its thing. 38 * html/HTMLObjectElement.h: Ditto. 39 40 * testing/Internals.cpp: 41 (WebCore::Internals::countMatchesForText): Set the limit to 1000 instead of infinite. 42 1 43 2014-04-12 Darin Adler <darin@apple.com> 2 44 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r167186 r167210 1070 1070 return listItem->markerTextWithSuffix(); 1071 1071 } 1072 1072 1073 1073 String AccessibilityObject::stringForVisiblePositionRange(const VisiblePositionRange& visiblePositionRange) const 1074 1074 { -
trunk/Source/WebCore/dom/Element.cpp
r166870 r167210 2940 2940 } 2941 2941 2942 bool Element::canContainRangeEndPoint() const 2943 { 2944 return !equalIgnoringCase(fastGetAttribute(roleAttr), "img"); 2945 } 2946 2942 2947 } // namespace WebCore -
trunk/Source/WebCore/dom/Element.h
r166870 r167210 485 485 virtual bool isSearchFieldCancelButtonElement() const { return false; } 486 486 487 virtual bool canContainRangeEndPoint() const override { return true; }487 virtual bool canContainRangeEndPoint() const override; 488 488 489 489 // Used for disabled form elements; if true, prevents mouse events from being dispatched -
trunk/Source/WebCore/dom/Position.cpp
r165676 r167210 225 225 return Position(m_anchorNode.get(), 0, PositionIsOffsetInAnchor); 226 226 } 227 227 228 if (!m_anchorNode->offsetInCharacters() 228 229 && (m_anchorType == PositionIsAfterAnchor || m_anchorType == PositionIsAfterChildren || static_cast<unsigned>(m_offset) == m_anchorNode->childNodeCount()) … … 936 937 return false; 937 938 938 if (isRendererReplacedElement(renderer))939 return !nodeIsUserSelectNone(deprecatedNode()) && atFirstEditingPositionForNode();940 941 939 if (renderer->isRenderBlockFlow()) { 942 940 RenderBlockFlow& block = toRenderBlockFlow(*renderer); -
trunk/Source/WebCore/dom/Range.cpp
r164964 r167210 1570 1570 return 0; 1571 1571 if (m_start.container()->offsetInCharacters()) 1572 return m_start.container();1573 // FIXME: A renderer-based rule is completely out of place here.1574 // For one thing, the renderer could be out of date if the DOM was recently changed.1575 if (isRendererReplacedElement(m_start.container()->renderer()))1576 1572 return m_start.container(); 1577 1573 if (Node* child = m_start.container()->childNode(m_start.offset())) -
trunk/Source/WebCore/editing/TextIterator.cpp
r166507 r167210 243 243 } 244 244 245 // FIXME: editingIgnoresContent and isRendererReplacedElement try to do the same job. 246 // It's not good to have both of them. 245 247 bool isRendererReplacedElement(RenderObject* renderer) 246 248 { -
trunk/Source/WebCore/html/HTMLHRElement.cpp
r161334 r167210 101 101 } 102 102 103 bool HTMLHRElement::canContainRangeEndPoint() const 104 { 105 return hasChildNodes() && HTMLElement::canContainRangeEndPoint(); 103 106 } 107 108 } -
trunk/Source/WebCore/html/HTMLHRElement.h
r162180 r167210 33 33 static PassRefPtr<HTMLHRElement> create(const QualifiedName&, Document&); 34 34 35 virtual bool canContainRangeEndPoint() const override { return hasChildNodes(); }36 37 35 private: 38 36 HTMLHRElement(const QualifiedName&, Document&); … … 40 38 virtual bool isPresentationAttribute(const QualifiedName&) const override; 41 39 virtual void collectStyleForPresentationAttribute(const QualifiedName&, const AtomicString&, MutableStyleProperties&) override; 40 virtual bool canContainRangeEndPoint() const override; 42 41 }; 43 42 -
trunk/Source/WebCore/html/HTMLObjectElement.cpp
r166853 r167210 512 512 } 513 513 514 } 514 bool HTMLObjectElement::canContainRangeEndPoint() const 515 { 516 return m_useFallbackContent && HTMLPlugInImageElement::canContainRangeEndPoint(); 517 } 518 519 } -
trunk/Source/WebCore/html/HTMLObjectElement.h
r166853 r167210 98 98 virtual bool appendFormData(FormDataList&, bool) override; 99 99 100 virtual bool canContainRangeEndPoint() const override { return useFallbackContent(); }100 virtual bool canContainRangeEndPoint() const override; 101 101 102 102 bool m_docNamedItem : 1; -
trunk/Source/WebCore/testing/Internals.cpp
r166849 r167210 1436 1436 1437 1437 bool mark = markMatches == "mark"; 1438 return document->frame()->editor().countMatchesForText(text, nullptr, findOptions, std::numeric_limits<unsigned>::max(), mark, nullptr);1438 return document->frame()->editor().countMatchesForText(text, nullptr, findOptions, 1000, mark, nullptr); 1439 1439 } 1440 1440
Note:
See TracChangeset
for help on using the changeset viewer.