Web Inspector: JavaScript web workers debugging crashes
https://bugs.webkit.org/show_bug.cgi?id=101065

Reviewed by Alexander Pavlov.

Source/WebCore:

Clear m_pageInspector when page inspector instance is deleted.
Disable worker inspection when front-end disconnects.

Test: inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html

* inspector/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::WorkerFrontendChannel::~WorkerFrontendChannel): notify
WorkerMessagingProxy so that it can clear pointer to the channel.

LayoutTests:

Test that inspected page won't crash if inspected worker is terminated when it is paused
on a breakpoint.

* inspector-protocol/debugger-terminate-dedicated-worker-while-paused-expected.txt: Added.
* inspector-protocol/debugger-terminate-dedicated-worker-while-paused.html: Added.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133569 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] [WK2] Random crash in Minibrowser
https://bugs.webkit.org/show_bug.cgi?id=101241

Patch by Viatcheslav Ostapenko <v.ostapenko@samsung.com> on 2012-11-06
Reviewed by Gyuyoung Kim.

Do not clear GL context and GL surface in exitAcceleratedCompositing.

* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::createGLSurface):
(EwkViewImpl::enterAcceleratedCompositingMode):
(EwkViewImpl::exitAcceleratedCompositingMode):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[QT] [GTK] Remove fast/forms/week-multiple-fields from TestExpectations of gtk and qt.
https://bugs.webkit.org/show_bug.cgi?id=101317

Unreviewed gardening.

fast/forms/week-multiple-fields is removed by http://trac.webkit.org/changeset/133440.

Patch by Dongwoo Joshua Im <dw.im@samsung.com> on 2012-11-06

* platform/gtk/TestExpectations:
* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133571 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [Overrides] Add Chrome for Android and Firefox for Android user agent strings
https://bugs.webkit.org/show_bug.cgi?id=100666

Reviewed by Pavel Feldman.

* inspector/front-end/SettingsScreen.js:
(WebInspector.UserAgentSettingsTab.prototype._createUserAgentSelectRowElement.get const):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133572 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: show "debugging session terminated" message when remote debuggign connection is closed unexpectedly.
https://bugs.webkit.org/show_bug.cgi?id=101030

Reviewed by Vsevolod Vlasov.

* inspector/front-end/inspector.js:
(WebInspector.loaded.WebInspector.socket.onclose):
(WebInspector.loaded):
(WebInspector.detached):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133573 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DumpRenderTree should have --pixel-tests option again
https://bugs.webkit.org/show_bug.cgi?id=98648

Reviewed by Dirk Pranke.

Add back the --pixel-tests command line option to DumpRenderTree.
It was removed r124581 because tools don't use it after that patch.
However, it turned out that it is useful for debugging and working
with pixel tests.

* DumpRenderTree/efl/DumpRenderTree.cpp:
(parseCommandLineOptions):
(runTest):
* DumpRenderTree/gtk/DumpRenderTree.cpp:
(initializeGlobalsFromCommandLineOptions):
(runTest):
* DumpRenderTree/mac/DumpRenderTree.mm:
(initializeGlobalsFromCommandLineOptions):
(runTest):
* DumpRenderTree/qt/DumpRenderTreeMain.cpp:
(isOption):
(printUsage):
(main):
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::processLine):
* DumpRenderTree/qt/DumpRenderTreeQt.h:
(WebCore::DumpRenderTree::setShouldDumpPixelsForAllTests):
(DumpRenderTree):
* DumpRenderTree/win/DumpRenderTree.cpp:
(runTest):
(dllLauncherEntryPoint):
* DumpRenderTree/wx/DumpRenderTreeWx.cpp:
(runTest):
(MyApp::OnInit):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::TestController):
(WTR::TestController::initialize):
(WTR::TestController::runTest):
* WebKitTestRunner/TestController.h:
(TestController):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133574 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Shadow] ShadowRoot should know the existence of elements having ElementShadow.
https://bugs.webkit.org/show_bug.cgi?id=100922

Reviewed by Hajime Morita.

Source/WebCore:

We count the elements having ElementShadow in ShadowRoot. This is a prepation patch for to solve Bug 100451.
We have a count-up and count-down login in ShadowRoot::insertedInto and ShadowRoot::removedFrom.

For performance reason, we have a flag that an element should be unregistered in ShadowRoot.

Test: fast/dom/shadow/has-elementshadow.html

* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::ShadowRoot):
(WebCore::ShadowRoot::insertedInto): Count up the number of elements having ElementShadow. ElementShadow
is created only when the oldest ShadowRoot is created, we only count up only when this ShadowRoot is oldest.
(WebCore):
(WebCore::ShadowRoot::removedFrom): Count down if we used this ShadowRoot for count up.
* dom/ShadowRoot.h:
(ShadowRoot):
(WebCore::ShadowRoot::registerElementShadow):
(WebCore::ShadowRoot::unregisterElementShadow):
(WebCore::ShadowRoot::hasElementShadow):
(WebCore::ShadowRoot::countElementShadow):
* testing/Internals.cpp:
(WebCore::Internals::countElementShadow):
(WebCore):
* testing/Internals.h:
(Internals):
* testing/Internals.idl:

