Fix how CodeBlock dumps the opcode op_profile_type
https://bugs.webkit.org/show_bug.cgi?id=136088

Patch by Saam Barati <sbarati@apple.com> on 2014-08-20
Reviewed by Filip Pizlo.

op_profile_type was modified to receive two extra arguments,
but its dump in CodeBlock::dumpBytecode wasn't changed to
account for this, so it broke CodeBlock::dumpBytecode when
op_profile_type was in the stream of bytecode instructions.
CodeBlock::dumpBytecode now accounts for the change in
op_profile_type's arity.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, EFL build fix since r172814.

* WebKitTestRunner/config.h: Define WEBCORE_EXPORT.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@172825 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS: Implement the :placeholder-shown pseudo-class from Selectors Level 4
https://bugs.webkit.org/show_bug.cgi?id=118162

Reviewed by Antti Koivisto.

Source/WebCore:

Previously, HTMLTextFormControlElement was using some mix of its own state
and style to change the visibility of the placeholder. That approach was a little
bit too fragile, and we do not want the style to depends on the renderer() since
that creates circular dependencies.

The biggest change here is refactoring HTMLTextFormControlElement to have
1) An explicit "visible placeholder" state.
2) Separate the textUpdate() from the visibilityUpdate().
3) Remove the dependencies between the Element's style and the placeholder's style.
   This is done by simply using display:none; on the placeholder so that its parent's visibility
   is irrelevant.

When matching the selector, the style is set as unique since style sharing does not deal with
the changes of HTMLTextFormControlElement.

Tests: fast/css/placeholder-shown-basics.html
       fast/selectors/placeholder-shown-long-adjacent-backtracking.html
       fast/selectors/placeholder-shown-sibling-style-update.html
       fast/selectors/placeholder-shown-style-update.html
       fast/selectors/placeholder-shown-with-input-basics.html
       fast/selectors/placeholder-shown-with-textarea-basics.html

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
Add the CSS Selector description for CSSOM.

* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorCheckerTestFunctions.h:
(WebCore::isPlaceholderShown):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/html.css:
(::-webkit-input-placeholder):
Previously, the display was forced through the UA stylesheet. Since the display is now part
of the placeholder visibility, it is explicitly handled by HTMLTextFormControlElement and
its subclasses.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::makeUniqueIfNecessaryAndTestIsPlaceholderShown):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPlaceholderShown):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::updateValue):
(WebCore::HTMLTextAreaElement::setValueCommon):
(WebCore::HTMLTextAreaElement::updatePlaceholderText):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::HTMLTextFormControlElement):
(WebCore::HTMLTextFormControlElement::dispatchFocusEvent):
(WebCore::HTMLTextFormControlElement::dispatchBlurEvent):
(WebCore::HTMLTextFormControlElement::placeholderShouldBeVisible):
(WebCore::HTMLTextFormControlElement::updatePlaceholderVisibility):
(WebCore::HTMLTextFormControlElement::selectionDirection):
(WebCore::HTMLTextFormControlElement::restoreCachedSelection):
(WebCore::HTMLTextFormControlElement::parseAttribute):
(WebCore::HTMLTextFormControlElement::hidePlaceholder):
(WebCore::HTMLTextFormControlElement::showPlaceholderIfNecessary):
* html/HTMLTextFormControlElement.h:
(WebCore::HTMLTextFormControlElement::isPlaceholderVisible):
(WebCore::HTMLTextFormControlElement::cachedSelectionDirection):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::updatePlaceholderText):
(WebCore::TextFieldInputType::subtreeHasChanged):
(WebCore::TextFieldInputType::updateInnerTextValue):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::styleDidChange):
* testing/Internals.cpp:
(WebCore::Internals::visiblePlaceholder):

LayoutTests:

Add basic test coverage for common operations: styling, querySelector, CSSOM.

The layout test failure of placeholder-shown-sibling-style-update.html seems unrelated
to this patch, it fails in many more cases. This will be investigated separately, the failure
are used as expected values for now.

* fast/css/css-selector-text-expected.txt:
* fast/css/css-selector-text.html:
* fast/css/css-set-selector-text-expected.txt:
* fast/css/css-set-selector-text.html:
* fast/css/placeholder-shown-basics-expected.html: Added.
* fast/css/placeholder-shown-basics.html: Added.
* fast/selectors/placeholder-shown-long-adjacent-backtracking-expected.txt: Added.
* fast/selectors/placeholder-shown-long-adjacent-backtracking.html: Added.
* fast/selectors/placeholder-shown-sibling-style-update-expected.txt: Added.
* fast/selectors/placeholder-shown-sibling-style-update.html: Added.
* fast/selectors/placeholder-shown-style-update-expected.txt: Added.
* fast/selectors/placeholder-shown-style-update.html: Added.
* fast/selectors/placeholder-shown-with-input-basics-expected.txt: Added.
* fast/selectors/placeholder-shown-with-input-basics.html: Added.
* fast/selectors/placeholder-shown-with-textarea-basics-expected.txt: Added.
* fast/selectors/placeholder-shown-with-textarea-basics.html: Added.


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