Web Inspector: [Canvas] do not store a dropped trace log in backend
https://bugs.webkit.org/show_bug.cgi?id=108600

Reviewed by Pavel Feldman.

Clear memory immediately on dropping current trace log instead of waiting for the next capture command.

* inspector/InjectedScriptCanvasModuleSource.js:
(.):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141884 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[TexMap] Use visible as initial value of backface-visibility-property.
https://bugs.webkit.org/show_bug.cgi?id=108875

Patch by JungJik Lee <jungjik.lee@samsung.com> on 2013-02-05
Reviewed by Noam Rosenthal.

According to W3C spec, the initial value of backface-visibility-visibility is visible.
However TextureMapperLayer's initial value is false which means hidden.
So this patch is for changing the value to visible(true).

Covered by existing tests.

* platform/graphics/texmap/TextureMapperLayer.h:
(WebCore::TextureMapperLayer::State::State): Change the initial value false to true
to use backface-visibility.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] RGB -> BGR is wrong on big endian
https://bugs.webkit.org/show_bug.cgi?id=107560

Reviewed by Jocelyn Turcotte.

Replace the conversion to methods that make it clearer what is going on.
The routines are also optimized compared to the existing by avoiding going
over slow Color constructor.

Tested by existing tests in canvas and fast/canvas.

* platform/graphics/Color.cpp:
(WebCore::colorFromPremultipliedARGB):
    Cleanup.
(WebCore::premultipliedARGBFromColor):
    Cleanup and correct for alpha = 0.
* platform/graphics/Color.h:
(WebCore):
* platform/graphics/qt/ImageBufferQt.cpp:
(WebCore::copyColorToRGBA):
(WebCore::copyRGBAToColor):
(WebCore::getImageData):
(WebCore::ImageBuffer::putByteArray):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
INPUT_MULTIPLE_FIELDS_UI: Should not move focus if the element already has focus
https://bugs.webkit.org/show_bug.cgi?id=108914

Reviewed by Kentaro Hara.

Source/WebCore:

If timeInput.focus() is called when a sub-field of the time input
already has focus, we should not focus on the first sub-field of the
time input.

Test: fast/forms/time-multiple-fields/time-multiple-fields-focus.html

* html/BaseMultipleFieldsDateAndTimeInputType.cpp:
(WebCore::BaseMultipleFieldsDateAndTimeInputType::willCancelFocus): If
the input elment already has focused sub-field, we don't need to proceed
focus handling. FocusDirection check is required because we don't need
to do this in cases of sequential focus navigation.
* html/BaseMultipleFieldsDateAndTimeInputType.h:
(BaseMultipleFieldsDateAndTimeInputType): Override InputType::willCancelFocus.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::focus):
Cancel focus if InputType::willCancelFocus returns true.
* html/HTMLInputElement.h:
(HTMLInputElement): Override focus.
* html/InputType.cpp:
(WebCore::InputType::willCancelFocus):
Add a default implementation. It returns false.
* html/InputType.h:
(InputType): Declare willCancelFocus.

LayoutTests:

* fast/forms/time-multiple-fields/time-multiple-fields-focus-expected.txt: Added.
* fast/forms/time-multiple-fields/time-multiple-fields-focus.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141887 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Create separate project for each file system added to inspector.
https://bugs.webkit.org/show_bug.cgi?id=108652

Reviewed by Pavel Feldman.

Source/WebCore:

Every file system added to web inspector is now represented by its own project in workspace.
FileSystemMapping changed accrodingly.

Test: inspector/file-system-mapping.html

