Changeset 25341 in webkit
- Timestamp:
- Sep 1, 2007 1:08:33 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r25335 r25341 1 2007-09-01 Rob Buis <buis@kde.org> 2 3 Reviewed by Darin. 4 5 Testcase for: 6 http://bugs.webkit.org/show_bug.cgi?id=12988 7 First element (in document order) is not returned when other duplicate ID-ed elements were created first 8 9 * fast/dom/duplicate-ids-document-order-expected.txt: Added. 10 * fast/dom/duplicate-ids-document-order.html: Added. 11 1 12 2007-08-31 Alice Liu <alice.liu@apple.com> 2 13 -
trunk/WebCore/ChangeLog
r25340 r25341 1 2007-09-01 Rob Buis <buis@kde.org> 2 3 Reviewed by Darin. 4 5 http://bugs.webkit.org/show_bug.cgi?id=12988 6 First element (in document order) is not returned when other duplicate ID-ed elements were created first 7 8 Reset the element id cache when id's are added or removed and there 9 are duplicates for that id. 10 11 Tests: fast/dom/duplicate-ids-document-order.html 12 13 * dom/Document.cpp: 14 (WebCore::Document::getElementById): 15 (WebCore::Document::addElementById): 16 (WebCore::Document::removeElementById): 17 1 18 2007-09-01 Rob Buis <buis@kde.org> 2 19 -
trunk/WebCore/dom/Document.cpp
r25308 r25341 705 705 element = static_cast<Element*>(n); 706 706 if (element->hasID() && element->getAttribute(idAttr) == elementId) { 707 m_duplicateIds.remove(elementId.impl());708 707 m_elementsById.set(elementId.impl(), element); 709 708 return element; … … 807 806 if (!m_elementsById.contains(elementId.impl())) 808 807 m_elementsById.set(elementId.impl(), element); 809 else 808 else { 810 809 m_duplicateIds.add(elementId.impl()); 810 m_elementsById.remove(elementId.impl()); 811 } 811 812 } 812 813 … … 815 816 if (m_elementsById.get(elementId.impl()) == element) 816 817 m_elementsById.remove(elementId.impl()); 817 else 818 else { 818 819 m_duplicateIds.remove(elementId.impl()); 820 m_elementsById.remove(elementId.impl()); 821 } 819 822 } 820 823
Note: See TracChangeset
for help on using the changeset viewer.