[Qt][WK2] Default directories and paths are missing for LocalStorage, Database and IconDatabase.
https://bugs.webkit.org/show_bug.cgi?id=69111

Reviewed by Kenneth Rohde Christiansen.

Provide default path for LocalStorage, Database and IconDatabase using QDesktopServices.

Source/WebCore:

No new tests : existing ones should cover.

* platform/qt/CookieJarQt.cpp:
(WebCore::SharedCookieJarQt::SharedCookieJarQt):

Source/WebKit2:

* UIProcess/qt/WebContextQt.cpp:
(WebKit::defaultDataLocation):
(WebKit::WebContext::platformInitializeWebProcess):
(WebKit::WebContext::platformDefaultDatabaseDirectory):
(WebKit::WebContext::platformDefaultIconDatabasePath):
(WebKit::WebContext::platformDefaultLocalStorageDirectory):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96702 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Add support for search in script content.
https://bugs.webkit.org/show_bug.cgi?id=69015

Reviewed by Pavel Feldman.

Source/WebCore:

Tests: http/tests/inspector/search/search-in-concatenated-script.html
       http/tests/inspector/search/search-in-script.html

* inspector/Inspector.json:
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::searchInContent):
(WebCore::InspectorDebuggerAgent::getScriptSource):
* inspector/InspectorDebuggerAgent.h:
* inspector/front-end/ContentProviders.js:
(WebInspector.ScriptContentProvider.prototype.searchInContent):
(WebInspector.ConcatenatedScriptsContentProvider.prototype._sortedScripts.var):
(WebInspector.ConcatenatedScriptsContentProvider.prototype._sortedScripts):
(WebInspector.ConcatenatedScriptsContentProvider.prototype.requestContent):
(WebInspector.ConcatenatedScriptsContentProvider.prototype.searchInContent.maybeCallback):
(WebInspector.ConcatenatedScriptsContentProvider.prototype.searchInContent.searchCallback):
(WebInspector.ConcatenatedScriptsContentProvider.prototype.searchInContent):
(WebInspector.ConcatenatedScriptsContentProvider.prototype._concatenateScriptsContent):
* inspector/front-end/Script.js:
(WebInspector.Script.prototype.requestSource.didGetScriptSource):
(WebInspector.Script.prototype.requestSource):
(WebInspector.Script.prototype.searchInContent):

LayoutTests:

* http/tests/inspector/resource-tree/resource-tree-test.js:
(initialize_ResourceTreeTest):
* http/tests/inspector/resources-test.js:
(initialize_ResourceTest.InspectorTest.runAfterResourcesAreFinished):
(initialize_ResourceTest.InspectorTest._runAfterResourcesAreFinished):
(initialize_ResourceTest.InspectorTest._runAfterResourcesAreFinished.maybeCallback):
(initialize_ResourceTest.InspectorTest._runAfterResourcesAreFinished.addSniffer):
(initialize_ResourceTest.InspectorTest._runAfterResourcesAreFinished.resourceAddedToFrame):
(initialize_ResourceTest.InspectorTest._runAfterResourcesAreFinished.visit):
(initialize_ResourceTest):
* http/tests/inspector/search/resources/search-concatenated.html: Added.
* http/tests/inspector/search/search-in-concatenated-script-expected.txt: Added.
* http/tests/inspector/search/search-in-concatenated-script.html: Added.
* http/tests/inspector/search/search-in-resource.html:
* http/tests/inspector/search/search-in-script-expected.txt: Added.
* http/tests/inspector/search/search-in-script.html: Added.
* http/tests/inspector/search/search-test.js:
(initialize_SearchTest):
* inspector/debugger/content-providers.html:
* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96703 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] First test always fails because of useless xcb dump
https://bugs.webkit.org/show_bug.cgi?id=69132

Unskip the first test because the failure always affects the first test we run
so skipping makes no sense.