* inspector/front-end/FileMapping.js:
(WebInspector.FileMapping.prototype._entryURIPrefix):
* inspector/front-end/FileSystemMapping.js:
(WebInspector.FileSystemMapping.prototype.fileForURI):
(WebInspector.FileSystemMapping.prototype.uriForFile):
(WebInspector.FileSystemMapping.prototype.uriPrefixForPathPrefix):
(WebInspector.FileSystemMappingImpl):
(WebInspector.FileSystemMappingImpl.prototype._loadFromSettings.get this):
(WebInspector.FileSystemMappingImpl.prototype._loadFromSettings):
(WebInspector.FileSystemMappingImpl.prototype._saveToSettings):
(WebInspector.FileSystemMappingImpl.prototype.set _fileSystemName):
(WebInspector.FileSystemMappingImpl.prototype.fileSystemId):
(WebInspector.FileSystemMappingImpl.prototype.addFileSystemMapping):
(WebInspector.FileSystemMappingImpl.prototype.removeFileSystemMapping):
(WebInspector.FileSystemMappingImpl.prototype.fileSystemPaths):
(WebInspector.FileSystemMappingImpl.prototype.fileForURI):
(WebInspector.FileSystemMappingImpl.prototype.uriForFile):
(WebInspector.FileSystemMappingImpl.prototype.uriPrefixForPathPrefix):
* inspector/front-end/FileSystemWorkspaceProvider.js:
(WebInspector.FileSystemWorkspaceProvider):
(WebInspector.FileSystemWorkspaceProvider.prototype.innerCallback):
(WebInspector.FileSystemWorkspaceProvider.prototype.requestFileContent):
(WebInspector.FileSystemWorkspaceProvider.prototype.setFileContent):
(WebInspector.FileSystemWorkspaceProvider.prototype._populate.filesLoaded):
(WebInspector.FileSystemWorkspaceProvider.prototype._populate):
(WebInspector.FileSystemWorkspaceProvider.prototype._addFile):
(WebInspector.FileSystemWorkspaceProvider.prototype._removeFile):
(WebInspector.FileSystemWorkspaceProvider.prototype.reset):
* inspector/front-end/IsolatedFileSystemModel.js:
(WebInspector.IsolatedFileSystemModel):
(WebInspector.IsolatedFileSystemModel.prototype._innerAddFileSystem):
(WebInspector.IsolatedFileSystemModel.prototype._fileSystemRemoved):
* inspector/front-end/Workspace.js:
(WebInspector.Project.prototype.searchInFileContent):
(WebInspector.Project.prototype.dispose):
(WebInspector.Workspace.prototype.removeProject):

LayoutTests:

* inspector/file-mapping.html:
* inspector/file-system-mapping-expected.txt: Added.
* inspector/file-system-mapping.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141888 268f45cc-cd09-0410-ab3c-d52691b4dbfc
INPUT_MULTIPLE_FIELDS_UI: element.focus() should not focus on disabled sub-fields.
https://bugs.webkit.org/show_bug.cgi?id=108924

Reviewed by Kentaro Hara.

Source/WebCore:

The first field may be non-focusable. We should search sub-fields for
focusable one.

Test: fast/forms/date-multiple-fields/date-multiple-fields-focus.html

* html/shadow/DateTimeEditElement.cpp:
(WebCore::DateTimeEditElement::focusOnNextFocusableField):
Added. A private helper function.
(WebCore::DateTimeEditElement::focusIfNoFocus): Use focusOnNextFocusableField.
(WebCore::DateTimeEditElement::focusByOwner): Ditto.
(WebCore::DateTimeEditElement::focusOnNextField): Ditto.
* html/shadow/DateTimeEditElement.h:
(DateTimeEditElement): Declare focusOnNextFocusableField.

LayoutTests:

* fast/forms/date-multiple-fields/date-multiple-fields-focus-expected.txt: Added.
* fast/forms/date-multiple-fields/date-multiple-fields-focus.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141889 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Clicking a profile's title in the console loads about:blank.
https://bugs.webkit.org/show_bug.cgi?id=107949

Patch by Eugene Klyuchnikov <eustas@chromium.org> on 2013-02-05
Reviewed by Vsevolod Vlasov.

Quick fix for regression.

