REGRESSION (r96393): In some cases, generated content is never shown
https://bugs.webkit.org/show_bug.cgi?id=88196

Patch by Arpita Bahuguna <arpitabahuguna@gmail.com> on 2012-10-11
Reviewed by Antti Koivisto.

Source/WebCore:

Elements with style specified from an attribute selector in conjunction
with a pseudo-element should not take on the shared style of their
previous matching sibling (if any).

The problem here is that an attribute selector appended by a pseudo-element
does not return any matched rules for the call (matchesRuleSet(m_uncommonAttributeRuleSet.get()))
in StyleResolver::locateSharedStyle().

This is because of the way pseudo-elements are handled in
SelectorChecker::checkSelector(). For a pseudo-element selector we check
for the condition (!context.elementStyle && m_mode == ResolvingStyle) and
since for this particular flow the SelectorChecker mode is set to ResolvingStyle
and since the current element's style is still not available we fail this
initial check and return SelectorFailsLocally from checkSelector(). This is
incorrect behavior since the element does have an attribute selector specified
for it.

Have thus introduced another enum value: SharingRules for SelectorChecker's Mode.
SelectorChecker's mode should be set to SharingRules before making the
call to collectMatchingRules() and then reset (back to ResolvingStyle) thereafter.

Existing Mode value: CollectingRules although appropriate cannot be used in this
scenario because we also don't want to set any value to dynamicPseudo for this flow.

Test: fast/selectors/style-sharing-attribute-selector-with-pseudo-element.html

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkSelector):
Added additional check for SelectorChecker's mode: SharingRules when
trying to match for the pseudo-element selector.

* css/SelectorChecker.h:
Added SharingRules to Mode enum.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleSharingCandidateMatchesRuleSet):
(WebCore::StyleResolver::locateSharedStyle):
* css/StyleResolver.h:
(StyleResolver):
Renamed matchesRuleSet() to a more descriptive styleSharingCandidateMatchesRuleSet().
Also, setting the SelectorChecker's mode to SharingRules before calling
on collectMatchingRules() from styleSharingCandidateMatchesRuleSet().

LayoutTests:

* fast/selectors/style-sharing-attribute-selector-with-pseudo-element-expected.html: Added.
* fast/selectors/style-sharing-attribute-selector-with-pseudo-element.html: Added.
Ref test added for verifying that the attribute selector style, when specified
in conjucntion with pseudo-elements, is applied to the corresponding element.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131047 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Qt gardening.

Unskip more tests that now passes in DRT after the implementation of beginDragWithFiles.

* platform/qt-5.0-wk2/TestExpectations:
* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131048 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening after r131044.

Skip the failing tests.

* platform/qt-5.0-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131049 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Not reviewed: revert 131004, 131012, 131016, 131042, 131043 for breaking inspector console
https://bugs.webkit.org/show_bug.cgi?id=99042

Source/WebCore:

One can't type in the inspector console after 131004.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMAllInOne.cpp:
* dom/Element.cpp:
(WebCore::Element::attach):
(WebCore::Element::detach):
(WebCore::Element::recalcStyle):
* dom/Element.h:
(WebCore):
(Element):
* dom/ElementRareData.h:
(ElementRareData):
* dom/Node.cpp:
(WebCore::checkAcceptChild):
* dom/Node.h:
(Node):
* dom/NodeRenderingContext.cpp:
(WebCore::NodeRenderingContext::nextRenderer):
* dom/PseudoElement.cpp: Removed.
* dom/PseudoElement.h: Removed.
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::setInnerNode):
(WebCore::HitTestResult::setInnerNonSharedNode):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::styleDidChange):
(WebCore::RenderBlock::updateBeforeAfterContent):
(WebCore):
(WebCore::RenderBlock::splitBlocks):
(WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
(WebCore::RenderBlock::createReplacementRunIn):
(WebCore::RenderBlock::renderName):
* rendering/RenderBlock.h:
(RenderBlock):
* rendering/RenderButton.cpp:
(WebCore::RenderButton::updateBeforeAfterContent):
(WebCore):
* rendering/RenderButton.h:
(RenderButton):
* rendering/RenderCounter.cpp:
(WebCore::RenderCounter::originalText):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::renderName):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::renderName):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::styleDidChange):
(WebCore::RenderInline::addChildIgnoringContinuation):
(WebCore::RenderInline::splitInlines):
(WebCore::RenderInline::renderName):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::updateMarkerLocation):
* rendering/RenderMultiColumnBlock.cpp:
(WebCore::RenderMultiColumnBlock::renderName):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::createObject):
* rendering/RenderObject.h:
(WebCore::RenderObject::generatingNode):
* rendering/RenderObjectChildList.cpp:
(WebCore):
(WebCore::findBeforeAfterParent):
(WebCore::RenderObjectChildList::updateBeforeAfterStyle):
(WebCore::createRendererForBeforeAfterContent):
(WebCore::ensureBeforeAfterContainer):
(WebCore::RenderObjectChildList::updateBeforeAfterContent):
* rendering/RenderObjectChildList.h:
(RenderObjectChildList):
* rendering/RenderRubyText.cpp:
(WebCore::RenderRubyText::updateBeforeAfterContent):
(WebCore):
* rendering/RenderRubyText.h:
(RenderRubyText):
* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::renderName):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::updateBeforeAndAfterContent):
(WebCore):
(WebCore::RenderTableRow::styleDidChange):
* rendering/RenderTableRow.h:
(RenderTableRow):
(WebCore::RenderTableRow::renderName):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):
* rendering/RenderTableSection.h:
(WebCore::RenderTableSection::renderName):
* rendering/RenderTreeAsText.cpp:
(WebCore::RenderTreeAsText::writeRenderObject):

