Changeset 47444 in webkit
- Timestamp:
- Aug 18, 2009 12:50:04 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 18 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r47440 r47444 1 2009-08-18 Michelangelo De Simone <micdesim@gmail.com> 2 3 Reviewed by Adele Peterson. 4 5 https://bugs.webkit.org/show_bug.cgi?id=27357 6 Tests for :valid and :invalid CSS selectors, from HTML5 specs. 7 http://www.whatwg.org/specs/web-apps/current-work/#selector-valid 8 9 * fast/css/pseudo-invalid-001-expected.txt: Added. 10 * fast/css/pseudo-invalid-001.html: Added. 11 * fast/css/pseudo-invalid-002-expected.txt: Added. 12 * fast/css/pseudo-invalid-002.html: Added. 13 * fast/css/pseudo-valid-001-expected.txt: Added. 14 * fast/css/pseudo-valid-001.html: Added. 15 * fast/css/pseudo-valid-002-expected.txt: Added. 16 * fast/css/pseudo-valid-002.html: Added. 17 * fast/css/pseudo-valid-003-expected.txt: Added. 18 * fast/css/pseudo-valid-003.html: Added. 19 * fast/css/pseudo-valid-004-expected.txt: Added. 20 * fast/css/pseudo-valid-004.html: Added. 21 * fast/css/pseudo-valid-005-expected.txt: Added. 22 * fast/css/pseudo-valid-005.html: Added. 23 * fast/css/pseudo-valid-006-expected.txt: Added. 24 * fast/css/pseudo-valid-006.html: Added. 25 * fast/css/pseudo-valid-007-expected.txt: Added. 26 * fast/css/pseudo-valid-007.html: Added. 27 * fast/dom/plugin-attributes-enumeration-expected.txt: 28 1 29 2009-08-16 David Hyatt <hyatt@apple.com> 2 30 -
trunk/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt
r32664 r47444 20 20 useMap 21 21 vspace 22 willValidate 22 23 ---------- 23 24 EMBED also has: -
trunk/WebCore/ChangeLog
r47443 r47444 1 2009-08-18 Michelangelo De Simone <micdesim@gmail.com> 2 3 Reviewed by Adele Peterson. 4 5 https://bugs.webkit.org/show_bug.cgi?id=27357 6 Support for :valid and :invalid CSS selectors, from HTML5 specs. 7 http://www.whatwg.org/specs/web-apps/current-work/#selector-valid 8 9 Tests: fast/css/pseudo-invalid-001.html 10 fast/css/pseudo-invalid-002.html 11 fast/css/pseudo-valid-001.html 12 fast/css/pseudo-valid-002.html 13 fast/css/pseudo-valid-003.html 14 fast/css/pseudo-valid-004.html 15 fast/css/pseudo-valid-005.html 16 fast/css/pseudo-valid-006.html 17 fast/css/pseudo-valid-007.html 18 19 * css/CSSSelector.cpp: 20 (WebCore::CSSSelector::extractPseudoType): extracts new pseudo-classes 21 * css/CSSSelector.h: 22 (WebCore::CSSSelector::): 23 * css/CSSStyleSelector.cpp: 24 (WebCore::CSSStyleSelector::canShareStyleWithElement): Make sure we don't share style between 25 form controls that have different validity states. 26 (WebCore::CSSStyleSelector::SelectorChecker::checkOneSelector): applies 27 style associated to new pseudo-classes 28 * dom/Element.h: 29 (WebCore::Element::willValidate): pushed up in hierarchy 30 (WebCore::Element::isValidFormControlElement): checks for valid form 31 control elements (wraps ValidityState::valid()) 32 * html/HTMLFormControlElement.cpp: 33 (WebCore::HTMLFormControlElement::willValidate): minor clean up 34 (WebCore::HTMLFormControlElement::isValidFormControlElement): ditto 35 * html/HTMLFormControlElement.h: 36 * html/HTMLKeygenElement.h: 37 (WebCore::HTMLKeygenElement::willValidate): added 38 * html/HTMLObjectElement.h: 39 (WebCore::HTMLObjectElement::willValidate): added 40 * html/HTMLObjectElement.idl: 41 1 42 2009-08-18 Pavel Feldman <pfeldman@chromium.org> 2 43 -
trunk/WebCore/css/CSSSelector.cpp
r47155 r47444 82 82 DEFINE_STATIC_LOCAL(AtomicString, readOnly, ("read-only")); 83 83 DEFINE_STATIC_LOCAL(AtomicString, readWrite, ("read-write")); 84 DEFINE_STATIC_LOCAL(AtomicString, valid, ("valid")); 85 DEFINE_STATIC_LOCAL(AtomicString, invalid, ("invalid")); 84 86 DEFINE_STATIC_LOCAL(AtomicString, drag, ("-webkit-drag")); 85 87 DEFINE_STATIC_LOCAL(AtomicString, dragAlias, ("-khtml-drag")); // was documented with this name in Apple documentation, so keep an alia … … 180 182 else if (m_value == readWrite) 181 183 m_pseudoType = PseudoReadWrite; 184 else if (m_value == valid) 185 m_pseudoType = PseudoValid; 186 else if (m_value == invalid) 187 m_pseudoType = PseudoInvalid; 182 188 else if (m_value == drag || m_value == dragAlias) 183 189 m_pseudoType = PseudoDrag; -
trunk/WebCore/css/CSSSelector.h
r47155 r47444 134 134 PseudoReadOnly, 135 135 PseudoReadWrite, 136 PseudoValid, 137 PseudoInvalid, 136 138 PseudoIndeterminate, 137 139 PseudoTarget, -
trunk/WebCore/css/CSSStyleSelector.cpp
r47229 r47444 999 999 if (s->isDefaultButtonForForm() != m_element->isDefaultButtonForForm()) 1000 1000 return false; 1001 1002 if ((s->willValidate() && s->isValidFormControlElement()) != 1003 (m_element->willValidate() && m_element->isValidFormControlElement())) 1004 return false; 1001 1005 } 1002 1006 … … 2390 2394 case CSSSelector::PseudoRequired: 2391 2395 return e && e->isRequiredFormControl(); 2396 case CSSSelector::PseudoValid: 2397 return e && e->willValidate() && e->isValidFormControlElement(); 2398 case CSSSelector::PseudoInvalid: 2399 return e && e->willValidate() && !e->isValidFormControlElement(); 2392 2400 case CSSSelector::PseudoChecked: { 2393 2401 if (!e || !e->isFormControlElement()) -
trunk/WebCore/dom/Element.h
r47165 r47444 194 194 virtual bool isRequiredFormControl() const { return false; } 195 195 virtual bool isDefaultButtonForForm() const { return false; } 196 virtual bool willValidate() const { return false; } 197 virtual bool isValidFormControlElement() { return false; } 196 198 197 199 virtual bool formControlValueMatchesRenderer() const { return false; } -
trunk/WebCore/html/HTMLFormControlElement.cpp
r47155 r47444 261 261 // The control does not have a datalist element as an ancestor. 262 262 // The control is not an output element. 263 return form() && name().length() && !disabled() && !isReadOnlyFormControl();263 return form() && !name().isEmpty() && !disabled() && !isReadOnlyFormControl(); 264 264 } 265 265 … … 298 298 { 299 299 return isSuccessfulSubmitButton() && m_form && m_form->defaultButton() == this; 300 } 301 302 bool HTMLFormControlElement::isValidFormControlElement() 303 { 304 return validity()->valid(); 300 305 } 301 306 -
trunk/WebCore/html/HTMLFormControlElement.h
r47155 r47444 119 119 virtual HTMLFormElement* virtualForm() const; 120 120 virtual bool isDefaultButtonForForm() const; 121 virtual bool isValidFormControlElement(); 121 122 122 123 HTMLFormElement* m_form; -
trunk/WebCore/html/HTMLKeygenElement.h
r43367 r47444 39 39 virtual bool appendFormData(FormDataList&, bool); 40 40 41 virtual bool willValidate() const { return false; } 42 41 43 private: 42 44 AtomicString m_challenge; -
trunk/WebCore/html/HTMLObjectElement.h
r39065 r47444 105 105 virtual void addSubresourceAttributeURLs(ListHashSet<KURL>&) const; 106 106 107 virtual bool willValidate() const { return false; } 108 107 109 private: 108 110 void updateDocNamedItem(); -
trunk/WebCore/html/HTMLObjectElement.idl
r47352 r47444 47 47 attribute long vspace; 48 48 attribute [ConvertNullToNullString, Reflect] DOMString width; 49 readonly attribute boolean willValidate; 49 50 50 51 // Introduced in DOM Level 2:
Note: See TracChangeset
for help on using the changeset viewer.