* inspector/front-end/inspector.js:
Avoid "exit route" when URL is a profile URL.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141890 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: prevent crash, add required error string value
https://bugs.webkit.org/show_bug.cgi?id=108776

Patch by Peter Rybin <prybin@chromium.org> on 2013-02-05
Reviewed by Pavel Feldman.

Error string is assigned where missing, assert is added where empty string is
possible.

* inspector/InjectedScriptBase.cpp:
(WebCore::InjectedScriptBase::makeEvalCall):
* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::injectedScriptForEval):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] REGRESSION(r137436): It made all inspector tests timeout on developer builds
https://bugs.webkit.org/show_bug.cgi?id=106554

Reviewed by Simon Hausmann.

.:

Explicitely link WebCore resources in the final DLL only on Windows to
support force_static_libs_as_shared on other platforms.

WebKit1 applications don't get the QtWebKit dynamic library loaded
since libQtWebKitWidgets doesn't depend on libQtWebKit if WebCore and
WebKit1 are dynamic libraries of their own.

* Source/api.pri:

Source/WebCore:

* Target.pri:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141892 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Skip failing test.
https://bugs.webkit.org/show_bug.cgi?id=108942.

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
r141788 won't build due to not having all changes needed by Node* change
https://bugs.webkit.org/show_bug.cgi?id=108944

Reviewed by David Kilzer.

Fixed three instances of integerResult(..., m_compileIndex) to be integerResult(..., node).

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileSoftModulo):
(JSC::DFG::SpeculativeJIT::compileIntegerArithDivForARMv7s):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141894 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Remove idbFactory from WebKitPlatformSupport
https://bugs.webkit.org/show_bug.cgi?id=106457

Reviewed by Adam Barth.

Now that https://codereview.chromium.org/12181010/ has landed, the
idbFactory method is no longer needed. (Embedders must now call
the new setIDBFactory method upon initialization.) Part of a
larger refactoring series; see tracking bug 82948.

* public/platform/WebKitPlatformSupport.h:
(WebKit):
* src/IDBFactoryBackendProxy.cpp:
(WebKit::IDBFactoryBackendProxy::IDBFactoryBackendProxy):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141896 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Continue making XSSAuditor thread safe: Remove dependency on parser's sourceForToken and TextResourceDecoder
https://bugs.webkit.org/show_bug.cgi?id=108698

Reviewed by Adam Barth.

We'd like to be able to call filterToken() from the BackgroundHTMLParser where there is no HTMLDocumentParser. So we are removing the dependencies of
filterToken() on the HTMLDocumentParser. This patch brings us one step closer to removing the m_parser member from XSSAuditor by passing in the
TextResourceDecoder and HTMLSourceTracker to filterToken. To keep the number of parameters from blowing up, this introduces a FilterTokenRequest struct
to hold its arguments. We expect to add one more member to this struct.

No new tests because no new functionality.

* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::pumpTokenizer):
* html/parser/HTMLDocumentParser.h:
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::filterToken):
(WebCore::XSSAuditor::filterStartToken):
(WebCore::XSSAuditor::filterCharacterToken):
(WebCore::XSSAuditor::filterScriptToken):
(WebCore::XSSAuditor::filterObjectToken):
(WebCore::XSSAuditor::filterParamToken):
(WebCore::XSSAuditor::filterEmbedToken):
(WebCore::XSSAuditor::filterAppletToken):
(WebCore::XSSAuditor::filterIframeToken):
(WebCore::XSSAuditor::filterMetaToken):
(WebCore::XSSAuditor::filterBaseToken):
(WebCore::XSSAuditor::filterFormToken):
(WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
(WebCore::XSSAuditor::eraseAttributeIfInjected):
(WebCore::XSSAuditor::decodedSnippetForName):
(WebCore::XSSAuditor::decodedSnippetForAttribute):
(WebCore::XSSAuditor::decodedSnippetForJavaScript):
* html/parser/XSSAuditor.h:
(WebCore):
(WebCore::FilterTokenRequest::FilterTokenRequest):
(FilterTokenRequest):
(XSSAuditor):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141897 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] remove methods from the WebTestRunner interface that are only used by WebTestProxyBase
https://bugs.webkit.org/show_bug.cgi?id=108926