LayoutTests:

* fast/dom/shadow/has-elementshadow-expected.txt: Added.
* fast/dom/shadow/has-elementshadow.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
committers-autocomplete.js works only with WebKit based browsers
https://bugs.webkit.org/show_bug.cgi?id=66752

Patch by Ryosuke Niwa <rniwa@webkit.org> on 2012-11-06
Reviewed by Csaba Osztrogonác.

Based on the patch posted by Peter Gal. Attach event listeners
to all input elements we want to enable auto-completions on.

* committers-autocomplete.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133576 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[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
Web Inspector: make Spectrum and Popover WebInspector.Views in order to enable reuse
https://bugs.webkit.org/show_bug.cgi?id=101200

Reviewed by Yury Semikhatsky.

- Split Spectrum and SpectrumPopoverHelper (first is a component, second is controller)
- Made Popover a root view in order to enable lazy style loading for potential subviews (such as Spectrum)
- Extracted spectrum's css into a separate file

* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/front-end/DOMExtension.js:
(Element.prototype.positionAt):
(Size):
(Element.prototype.measurePreferredSize):
* inspector/front-end/HeapSnapshotView.js:
(WebInspector.HeapSnapshotView.prototype.willHide):
(WebInspector.HeapSnapshotView.prototype._helpClicked):
* inspector/front-end/Popover.js:
(WebInspector.Popover):
(WebInspector.Popover.prototype.show):
(WebInspector.Popover.prototype.showView):
(WebInspector.Popover.prototype._innerShow):
(WebInspector.Popover.prototype.hide):
(WebInspector.Popover.prototype.dispose):
(WebInspector.Popover.prototype._positionElement):
* inspector/front-end/Spectrum.js:
(WebInspector.Spectrum.alphaDrag):
(WebInspector.Spectrum):
(WebInspector.Spectrum.prototype.wasShown):
(WebInspector.SpectrumPopupHelper):
(WebInspector.SpectrumPopupHelper.prototype.spectrum):
(WebInspector.SpectrumPopupHelper.prototype.toggle):
(WebInspector.SpectrumPopupHelper.prototype.show):
(WebInspector.SpectrumPopupHelper.prototype.reposition):
(WebInspector.SpectrumPopupHelper.prototype.hide):
(WebInspector.ColorSwatch):
(WebInspector.ColorSwatch.prototype.setColorString):
* inspector/front-end/StylesSidebarPane.js:
(WebInspector.StylesSidebarPane):
(WebInspector.StylesSidebarPane.prototype.update):
(WebInspector.StylesSidebarPane.prototype.willHide):
(WebInspector.StylePropertyTreeElement.prototype.updateTitle.):
* inspector/front-end/View.js:
(WebInspector.View.prototype.measurePreferredSize):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/elementsPanel.css:
(.image-preview-container img):
* inspector/front-end/inspector.css:
(.swatch):
(.swatch-inner):
(.swatch-inner:hover):
* inspector/front-end/spectrum.css: Added.
(.spectrum-container):
(.spectrum-top):
(.spectrum-color):
(.spectrum-display-value):
(.spectrum-hue):
(.spectrum-fill):
(.spectrum-range-container):
(.spectrum-range-container *):
(.spectrum-range-container label):
(.spectrum-range-container input):
(.spectrum-dragger, .spectrum-slider):
(.spectrum-sat):
(.spectrum-val):
(.spectrum-dragger):
(.spectrum-slider):
(.spectrum-container .swatch):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Displayed name/path of urls in network tab of dev tools is inconsistent
https://bugs.webkit.org/show_bug.cgi?id=101064

Reviewed by Yury Semikhatsky.

Source/WebCore:

Extracted some generic methods from ParsedURL displayName getters (about:blank and data url handlers).
Implemented consistent name() and path() method on NetworkRequest based on ParsedURL.
NetworkPanel now uses name() and path() methods on NetworkRequest to show requests and search for them.

Test: http/tests/inspector/network/request-name-path.html

* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkLogView.prototype._matchRequest):
(WebInspector.NetworkLogView.prototype._highlightMatchedRequests):
(WebInspector.NetworkLogView.prototype.performFilter):
(WebInspector.NetworkDataGridNode.prototype._refreshNameCell):
(WebInspector.NetworkDataGridNode.NameComparator):
* inspector/front-end/NetworkRequest.js:
(WebInspector.NetworkRequest.prototype.set url):
(WebInspector.NetworkRequest.prototype.name):
(WebInspector.NetworkRequest.prototype.path):
(WebInspector.NetworkRequest.prototype._parseNameAndPathFromURL):
* inspector/front-end/ParsedURL.js:
(WebInspector.ParsedURL):
(WebInspector.ParsedURL.prototype.get displayName):
(WebInspector.ParsedURL.prototype.dataURLDisplayName):
(WebInspector.ParsedURL.prototype.isAboutBlank):
(WebInspector.ParsedURL.prototype.isDataURL):