* platform/qt-wk2/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96704 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Shrink FontDescription.
https://bugs.webkit.org/show_bug.cgi?id=69426

Reviewed by Nikolas Zimmermann.

Pack FontDescription's members in a bitfield, effectively shrinking
the class by two CPU-words. This reduces memory consumption by ~1 MB
on 64-bit when loading the full HTML5 spec.

* platform/graphics/FontDescription.h:
(WebCore::FontDescription::orientation):
(WebCore::FontDescription::textOrientation):
(WebCore::FontDescription::widthVariant):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96705 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-05  Pavel Feldman  <pfeldman@google.com>

        Not reviewed: restoring : shortcut in inspector.

        * inspector/front-end/ScriptsPanel.js:
        (WebInspector.ScriptsPanel.prototype._createSidebarButtons):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in SVGTRefElement::updateReferencedText.
https://bugs.webkit.org/show_bug.cgi?id=67555

Reviewed by Rob Buis.

Source/WebCore: 

Test: svg/text/tref-event-listener-crash.svg

* svg/SVGTRefElement.cpp:
(WebCore::SubtreeModificationEventListener::clear): This fixes the
crash. there can be cases when our target is removed, but our event
listener is alive. when our tref is going away, we need to disable
those event listeners by nulling out our tref element.
(WebCore::SubtreeModificationEventListener::handleEvent): Adding
null check for tref element, which can happen in cases where
event listener's clear is called, but we could not remove it from
the target.
(WebCore::SVGTRefElement::~SVGTRefElement): There are always
cases when removedFromDocument is not called. So, important to
clear event listener in those cases.
(WebCore::SVGTRefElement::svgAttributeChanged): Use common
function buildPendingResource.
(WebCore::SVGTRefElement::buildPendingResource): Common function
to prevent triple duplication of same code. made it more readable.
(WebCore::SVGTRefElement::insertedIntoDocument): Use common
function buildPendingResource.
(WebCore::SVGTRefElement::removedFromDocument): Use new helper
removeEventListener.
(WebCore::SVGTRefElement::clearEventListener): Helper to clear
event listener. Name chosen to not collide with Node::removeEventListener.
* svg/SVGTRefElement.h: definition of new helpers.
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::insertedIntoDocument): Copy same
logic as tref and use element. more asserts and easy bailouts.

LayoutTests: 

* svg/text/tref-event-listener-crash-expected.txt: Added.
* svg/text/tref-event-listener-crash.svg: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96707 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r96595): WTFReportBacktrace listed as the top frame in all assertion backtraces
https://bugs.webkit.org/show_bug.cgi?id=69424

Skip an extra frame in WTFReportBacktrace.  As well, I now don't count skipped frames in maxFrames,
so I've updated maxFrames to 31, as with one skipped frame the previous value was effectively
31 reported frames.

Reviewed by Adam Roben.

* wtf/Assertions.cpp:
* wtf/Assertions.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96708 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: debugger-activation-crash2.html are flaky.
https://bugs.webkit.org/show_bug.cgi?id=69428

Reviewed by Yury Semikhatsky.

* http/tests/inspector/debugger-test.js:
(initialize_DebuggerTest):
* inspector/debugger/debugger-activation-crash2-expected.txt:
* inspector/debugger/debugger-activation-crash2.html:
* platform/chromium/inspector/debugger/debugger-activation-crash2-expected.txt: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96709 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: provide a way for persisting worker inspector state
https://bugs.webkit.org/show_bug.cgi?id=69422

Source/WebCore:

Worker inspector can persist and restore its state. InspectorStateClient is
exctracted into a separate interface and has a custom implementation in case
of worker inspector.

Reviewed by Pavel Feldman.