Reviewed by Adam Barth.

* DumpRenderTree/chromium/TestRunner/public/WebTestRunner.h:
(WebKit):
(WebTestRunner):
* DumpRenderTree/chromium/TestRunner/src/TestRunner.h:
(TestRunner):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r141896.
http://trac.webkit.org/changeset/141896
https://bugs.webkit.org/show_bug.cgi?id=108956

crashes indexdb security tests (Requested by gavinp on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-02-05

* public/platform/WebKitPlatformSupport.h:
(WebKit):
(WebKitPlatformSupport):
(WebKit::WebKitPlatformSupport::idbFactory):
* src/IDBFactoryBackendProxy.cpp:
(WebKit::IDBFactoryBackendProxy::IDBFactoryBackendProxy):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TextAutosizing: adjust the maximum difference between cluster text width and its descendant
width.
https://bugs.webkit.org/show_bug.cgi?id=108411

Source/WebCore:

Currently, if a render object is more than 200 CSS units shorter than its parent cluster, it
becomes a separate autosizing cluster (see https://bugs.webkit.org/show_bug.cgi?id=105188).
This doesn't work well for layouts when narrow nodes are related, like nested comments:
deeper comments are all shorter than the parent cluster and become autosized differently. To
avoid that the difference that makes a shorter descendant a new autosizing cluster is
adjusted each time the width difference is not greater than 50 CSS units from the previous
one. This allows nested comments, for example, to remain a part of the parent cluster and be
autosized with the same multiplier.

Patch by Anton Vayvod <avayvod@chromium.org> on 2013-02-05
Reviewed by Kenneth Rohde Christiansen.

Tests:
        fast/text-autosizing/nested-child.html

* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizingClusterInfo::TextAutosizingClusterInfo):

    Added a new field to store the current maximum width difference for the cluster.

(WebCore::TextAutosizer::isAutosizingCluster):

    Uses the new field to determine if the current node is a separate cluster,
    updates the maximum allowed width difference between the cluster and its descendant.

(WebCore::TextAutosizer::processContainer):
(WebCore::TextAutosizer::clusterShouldBeAutosized):
(WebCore::TextAutosizer::measureDescendantTextWidth):

    Non-const reference passed to the methods above.

* rendering/TextAutosizer.h: updated method parameters.

LayoutTests:

Patch by Anton Vayvod <avayvod@chromium.org> on 2013-02-05
Reviewed by Kenneth Rohde Christiansen.

Tests that certain width difference doesn't make descendants separate clusters.

* fast/text-autosizing/nested-child-expected.html: Added.
* fast/text-autosizing/nested-child.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed VS2010 Build Correction after r141651

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: Add missing
StructureRareData.h and StructureRareData.cpp files.
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: Ditto.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141902 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Scrolling performance drops doing page load
https://bugs.webkit.org/show_bug.cgi?id=108949

Patch by Andrew Lo <anlo@rim.com> on 2013-02-05
Reviewed by Yong Li.
Internally reviewed by Jakob Petsovits.

Internal PR 291390.
The intention of this code was to not update non-visible tiles during page load.

Before this patch, the code would update tiles that have already been rendered
during page load.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::updateTilesForScrollOrNotRenderedRegion):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Make overlay layers slow-scrolling
https://bugs.webkit.org/show_bug.cgi?id=108957

Patch by Sami Kyostila <skyostil@chromium.org> on 2013-02-05
Reviewed by James Robinson.