LayoutTests:

* fast/css-generated-content/before-content-continuation-chain-expected.txt:
* platform/chromium-mac-snowleopard/fast/css-generated-content/table-row-group-to-inline-expected.png:
* platform/chromium-mac/fast/css-generated-content/table-row-group-to-inline-expected.png: Added.
* platform/chromium/TestExpectations:
* platform/efl/fast/css-generated-content/table-row-group-to-inline-expected.txt:
* platform/gtk/TestExpectations:
* platform/gtk/fast/css-generated-content/table-row-group-to-inline-expected.txt:
* platform/mac/fast/css-generated-content/table-row-group-to-inline-expected.png:
* platform/mac/fast/css-generated-content/table-row-group-to-inline-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131050 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Reviewing Qt TestExpectations. Unskip now passing tests.

* platform/qt-5.0-wk1/TestExpectations:
* platform/qt-5.0-wk2/TestExpectations:
* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131051 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Filter out embedder injected content scripts
https://bugs.webkit.org/show_bug.cgi?id=99039

Reviewed by Yury Semikhatsky.

* inspector/front-end/NetworkUISourceCodeProvider.js:
(WebInspector.NetworkUISourceCodeProvider.prototype._parsedScriptSource):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Zebra stripe the console
https://bugs.webkit.org/show_bug.cgi?id=98701

Patch by John J. Barton <johnjbarton@chromium.org> on 2012-10-11
Reviewed by Pavel Feldman.

Add .console-message:hover rule to lightly highlight the message line.

* inspector/front-end/inspector.css:
(.console-message:hover):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131053 268f45cc-cd09-0410-ab3c-d52691b4dbfc
F4 key should open the picker popup on Windows and Linux
https://bugs.webkit.org/show_bug.cgi?id=98754

Reviewed by Kent Tamura.

Source/WebCore:

On Windows, F4 key is used to open the combo box popup. We will introduce the same keybinding for picker popups.

Added test to calendar-picker-key-operations.html, date-suggestion-picker-key-operations.html, time-suggestion-picker-key-operations.html.

* html/BaseMultipleFieldsDateAndTimeInputType.cpp:
(WebCore::BaseMultipleFieldsDateAndTimeInputType::handleKeydownEvent): Open picker on F4 key if it is enabled.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::shouldOpenPickerWithF4Key): Returns true if we want to enable the F4 key binding on this platform. Return false for default.
(WebCore):
* rendering/RenderTheme.h:
(RenderTheme):
* rendering/RenderThemeChromiumLinux.cpp:
(WebCore::RenderThemeChromiumLinux::shouldOpenPickerWithF4Key): Returns true.
(WebCore):
* rendering/RenderThemeChromiumLinux.h:
* rendering/RenderThemeChromiumWin.cpp:
(WebCore):
(WebCore::RenderThemeChromiumWin::shouldOpenPickerWithF4Key): Returns true.
* rendering/RenderThemeChromiumWin.h:
(RenderThemeChromiumWin):

LayoutTests:

* fast/forms/date/calendar-picker-key-operations.html:
* platform/chromium-win/fast/forms/date/calendar-picker-key-operations-expected.txt: Added.
* platform/chromium-win/platform/chromium/fast/forms/date/date-suggestion-picker-key-operations-expected.txt:
* platform/chromium-win/platform/chromium/fast/forms/time/time-suggestion-picker-key-operations-expected.txt:
* platform/chromium/fast/forms/date/date-suggestion-picker-key-operations-expected.txt:
* platform/chromium/fast/forms/date/date-suggestion-picker-key-operations.html:
* platform/chromium/fast/forms/time/time-suggestion-picker-key-operations-expected.txt:
* platform/chromium/fast/forms/time/time-suggestion-picker-key-operations.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131054 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.