LayoutTests:

* http/tests/inspector/network/request-name-path-expected.txt: Added.
* http/tests/inspector/network/request-name-path.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133583 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Disable all tests fast/dom/shadow
https://bugs.webkit.org/show_bug.cgi?id=101324

Patch by Shinya Kawanaka <shinyak@chromium.org> on 2012-11-06
Reviewed by Csaba Osztrogonác.

Since Qt does not have SHADOW_DOM flag enabled, a lot of tests are failing.
Let's skip all tests.

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133584 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Minibrowser forgets http variables when url includes ampersand
https://bugs.webkit.org/show_bug.cgi?id=101061

Patch by Jussi Kukkonen <jussi.kukkonen@intel.com> on 2012-11-06
Reviewed by Kenneth Rohde Christiansen.

Elementary entry only returns 'markup' text, meaning ampersands
in a url will become "&amp;". Use elm_entry_markup_to_utf8() and
elm_entry_utf8_to_markup() when interacting with the entry.

* MiniBrowser/efl/main.c:
(on_url_changed):
(on_url_bar_activated):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133585 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] There shouldn't be linting errors about our TestExpectation files

Unreviewed test expectation update.

A number of linting errors were being displayed, partially because of my
recent additions. Fix them.

* platform/chromium-android/TestExpectations:
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133586 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Make Ewk_Context Ewk_Object
https://bugs.webkit.org/show_bug.cgi?id=101322

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

Ewk_Context is Ewk_Object now and using common ref/unref API.

* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::EwkViewImpl):
* UIProcess/API/efl/EwkViewImpl.h:
(EwkViewImpl::ewkContext):
(EwkViewImpl):
* UIProcess/API/efl/ewk_context.cpp:
(EwkContext::EwkContext):
(EwkContext::~EwkContext):
(EwkContext::create):
(EwkContext::defaultContext):
(EwkContext::cookieManager):
(EwkContext::ensureFaviconDatabase):
(EwkContext::setFaviconDatabaseDirectoryPath):
(EwkContext::faviconDatabase):
(EwkContext::storageManager):
(EwkContext::requestManager):
(EwkContext::vibrationProvider):
(EwkContext::addVisitedLink):
(EwkContext::setCacheModel):
(EwkContext::cacheModel):
(ewk_context_cookie_manager_get):
(ewk_context_favicon_database_directory_set):
(ewk_context_favicon_database_get):
(ewk_context_storage_manager_get):
(EwkContext::wkContext):
(EwkContext::downloadManager):
(EwkContext::historyClient):
(ewk_context_default_get):
(ewk_context_new):
(ewk_context_new_with_injected_bundle_path):
(ewk_context_url_scheme_register):
(ewk_context_vibration_client_callbacks_set):
(ewk_context_history_callbacks_set):
(ewk_context_visited_link_add):
(ewk_context_cache_model_set):
(ewk_context_cache_model_get):
* UIProcess/API/efl/ewk_context.h:
* UIProcess/API/efl/ewk_context_private.h:
(EwkContext):
* UIProcess/API/efl/ewk_view.cpp:
(createEwkView):
(ewk_view_base_add):
(ewk_view_smart_add):
(ewk_view_add_with_context):
* UIProcess/API/efl/tests/test_ewk2_context.cpp:
(TEST_F):
* UIProcess/efl/DownloadManagerEfl.cpp:
(WebKit::DownloadManagerEfl::DownloadManagerEfl):
* UIProcess/efl/DownloadManagerEfl.h:
(WebKit::DownloadManagerEfl::create):
(DownloadManagerEfl):
* UIProcess/efl/PageClientBase.cpp:
(WebKit::PageClientBase::handleDownloadRequest):
* UIProcess/efl/RequestManagerClientEfl.cpp:
(WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
* UIProcess/efl/RequestManagerClientEfl.h:
(WebKit::RequestManagerClientEfl::create):
(RequestManagerClientEfl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133587 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Exclude fast/css/style-scoped cases from layout test running
https://bugs.webkit.org/show_bug.cgi?id=101326

Unreviewed, EFL gardening.

According to BUG 49142, html5 style scoped attribute implementation is on progress.
Therefore, we can skip its test cases from regular layout test running.

Patch by Kangil Han <kangil.han@samsung.com> on 2012-11-06

* platform/efl/TestExpectations:

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