[Shadow] Using isUnknownPseudoElement() for shadow pseudo id seems confusing
https://bugs.webkit.org/show_bug.cgi?id=100826

Reviewed by Hajime Morita.

Source/WebCore:

We used isUnknownPseudoElement() for these 3 meanings: 1) the element is a custom pseudo-element (starting with 'x-'),
2) the element is a webkit custom pseudo-element (starting with '-webkit-'), and 3) the element has an unknown type.
We would like to distinguish them when parsing CSSSelector types. Also, we disable using (3) type for using
shadowPseudoId.

In this patch, we allow using WebKitCustomPseudoElement in AuthorShadowRoot, and CustomPseudoElement in
UAShadowRoot. However, we will disable them later.

Test: fast/dom/shadow/shadow-pseudo-id.html

* css/CSSGrammar.y.in: Now we can discard UNKNOWN type. It should not match anything.
* css/CSSParser.cpp:
(WebCore::CSSParser::updateSpecifiersWithElementName):
(WebCore::CSSParser::updateSpecifiers):
* css/CSSParserValues.h:
(WebCore::CSSParserSelector::isCustomPseudoElement):
(CSSParserSelector):
* css/CSSSelector.cpp:
(WebCore::CSSSelector::pseudoId):
(WebCore::CSSSelector::parsePseudoType):
(WebCore::CSSSelector::isCustomPseudoType): Returns true if the type is PseudoUserAgentCustomElement or PseudoWebKitCustomElement.
(WebCore::CSSSelector::extractPseudoType):
* css/CSSSelector.h:
(CSSSelector):
(WebCore::CSSSelector::isCustomPseudoElement):
(WebCore):
* css/CSSSelectorList.cpp:
(WebCore::SelectorHasInvalidSelectorFunctor::operator()): We will reject all selectors which were judged as
UNKNOWN before. i.e. It contians all three types for now.
(WebCore::CSSSelectorList::hasInvalidSelector): Renamed.
* css/CSSSelectorList.h:
(CSSSelectorList):
* css/RuleSet.cpp:
(WebCore::RuleSet::addRule):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkSelector):
* dom/Element.cpp:
(WebCore::Element::setShadowPseudoId):
* dom/SelectorQuery.cpp:
(WebCore::SelectorQueryCache::add):

LayoutTests:

* fast/dom/shadow/shadow-nested-pseudo-id.html: Fixed a testcase so that shadowPseudoId starts with 'x-'.
* fast/dom/shadow/shadow-pseudo-id-expected.html: Added.
* fast/dom/shadow/shadow-pseudo-id.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CoordinatedGraphics] compositing/iframes/connect-compositing-iframe.html crashes
https://bugs.webkit.org/show_bug.cgi?id=101232

Reviewed by Jocelyn Turcotte.

The crash is happening in CoordinatedGraphicsLayer::flushCompositingState
because we dereferencing a null m_coordinatedGraphicsLayerClient.
This happens when the root layer became composited because it has content overlapping
with an inner iframe that is composited. In this case the RenderLayerCompositor attaches
the layer with RootLayerAttachedViaEnclosingFrame attachment flag and do not call
ChromeClient::attachRootGraphcisLayer so we don't have a chance to set m_coordinatedGraphicsLayerClient.
The solution is to set the client early in the factory method.

* WebProcess/WebPage/CoordinatedGraphics/LayerTreeCoordinator.cpp:
(WebKit::LayerTreeCoordinator::createGraphicsLayer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133578 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: dim size bar for expanded item in native memory snapshot grid
https://bugs.webkit.org/show_bug.cgi?id=101062

Patch by Alexei Filippov <alph@chromium.org> on 2012-11-06
Reviewed by Yury Semikhatsky.

* inspector/front-end/nativeMemoryProfiler.css:
(.native-snapshot-view .data-grid .expanded div.size-bar):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133579 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium-Android] Skip a number of crashing tests.

Unreviewed rebaselining.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
removeAttribute('style') not working in certain circumstances
https://bugs.webkit.org/show_bug.cgi?id=99295

Reviewed by Ryosuke Niwa.

Source/WebCore:

After web developers did style.XXXX=YYYY for some element, the inline
style should be always removable by using "removeAttribute('style')".
Currently it depends on whether web developers invokes
getAttribute('style'), setAttribute('style), and so on. E.g. once they
invoke getAttribute('style'), removeAttribute('style') works. This is
very confusing behavior.
Looking at Firefox browser, removeAttribute('style') always removes
all inline styles.

Test: fast/css/remove-attribute-style.html

* css/StylePropertySet.cpp:
(WebCore::StylePropertySet::clear):
Added a new method to remove all style properties.
(WebCore):
* css/StylePropertySet.h:
(StylePropertySet):
* dom/Element.cpp:
(WebCore::Element::removeAttribute):
If 'style' is given but the element has no style attribute, the old
code did nothing. However, if the element is styled element and has any
inline styles, the inline styles should be removed. So invoke
StyledElement::removeAllInlineStyleProperties and if any inline styles
are removed, invoke style recalc, too.
* dom/StyledElement.cpp:
(WebCore::StyledElement::removeAllInlineStyleProperties):
Added a new method to remove all inline style propeties. If any inline
style is removed, invoke inlineStyleChanged() to force style recalc.
(WebCore):
* dom/StyledElement.h:
(StyledElement):

LayoutTests:

* fast/css/remove-attribute-style-expected.txt: Added.
* fast/css/remove-attribute-style.html: Added.


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