Adding platform-specific baseline for svg/custom/clip-mask-negative-scale.html
that's required after r130090.

* platform/gtk/TestExpectations:
* platform/gtk/svg/custom/clip-mask-negative-scale-expected.png: Added.
* platform/gtk/svg/custom/clip-mask-negative-scale-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131055 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Blackberry] makes NavigatorContentUtils work
https://bugs.webkit.org/show_bug.cgi?id=99022

Patch by Chris Guan <chris.guan@torchmobile.com.cn> on 2012-10-11
Reviewed by Rob Buis.

Source/WebKit:

Because r126735 renamed RegisterProtocolHandler API to NavigatorContentUtils, So we
need add Modules/navigatorcontentutils into WebKit_INCLUDE_DIRECTORIES.

* PlatformBlackBerry.cmake:

Source/WebKit/blackberry:

Because r126735 renamed RegisterProtocolHandler API to NavigatorContentUtils and
r122810 added RegisterProtocolHandlerClient to the Modules/protocolhandler,
we need sync up code:
1. Add NavigatorContentUtilsClientBlackBerry class.
2. use new API provideNavigatorContentUtilsTo.

No new tests. Covered by existing tests.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::init):
* WebCoreSupport/NavigatorContentUtilsClientBlackBerry.cpp: Added.
(WebCore):
(WebCore::NavigatorContentUtilsClientBlackBerry::NavigatorContentUtilsClientBlackBerry):
(WebCore::NavigatorContentUtilsClientBlackBerry::registerProtocolHandler):
(WebCore::NavigatorContentUtilsClientBlackBerry::isProtocolHandlerRegistered):
(WebCore::NavigatorContentUtilsClientBlackBerry::unregisterProtocolHandler):
* WebCoreSupport/NavigatorContentUtilsClientBlackBerry.h: Added.
(WebKit):
(NavigatorContentUtilsClientBlackBerry):
(WebCore::NavigatorContentUtilsClientBlackBerry::~NavigatorContentUtilsClientBlackBerry):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r129478-r129480): http/tests/loading/text-content-type-with-binary-extension.html failing on Apple MountainLion Debug WK2 (Tests)
https://bugs.webkit.org/show_bug.cgi?id=98527

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-10-11
Reviewed by Kenneth Rohde Christiansen.

Tools:

Added decidePolicyForResponse callback for WTR PagePolicyClient.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
(WTR::TestController::decidePolicyForResponse):
(WTR):
* WebKitTestRunner/TestController.h:
(TestController):

LayoutTests:

Rebased http/tests/loading/text-content-type-with-binary-extension.html for WK2 EFL, as dumping order is affected.
Other WK2 ports will have to do the same.

* platform/efl-wk2/http/tests/loading/text-content-type-with-binary-extension-expected.txt: Added.
* platform/gtk-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/qt-5.0-wk2/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(130231): Causes 3 complex font test failures on EFL / Harfbuzz+Freetype
https://bugs.webkit.org/show_bug.cgi?id=98247

Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Implement canRenderCombiningCharacterSequence() for the Freetype case.

No new tests, covered by existing tests. Actually the lack of the implementation made
fast/text/atsui-multiple-renderers.html,  fast/text/atsui-spacing-features.html and
fast/text/wide-zero-width-space.html fail on EFL.

* platform/graphics/freetype/SimpleFontDataFreeType.cpp: Implement canRenderCombiningCharacterSequence().
(WebCore::SimpleFontData::canRenderCombiningCharacterSequence):

LayoutTests:

Removing temporary failures of complex font cases.

* platform/efl/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium][Mac] r130994 seems to break chromium gpu test
https://bugs.webkit.org/show_bug.cgi?id=98995

Patch by Justin Novosad <junov@chromium.org> on 2012-10-11
Reviewed by Stephen White.

Removing unnecessary assertion that was based on an invalid assumption
that 2d canvas draw operations were always called from within WebThread
tasks.

Test: Canvas2DAllowed chromium gpu_test

* platform/graphics/chromium/Canvas2DLayerManager.cpp:
(WebCore::Canvas2DLayerManager::willProcessTask):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening after 131050, 131051.

* platform/qt-5.0-wk2/TestExpectations:
* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][jhbuild] Disable elm-web in elementary
https://bugs.webkit.org/show_bug.cgi?id=99005

Reviewed by Laszlo Gombos.

* efl/jhbuild.modules: Added --disable-web to elementary.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.

