selectors should match attribute name with case sensitivity based on element & document type
https://bugs.webkit.org/show_bug.cgi?id=71152

Reviewed by Darin Adler.

Source/WebCore:

Support case-sensitive attribute name selecting for non HTML. In order to do this we have to
store the attribute name in the selector as-is when css parsing, and get the lowercase localName
on demand for case-insensitive matching. The only time we want case-insensitive matching is when
we try to match a HTML element in a HTML document.

Tests: fast/dom/SelectorAPI/attrname-case-insensitive.html
       fast/dom/SelectorAPI/attrname-case-sensitive.xhtml
       svg/css/case-sensitive-attrname-selectors.html

* css/CSSGrammar.y.in: do not lowercase attribute selector name.
* css/CSSParserValues.h:
(WebCore::CSSParserSelector::setAttribute):
* css/CSSSelector.cpp:
(WebCore::CSSSelector::setAttribute):
* css/CSSSelector.h: allow access to lowered version of attribute localName if needed.
(WebCore::CSSSelector::attributeCanonicalLocalName):
* css/SelectorChecker.cpp:
(WebCore::anyAttributeMatches): do only case-insensitive matching for HTML.
(WebCore::SelectorChecker::checkOne):
* css/SelectorChecker.h:
(WebCore::SelectorChecker::checkExactAttribute): do only case-insensitive matching for HTML.
* css/SelectorCheckerFastPath.cpp:
(WebCore::HTMLNames::checkExactAttributeValue):
* css/SelectorCheckerFastPath.h:
(WebCore::SelectorCheckerFastPath::matchesRightmostAttributeSelector):
* dom/Attribute.h:
(WebCore::Attribute::matches): use more convenient parameters.

LayoutTests:

Results matches FireFox nightly.

* fast/dom/SelectorAPI/attrname-case-insensitive-expected.txt: Added.
* fast/dom/SelectorAPI/attrname-case-insensitive.html: Check that in HTML documents CSS selectors
use case-insensitive attribute name matching for HTML elements, case-sensitive otherwise.
* fast/dom/SelectorAPI/attrname-case-sensitive-expected.txt: Added.
* fast/dom/SelectorAPI/attrname-case-sensitive.xhtml: Check that in XHTML documents CSS selectors
always use case-sensitive attribute name matching.
* svg/css/case-sensitive-attrname-selectors-expected.txt: Added.
* svg/css/case-sensitive-attrname-selectors.html: Check that in HTML documents CSS selectors in stylesheets
use case-insensitive attribute name matching for HTML elements, case-sensitive otherwise.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153631 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FormAssociatedElement shouldn't create out-of-tree FormAttributeTargetObserver
https://bugs.webkit.org/show_bug.cgi?id=119309

Reviewed by Kent Tamura.

Merge https://chromium.googlesource.com/chromium/blink/+/6fbdcbf311de539107bc28711b3f7a527176e97b.

I'm not merging the test since the attached test case only works when the shadow DOM API is enabled.

* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::formAttributeChanged):
(WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153632 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Forms: color] <input type='color'> popover color well implementation
<rdar://problem/14411008> and https://bugs.webkit.org/show_bug.cgi?id=119356

Patch by Ruth Fong <ruth_fong@apple.com> on 2013-08-01
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig: Added and enabled INPUT_TYPE_COLOR_POPOVER.

Source/WebCore:

* Configurations/FeatureDefines.xcconfig: Added and enabled INPUT_TYPE_COLOR_POPOVER.

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig: Added and enabled INPUT_TYPE_COLOR_POPOVER.

Source/WebKit2:

This patch adds an popover implementation of <input type='color'>.

* Configurations/FeatureDefines.xcconfig: Added and enabled INPUT_TYPE_COLOR_POPOVER.

* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createColorPicker): Updated to pass the
  coordinates of the <input type='color'> element and the WKView
  object for the window.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::viewWillStartLiveResize): Close popover color
  picker when the view is resized.
(WebKit::WebPageProxy::viewInWindowStateDidChange): Close popover color
  picker when the view is no longer in the window.
(WebKit::WebPageProxy::showColorPicker): Updated to show either a color panel
  or a popover color picker depending on whether INPUT_TYPE_COLOR_POPOVER is enabled.

* UIProcess/mac/WebColorPickerMac.h:
* UIProcess/mac/WebColorPickerMac.mm:
(WebKit::WebColorPickerMac::create):
(WebKit::WebColorPickerMac::~WebColorPickerMac):
(WebKit::WebColorPickerMac::WebColorPickerMac):
(WebKit::WebColorPickerMac::endPicker):
(WebKit::WebColorPickerMac::setSelectedColor):
(WebKit::WebColorPickerMac::showColorPicker):
Methods updated to handle both the color panel implementation and
  the popover implementation; also renamed m_panel to m_colorPickerUI.

(-[WKColorPopoverMac initWithFrame:WebCore::inView:]):
(-[WKColorPopoverMac setAndShowPicker:WebKit::withColor:]):
(-[WKColorPopoverMac dealloc]):
(-[WKColorPopoverMac invalidate]):
(-[WKColorPopoverMac windowWillClose:]):
(-[WKColorPopoverMac didChooseColor:]):
(-[WKColorPopoverMac setColor:]):
WKColorPopoverMac provides the popover implementation of <input type='color'>.

(-[WKColorPanelMac didChooseColor:]): Updated to match the interface of
  WKColorPickerMac::didChooseColor.

Source/WTF:

* wtf/FeatureDefines.h: Added and enabled INPUT_TYPE_COLOR_POPOVER.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153633 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r153608.
http://trac.webkit.org/changeset/153608
https://bugs.webkit.org/show_bug.cgi?id=119425

Snorkled fast/multicol/overflow-content-expected.html
(Requested by kling on #webkit).

Source/WebCore:

* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyMatchedProperties):

LayoutTests:

* fast/css/identical-logical-height-decl-expected.html: Removed.
* fast/css/identical-logical-height-decl.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153634 268f45cc-cd09-0410-ab3c-d52691b4dbfc