Since overlay layers get inserted on top of everything else, we must
mark them slow-scrolling to prevent all scroll input events to the rest
of the page from getting blocked. This is also more correct because
generally the overlay contents need to be repainted whenever the scroll
offset changes, and with this patch the painting happens in sync with
page scrolling.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Call XSSAuditor's didBlockScript() for the threaded HTML parser
https://bugs.webkit.org/show_bug.cgi?id=108726

Reviewed by Adam Barth.

Source/WebCore:

This patch causes us to call didBlockScript() on the main thread if the CompactHTML token has XSSInfo.
To do so, we:
1. Rename DidBlockScriptRequest to XSSInfo.
2. Add an OwnPtr<XSSInfo> field to CompactHTMLToken.
3. Add an isSafeToSendToAnotherThread() method to String and KURL.

We don't yet populate didBlockScriptRequest on the background thread, but this should just work once we do.

No new tests because no new functionality.

* html/parser/BackgroundHTMLParser.cpp:
(WebCore::BackgroundHTMLParser::pumpTokenizer): Update comment for rename.
* html/parser/CompactHTMLToken.cpp:
(SameSizeAsCompactHTMLToken):
(WebCore::CompactHTMLToken::CompactHTMLToken): Add a copy constructor used by Vector.
(WebCore::CompactHTMLToken::isSafeToSendToAnotherThread): Include new m_xssInfo field in safety check.
(WebCore):
(WebCore::CompactHTMLToken::xssInfo): Added.
(WebCore::CompactHTMLToken::setXSSInfo): Added.
* html/parser/CompactHTMLToken.h: Add an OwnPtr<XSSInfo> field to CompactHTMLToken.
(WebCore):
(CompactHTMLToken):
(WTF): Add VectorTraits necessary for copying Vector fields objects that contain an OwnPtr.
* html/parser/HTMLDocumentParser.cpp:
(WebCore::HTMLDocumentParser::processParsedChunkFromBackgroundParser): Add new didBlockScript() call.
(WebCore::HTMLDocumentParser::pumpTokenizer):
* html/parser/XSSAuditor.cpp: Renaming.
(WebCore::XSSAuditor::filterToken):
* html/parser/XSSAuditor.h: Renaming.
(WebCore):
(XSSAuditor):
* html/parser/XSSAuditorDelegate.cpp:
(WebCore::XSSInfo::isSafeToSendToAnotherThread):
(WebCore):
(WebCore::XSSAuditorDelegate::didBlockScript):
* html/parser/XSSAuditorDelegate.h:
(WebCore::XSSInfo::create):
(XSSInfo):
(WebCore::XSSInfo::XSSInfo):
(XSSAuditorDelegate):
* platform/KURL.cpp:
(WebCore::KURL::isSafeToSendToAnotherThread): Added.
(WebCore):
* platform/KURL.h:
(KURL):
* platform/KURLGoogle.cpp:
(WebCore):
(WebCore::KURLGooglePrivate::isSafeToSendToAnotherThread): Added.
* platform/KURLGooglePrivate.h:
(KURLGooglePrivate):
* platform/KURLWTFURLImpl.h:
(WebCore::KURLWTFURLImpl::isSafeToSendToAnotherThread): Added.

Source/WTF:

This patch adds isSafeToSendToAnotherThread() methods to CString, String, ParsedURL and URLString.
These methods check to ensure there are 0 or 1 references.

* wtf/text/CString.cpp:
(WTF::CString::isSafeToSendToAnotherThread): Added.
(WTF):
* wtf/text/CString.h:
(CString):
* wtf/text/WTFString.cpp:
(WTF::String::isSafeToSendToAnotherThread): Added.
(WTF):
* wtf/text/WTFString.h:
(String):
* wtf/url/api/ParsedURL.h:
(WTF::ParsedURL::isSafeToSendToAnotherThread): Added.
* wtf/url/api/URLString.h:
(WTF::URLString::isSafeToSendToAnotherThread): Added.


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