* GNUmakefile.list.am:
* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorClient.h:
* inspector/InspectorState.cpp:
(WebCore::InspectorState::InspectorState):
* inspector/InspectorState.h:
* inspector/InspectorStateClient.h: Copied from Source/WebCore/inspector/InspectorClient.h.
(WebCore::InspectorStateClient::~InspectorStateClient):
(WebCore::InspectorStateClient::updateInspectorStateCookie):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
(WebCore::WorkerInspectorController::restoreInspectorStateFromCookie):
* inspector/WorkerInspectorController.h:
* workers/DefaultSharedWorkerRepository.cpp:
(WebCore::SharedWorkerProxy::postMessageToPageInspector):
(WebCore::SharedWorkerProxy::updateInspectorStateCookie):
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::updateInspectorStateCookie):
* workers/WorkerMessagingProxy.h:
* workers/WorkerReportingProxy.h:

Source/WebKit/chromium:

Provided an API for saving/restoring worker inspector state.

Reviewed by Pavel Feldman.

* public/WebCommonWorkerClient.h:
(WebKit::WebCommonWorkerClient::saveDevToolsAgentState):
* public/WebSharedWorker.h:
(WebKit::WebSharedWorker::reattachDevTools):
* src/WebSharedWorkerImpl.cpp:
(WebKit::reconnectToWorkerContextInspectorTask):
(WebKit::WebSharedWorkerImpl::reattachDevTools):
* src/WebSharedWorkerImpl.h:
* src/WebWorkerBase.cpp:
(WebKit::WebWorkerBase::updateInspectorStateCookie):
(WebKit::WebWorkerBase::updateInspectorStateCookieTask):
* src/WebWorkerBase.h:
* src/WebWorkerClientImpl.cpp:
(WebKit::WebWorkerClientImpl::updateInspectorStateCookie):
* src/WebWorkerClientImpl.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96710 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: move elements panel update semantics from ElementsPanel to ElementsTreeOutline.
https://bugs.webkit.org/show_bug.cgi?id=69431

Reviewed by Yury Semikhatsky.

Source/WebCore:

* inspector/front-end/ConsoleMessage.js:
(WebInspector.ConsoleMessageImpl.prototype._formatParameterAsNode):
* inspector/front-end/ElementsPanel.js:
(WebInspector.ElementsPanel.get this):
(WebInspector.ElementsPanel):
(WebInspector.ElementsPanel.prototype.show):
(WebInspector.ElementsPanel.prototype.hide):
(WebInspector.ElementsPanel.prototype._selectedNodeChanged):
(WebInspector.ElementsPanel.prototype._reset):
(WebInspector.ElementsPanel.prototype._nodeRemoved):
(WebInspector.ElementsPanel.prototype.updateBreadcrumb.selectCrumbFunction):
(WebInspector.ElementsPanel.prototype.updateBreadcrumb):
* inspector/front-end/ElementsTreeOutline.js:
(WebInspector.ElementsTreeOutline):
(WebInspector.ElementsTreeOutline.prototype.wireToDomAgent):
(WebInspector.ElementsTreeOutline.prototype.setVisible):
(WebInspector.ElementsTreeOutline.prototype.addEventListener):
(WebInspector.ElementsTreeOutline.prototype.removeEventListener):
(WebInspector.ElementsTreeOutline.prototype.selectDOMNode):
(WebInspector.ElementsTreeOutline.prototype.update):
(WebInspector.ElementsTreeOutline.prototype._selectedNodeChanged):
(WebInspector.ElementsTreeOutline.prototype.findTreeElement.parentNode):
(WebInspector.ElementsTreeOutline.prototype.findTreeElement):
(WebInspector.ElementsTreeOutline.prototype.createTreeElementFor):
(WebInspector.ElementsTreeOutline.prototype._ondrop.callback):
(WebInspector.ElementsTreeOutline.prototype._ondrop):
(WebInspector.ElementsTreeOutline.prototype.adjustCollapsedRange):
(WebInspector.ElementsTreeOutline.prototype._updateModifiedNodes):
(WebInspector.ElementsTreeElement.prototype.insertChildElement):
(WebInspector.ElementsTreeElement.prototype.selectOnMouseDown):
(WebInspector.ElementsTreeElement.prototype._startEditingAsHTML.dispose):
(WebInspector.ElementsTreeElement.prototype._startEditingAsHTML):
(WebInspector.ElementsTreeElement.prototype._attributeEditingCommitted.moveToNextAttributeIfNeeded):
(WebInspector.ElementsTreeElement.prototype._attributeEditingCommitted):
(WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted.changeTagNameCallback):
(WebInspector.ElementsTreeElement.prototype._tagNameEditingCommitted):
(WebInspector.ElementsTreeElement.prototype._textNodeEditingCommitted):
(WebInspector.ElementsTreeElement.prototype._editingCancelled):
():
* inspector/front-end/externs.js:
(WebInspector.ElementsTreeOutline):
* inspector/front-end/utilities.js:

LayoutTests:

* http/tests/inspector/elements-test.js:
(initialize_ElementTest.InspectorTest.dumpElementsTree):
(initialize_ElementTest.InspectorTest.expandElementsTree.onAllNodesAvailable):
(initialize_ElementTest.InspectorTest.expandElementsTree):
* inspector/elements/edit-dom-actions.html:
* inspector/styles/styles-update-from-js.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96711 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SVG 1.1: ineffectual transform attribute for ClipPath
https://bugs.webkit.org/show_bug.cgi?id=55361

Source/WebCore: 

Reviewed by Nikolas Zimmermann.
        
Respect 'transform' attribute/property for <clip-path>.
If the masking code path is used the mask context gets transformed, otherwise the path itself.

Tests: svg/clip-path/clip-path-transform-1.svg
       svg/clip-path/clip-path-transform-2.svg
       svg/dynamic-updates/SVGClipPathElement-transform-influences-hitTesting.html

* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::pathOnlyClipping): Transform the clip path.
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
(WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): Transform the context of the mask image.
(WebCore::RenderSVGResourceClipper::calculateClipContentRepaintRect): Repaint rect must get concatenated with the current animated transformation.
(WebCore::RenderSVGResourceClipper::hitTestClipContent): Point for hit testing must be transformed by the current animated transformation.
* rendering/svg/RenderSVGResourceClipper.h:

LayoutTests: 

Reviewed by Nikolas Zimmermann.
        
Test that the clip path gets concatenated with the current animated transformation and
that hit testing is affected correctly.

* platform/mac/svg/clip-path/clip-path-transform-1-expected.png: Added.
* platform/mac/svg/clip-path/clip-path-transform-1-expected.txt: Added.
* platform/mac/svg/clip-path/clip-path-transform-2-expected.png: Added.
* platform/mac/svg/clip-path/clip-path-transform-2-expected.txt: Added.
* svg/clip-path/clip-path-transform-1.svg: Added. Test clipping to path with transform.
* svg/clip-path/clip-path-transform-2.svg: Added. Test masking with transform.
* svg/dynamic-updates/SVGClipPathElement-transform-influences-hitTesting-expected.png: Added.
* svg/dynamic-updates/SVGClipPathElement-transform-influences-hitTesting-expected.txt: Added.
* svg/dynamic-updates/SVGClipPathElement-transform-influences-hitTesting.html: Added.
* svg/dynamic-updates/script-tests/SVGClipPathElement-transform-influences-hitTesting.js: Added.
(executeBackgroundTest):
(executeTest):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix for Debug builders.

* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::restoreInspectorStateFromCookie):

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