Cleaning up the expected failures section. Any test that is marked as a WontFix
should now have a small comment about the reasoning for such expectation, but no
bug modifier. Any other expectation should now have a dedicated bug entry in the
bugzilla that has the Gtk and LayoutTestFailure keywords. Also removed some
outdated expectations or moved them into the failing tests section.

* platform/gtk/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131062 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebIDL: overloaded methods prevent number -> string conversion
https://bugs.webkit.org/show_bug.cgi?id=85326

Reviewed by Kentaro Hara.

Source/WebCore:

Make the default behavior for overloaded methods matching DOMString arguments match the
default behavior for non-overloaded methods, which more closely matches the WebIDL spec.
Enable legacy behavior of only matching undefined/null/string/object(and not number,
boolean, etc) via the StrictTypeChecking attribute.

Tests: storage/indexeddb/cursor-overloads.html
       storage/indexeddb/legacy-constants.html
       ... and run-bindings-tests

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::stringToDirection): Handle "0"..."4" as stringified legacy constants.
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBDatabase.cpp: Remove redundant overloads.
(WebCore::IDBDatabase::transaction): Remove redundant overloads.
* Modules/indexeddb/IDBDatabase.h:
(IDBDatabase):
* Modules/indexeddb/IDBDatabase.idl: Remove redundant overloads.
* Modules/indexeddb/IDBIndex.cpp: Remove redundant overloads.
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::openKeyCursor):
* Modules/indexeddb/IDBIndex.h: Remove redundant overloads.
(IDBIndex):
* Modules/indexeddb/IDBIndex.idl: Remove redundant overloads.
* Modules/indexeddb/IDBObjectStore.cpp: Remove redundant overloads.
(WebCore::IDBObjectStore::openCursor):
* Modules/indexeddb/IDBObjectStore.h: Remove redundant overloads.
(IDBObjectStore):
* Modules/indexeddb/IDBObjectStore.idl: Remove redundant overloads.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::stringToMode): Handle "0"..."4" as stringified legacy constants.
* Modules/indexeddb/IDBTransaction.h:
* bindings/scripts/CodeGeneratorJS.pm: Check for StrictTypeChecking attribute.
(GenerateParametersCheckExpression):
* bindings/scripts/CodeGeneratorV8.pm: Ditto.
(GenerateParametersCheckExpression):
* bindings/scripts/test/JS/JSTestObj.cpp: Rebaselined.
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
(WebCore):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
* bindings/scripts/test/TestObj.idl: Added [StrictTypeChecking] to DOMString overloads,
plus a new DOMString overload w/o it.
* bindings/scripts/test/V8/V8TestObj.cpp: Rebaselined.
(WebCore::TestObjV8Internal::overloadedMethod11Callback):
(TestObjV8Internal):
(WebCore::TestObjV8Internal::overloadedMethodCallback):
* html/canvas/CanvasRenderingContext2D.idl: Tag legacy overloads with [StrictTypeChecking].
* xml/XMLHttpRequest.idl: Ditto.

LayoutTests:

Updated expectations - new (more generic) console warnings.

* storage/indexeddb/cursor-overloads-expected.txt:
* storage/indexeddb/legacy-constants-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131063 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Add support for Javascript popup boxes to MiniBrowser
https://bugs.webkit.org/show_bug.cgi?id=99021

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-10-11
Reviewed by Kenneth Rohde Christiansen.

Add support for JavaScript popups (alert, confirm, prompt)
to MiniBrowser.

* MiniBrowser/efl/main.c:
(miniBrowserViewSmartClass):
(browser_view_find):
(quit_event_loop):
(on_ok_clicked):
(on_javascript_alert):
(on_javascript_confirm):
(on_javascript_prompt):
(window_create):
(elm_main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] GraphicsContextPlatformPrivate is leaking it's ShadowBlur
https://bugs.webkit.org/show_bug.cgi?id=99073

Reviewed by Noam Rosenthal.

Stop leaking GraphicsContextPlatformPrivate::shadow.

No change in behavior so no new tests.

* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate):
Always destroy shadow. It is obviously owned by the context so it has
nothing to do with the erly return.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Removed incorrect pthread_mutex_trylock code in an ASSERT in TCMalloc_PageHeap::signalScavenger. This
branch is used by the Webkit GTK code.

https://bugs.webkit.org/show_bug.cgi?id=97539

Patch by Mark Toller <mark.toller@samsung.com> on 2012-10-11
Reviewed by Geoffrey Garen.

The code was never compiled in, and was functionally broken. There is no need for locking around the
m_scavengeThreadActive flag, however, we should lock pageheap_lock before calling 'shouldScavenge()', as we
only want to scavenge when really required, so it's better to wait for any current memory operation to
complete before checking.

* wtf/FastMalloc.cpp:
(WTF::TCMalloc_PageHeap::signalScavenger):

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