Changeset 29933 in webkit
- Timestamp:
- Feb 2, 2008, 2:46:36 AM (17 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r29932 r29933 1 2008-02-02 David Hyatt <hyatt@apple.com> 2 3 Fix for bug 4812. Support last-child and last-of-type (and make sure they are properly dynamic). 4 5 Reviewed by olliej 6 7 * fast/css/last-child-pseudo-class.html: Added. 8 * fast/css/last-of-type-pseudo-class.html: Added. 9 * platform/mac/fast/css/last-child-pseudo-class-expected.checksum: Added. 10 * platform/mac/fast/css/last-child-pseudo-class-expected.png: Added. 11 * platform/mac/fast/css/last-child-pseudo-class-expected.txt: Added. 12 * platform/mac/fast/css/last-of-type-pseudo-class-expected.checksum: Added. 13 * platform/mac/fast/css/last-of-type-pseudo-class-expected.png: Added. 14 * platform/mac/fast/css/last-of-type-pseudo-class-expected.txt: Added. 15 1 16 2008-02-01 David Hyatt <hyatt@apple.com> 2 17 -
trunk/WebCore/ChangeLog
r29932 r29933 1 2008-02-02 David Hyatt <hyatt@apple.com> 2 3 Fix for bug 4812. Support last-child and last-of-type CSS3 selectors. Brings Acid3 score up to 68/100. 4 5 Reviewed by olliej 6 7 Added fast/css/last-child-pseudo-class.html, fast/css/last-of-type-pseudo-class.html 8 9 * css/CSSGrammar.y: 10 * css/CSSSelector.cpp: 11 (WebCore::CSSSelector::extractPseudoType): 12 * css/CSSSelector.h: 13 (WebCore::CSSSelector::): 14 * css/CSSStyleSelector.cpp: 15 (WebCore::CSSStyleSelector::checkOneSelector): 16 1 17 2008-02-01 David Hyatt <hyatt@apple.com> 2 18 -
trunk/WebCore/css/CSSGrammar.y
r29932 r29933 857 857 else if (type == CSSSelector::PseudoEmpty || 858 858 type == CSSSelector::PseudoFirstChild || 859 type == CSSSelector::PseudoFirstOfType) { 859 type == CSSSelector::PseudoFirstOfType || 860 type == CSSSelector::PseudoLastChild || 861 type == CSSSelector::PseudoLastOfType) { 860 862 CSSParser* p = static_cast<CSSParser*>(parser); 861 863 Document* doc = p->document(); -
trunk/WebCore/css/CSSSelector.cpp
r29257 r29933 88 88 static AtomicString hover("hover"); 89 89 static AtomicString indeterminate("indeterminate"); 90 static AtomicString lastChild("last-child"); 91 static AtomicString lastOfType("last-of-type"); 90 92 static AtomicString link("link"); 91 93 static AtomicString lang("lang("); … … 142 144 else if (m_value == firstChild) 143 145 m_pseudoType = PseudoFirstChild; 146 else if (m_value == lastChild) 147 m_pseudoType = PseudoLastChild; 148 else if (m_value == lastOfType) 149 m_pseudoType = PseudoLastOfType; 144 150 else if (m_value == firstLetter) { 145 151 m_pseudoType = PseudoFirstLetter; -
trunk/WebCore/css/CSSSelector.h
r29257 r29933 122 122 PseudoFirstChild, 123 123 PseudoFirstOfType, 124 PseudoLastChild, 125 PseudoLastOfType, 124 126 PseudoFirstLine, 125 127 PseudoFirstLetter, … … 182 184 unsigned m_relation : 3; // enum Relation 183 185 mutable unsigned m_match : 4; // enum Match 184 mutable unsigned m_pseudoType : 6; // PseudoType186 mutable unsigned m_pseudoType : 8; // PseudoType 185 187 186 188 private: -
trunk/WebCore/css/CSSStyleSelector.cpp
r29932 r29933 1633 1633 break; 1634 1634 n = n->previousSibling(); 1635 } 1636 if (!n) 1637 result = true; 1638 if (!m_collectRulesOnly) { 1639 RenderStyle* parentStyle = (m_element == e) ? m_parentStyle : e->parentNode()->renderStyle(); 1640 if (parentStyle) 1641 parentStyle->setChildrenAffectedByPositionalRules(); 1642 } 1643 return result; 1644 } 1645 break; 1646 } 1647 case CSSSelector::PseudoLastChild: { 1648 // first-child matches the first child that is an element 1649 if (e->parentNode() && e->parentNode()->isElementNode()) { 1650 bool result = false; 1651 Node* n = e->nextSibling(); 1652 while (n && !n->isElementNode()) 1653 n = n->nextSibling(); 1654 if (!n) 1655 result = true; 1656 if (!m_collectRulesOnly) { 1657 RenderStyle* childStyle = (m_element == e) ? m_style : e->renderStyle(); 1658 RenderStyle* parentStyle = (m_element == e) ? m_parentStyle : e->parentNode()->renderStyle(); 1659 if (parentStyle) 1660 parentStyle->setChildrenAffectedByLastChildRules(); 1661 if (result && childStyle) 1662 childStyle->setLastChildState(); 1663 } 1664 return result; 1665 } 1666 break; 1667 } 1668 case CSSSelector::PseudoLastOfType: { 1669 // first-of-type matches the first element of its type 1670 if (e->parentNode() && e->parentNode()->isElementNode()) { 1671 bool result = false; 1672 const QualifiedName& type = e->tagQName(); 1673 Node* n = e->nextSibling(); 1674 while (n) { 1675 if (n->isElementNode() && static_cast<Element*>(n)->hasTagName(type)) 1676 break; 1677 n = n->nextSibling(); 1635 1678 } 1636 1679 if (!n)
Note:
See TracChangeset
for help on using the changeset viewer.