* platform/qt-wk2/Skipped: Unskip sputnik tests, because they pass with newer Qt5.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96714 268f45cc-cd09-0410-ab3c-d52691b4dbfc
libsoup-CRITICAL **: soup_message_io_pause: assertion `io != NULL' failed
https://bugs.webkit.org/show_bug.cgi?id=64263

Reviewed by Xan Lopez.

No new tests. This is difficult to test because it relies on network
timing and to catch and parse stdout.

Instead of allowing messages to pause and unpause after receiving headers,
we wait until the completion of the sendRequestCallback. This will ensure
that the SoupSession is in the correct state to allow for pausing and unpausing.

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::platformSetDefersLoading): Don't pause and unpause
until the sendRequestCallback is called. We detect this situation by
checking whether or not we have an input stream yet. Previously the code
was only pausing until after soupMessage->status_code was not equal to
SOUP_STATUS_NONE. This means that the message was pausable right after
headers are received. sendRequestCallback happens some time after that.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-05  Yury Semikhatsky  <yurys@chromium.org>
        
        Unreviewed. Build fix: make InspectorStateClient.h Private in XCode project.

        * WebCore.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96716 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Removed JSValue::toJSNumber
https://bugs.webkit.org/show_bug.cgi?id=69399

No perf. change.

toJSNumber() used to provide an implicit fast path for immediate numbers,
but those fast paths are all explicit now, so it's just cruft.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::privateExecute):
* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):
* runtime/JSValue.h:
* runtime/JSValueInlineMethods.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
https://bugs.webkit.org/show_bug.cgi?id=68731
        
Outline sides not painted for region. Fix the painting and hit testing code for regions to add in
the maximalOutlineSize on unclipped sides. Also fix some math errors with the computation of the
translation offset and clip rects when overflow or outlines spill out.

Reviewed by Darin Adler.

Source/WebCore: 

Added new test in fast/regions.

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::paintIntoRegion):
(WebCore::RenderFlowThread::hitTestRegion):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::regionOverflowRect):

LayoutTests: 

* fast/regions/outline-sides-in-region.html: Added.
* platform/mac/fast/regions/outline-sides-in-region-expected.png: Added.
* platform/mac/fast/regions/outline-sides-in-region-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96718 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Reduce test flakyness.
There was a race between Inspector's internal page reloaded message and load event.

* inspector/timeline/timeline-load-event-expected.txt:
* inspector/timeline/timeline-load-event.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96719 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Fix compilation with gtk v2.20.1
https://bugs.webkit.org/show_bug.cgi?id=69418

Unreviewed build fix

Patch by Rémi Duraffort <remi.duraffort@st.com> on 2011-10-05

* platform/gtk/GtkDragAndDropHelper.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96720 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Spec change - option.label should be reflected like option.value
https://bugs.webkit.org/show_bug.cgi?id=68684

Patch by Sachin Puranik <jcqt43@motorola.com> on 2011-10-05
Reviewed by Darin Adler.

Source/WebCore:

Incorporating the recent change in spec for label attribute of
option element. While retrieving the "Label" IDL attribute return
the "Label" content attribute if present , else return the
value of textContent attribute.

Tests: fast/forms/option-label-trim-html-spaces.html
       fast/forms/option-value-and-label-changed-by-js.html

* dom/OptionElement.cpp:
(WebCore::OptionElement::normalizeText):style fixes
* dom/OptionElement.h: make collectOptionInnerText() protected.
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::label): return innerText if label attribute un-available.
(WebCore::HTMLOptionElement::setLabel):setLabel() implementation.
* html/HTMLOptionElement.h: add setLabel declaration.
* html/HTMLOptionElement.idl: Change reflect to ConvertNullToNullString in idl

LayoutTests:

IDL "Label" attribute of option element should return textContent IDL attribute
if conetent attribute "Label" is unavailable. Changed the tests to match
above said behaviour. Added new tests.

* fast/forms/option-label-trim-html-spaces-expected.txt: Html space triming test.
* fast/forms/option-label-trim-html-spaces.html: Html space triming test.
* fast/forms/option-value-and-label-changed-by-js-expected.txt: Attribute change from JS.
* fast/forms/option-value-and-label-changed-by-js.html: Attribute change from JS.
* fast/forms/option-value-and-label-expected.txt: Changed  test case as per new spec.
* fast/forms/option-value-and-label.html: Changed test case as per new spec.

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