[WK2] Rename WebURL to API::URL
https://bugs.webkit.org/show_bug.cgi?id=126100

Reviewed by Anders Carlsson.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toURLRef):
(WebKit::toCopiedURLAPI):
* Shared/API/c/WKURL.cpp:
(WKURLGetTypeID):
(WKURLCreateWithUTF8CString):
(WKURLCreateWithBaseURL):
* Shared/API/c/cf/WKURLCF.mm:
(WKURLCreateWithCFURL):
* Shared/APIURL.h: Copied from Source/WebKit2/Shared/WebURL.h.
(API::URL::create):
(API::URL::string):
(API::URL::host):
(API::URL::protocol):
(API::URL::path):
(API::URL::lastPathComponent):
(API::URL::encode):
(API::URL::decode):
(API::URL::URL):
* Shared/Cocoa/WKNSURL.h:
(WebKit::wrapper):
* Shared/Cocoa/WKNSURL.mm:
(-[WKNSURL _web_createTarget]):
* Shared/Plugins/Netscape/PluginInformation.cpp:
(WebKit::createPluginInformationDictionary):
* Shared/UserData.cpp:
(WebKit::UserData::encode):
(WebKit::UserData::decode):
* Shared/UserMessageCoders.h:
(WebKit::UserMessageEncoder::baseEncode):
(WebKit::UserMessageDecoder::baseDecode):
* Shared/WebArchiveResource.h:
* Shared/WebURL.h: Removed.
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::getResourceData):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebIconDatabase.cpp:
(WebKit::WebIconDatabase::didChangeIconForPageURL):
(WebKit::WebIconDatabase::notifyIconDataReadyForPageURL):
* UIProcess/WebIconDatabaseClient.cpp:
(WebKit::WebIconDatabaseClient::didChangeIconForPageURL):
(WebKit::WebIconDatabaseClient::iconDataReadyForPageURL):
* UIProcess/WebIconDatabaseClient.h:
* UIProcess/WebOpenPanelResultListenerProxy.cpp:
(WebKit::WebOpenPanelResultListenerProxy::chooseFiles):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::getResourceDataFromFrame):
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160969 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Soft-link WebContentAnalysis.framework
https://bugs.webkit.org/show_bug.cgi?id=126102

Reviewed by Dan Bernstein.

* Configurations/WebCore.xcconfig: There's no need to modify LDFLAGS
now that we don't hard link against WebContentAnalysis.framework.
* WebCore.xcodeproj/project.pbxproj: Removed
WebContentAnalysis.framework from the 'Link Binary with Libraries'
build phase.
* platform/mac/ContentFilterMac.mm: Soft-linked
WebContentAnalysis.framework and the WebFilterEvaluator @class.
(WebCore::ContentFilter::ContentFilter): Called getWebFilterEvaluatorClass().
(WebCore::ContentFilter::isEnabled): Ditto.
* platform/mac/SoftLinking.h: Added an implementation of
SOFT_LINK_PRIVATE_FRAMEWORK().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160970 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Rename WebError to API::Error
https://bugs.webkit.org/show_bug.cgi?id=126125

Reviewed by Anders Carlsson.

* Shared/API/c/WKError.cpp:
(WKErrorGetTypeID):
(WKErrorCopyWKErrorDomain):
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
* Shared/API/c/cf/WKErrorCF.cpp:
(WKErrorCreateWithCFError):
* Shared/APIError.cpp: Copied from Source/WebKit2/Shared/WebError.cpp.
(API::Error::webKitErrorDomain):
(API::Error::encode):
(API::Error::decode):
* Shared/APIError.h: Copied from Source/WebKit2/Shared/WebError.h.
(API::Error::create):
(API::Error::domain):
(API::Error::failingURL):
(API::Error::localizedDescription):
(API::Error::Error):
* Shared/Cocoa/WKNSError.h:
(WebKit::wrapper):
* Shared/Cocoa/WKNSError.mm:
(-[WKNSError _web_createTarget]):
* Shared/UserData.cpp:
(WebKit::UserData::encode):
(WebKit::UserData::decode):
* Shared/UserMessageCoders.h:
(WebKit::UserMessageEncoder::baseEncode):
(WebKit::UserMessageDecoder::baseDecode):
* Shared/WebError.cpp: Removed.
* Shared/WebError.h: Removed.
* UIProcess/AutoCorrectionCallback.h:
(WebKit::AutocorrectionDataCallback::invalidate):
* UIProcess/GenericCallback.h:
(WebKit::VoidCallback::invalidate):
(WebKit::GenericCallback::invalidate):
(WebKit::ComputedPagesCallback::invalidate):
(WebKit::ImageCallback::invalidate):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::printFinishedCallback):
* UIProcess/WebPageProxy.h:
(WebKit::ValidateCommandCallback::invalidate):
(WebKit::GestureCallback::invalidate):
(WebKit::TouchesCallback::invalidate):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
* WebProcess/InjectedBundle/InjectedBundlePagePolicyClient.cpp:
* WebProcess/WebCoreSupport/mac/WebErrorsMac.mm:
(WebKit::blockedError):
(WebKit::cannotShowURLError):
(WebKit::interruptedForPolicyChangeError):
(WebKit::cannotShowMIMETypeError):
(WebKit::pluginWillHandleLoadError):
(WebKit::internalError):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160971 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix attempt on EFL port after r160971 and r160969

* CMakeLists.txt:
* UIProcess/soup/WebSoupRequestManagerClient.cpp:
(WebKit::WebSoupRequestManagerClient::didReceiveURIRequest):
* UIProcess/soup/WebSoupRequestManagerProxy.cpp:
(WebKit::WebSoupRequestManagerProxy::didReceiveURIRequest):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160972 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Start refactoring Filter code to reuse CachedSVGDocument for clipPath
https://bugs.webkit.org/show_bug.cgi?id=126069

Reviewed by Andreas Kling.

Smaller refactoring of the CSS filter style resolver code. Previously the code
requested the FilterOperations list from RenderStyle and compared the content
in this list with an internal map. Then the resource loading was triggered.
With the refactoring we do not request the list from RenderStyle anymore but
rely on the hash map data entirely.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::loadPendingSVGDocuments):
* platform/graphics/filters/FilterOperation.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160973 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fix GTK+ build after r160971 and r160969.

* GNUmakefile.list.am:
* UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
(webkit_file_chooser_request_select_files):
* UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
(didReceiveWebViewMessageFromInjectedBundle):
* UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
(webkitURISchemeRequestCreate):
* UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
* UIProcess/API/gtk/WebKitWebResource.cpp:
(webkit_web_resource_get_data):
* UIProcess/soup/WebSoupRequestManagerClient.h:
* WebProcess/WebCoreSupport/gtk/WebErrorsGtk.cpp:
(WebKit::internalError):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160974 268f45cc-cd09-0410-ab3c-d52691b4dbfc
URTBF after r160971 to try to make EFL build again.

* WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp:
(WebKit::internalError):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160975 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Last URTBF after r160971 to make EFL build happy.

* TestWebKitAPI/efl/PlatformWebView.cpp:
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
URTBF after r160971 to try to make EFL build again.

Patch by Csaba Osztrogonác <ossy@webkit.org> on 2013-12-22

* WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp:
(WebKit::internalError):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160977 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions] Clean-up selection tests a bit
https://bugs.webkit.org/show_bug.cgi?id=126135

Reviewed by Dirk Schulze.

Move function clearSelection in helper.js. Combine checkResult() from position-for-point* and position-for-point-1*
into a single function, checkSelectionResult() and  move it into helper.js too.

* fast/regions/resources/helper.js:
* fast/regions/selection/position-for-point-1-vert-lr.html:
* fast/regions/selection/position-for-point-1-vert-rl.html:
* fast/regions/selection/position-for-point-1.html:
* fast/regions/selection/position-for-point-vert-lr.html:
* fast/regions/selection/position-for-point-vert-rl.html:
* fast/regions/selection/position-for-point.html:
* fast/regions/selection/selecting-text-through-different-region-flows.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160978 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions] Crash when trying to select content from invalid region
https://bugs.webkit.org/show_bug.cgi?id=126113

Reviewed by Antti Koivisto.

Source/WebCore:

After fix for https://bugs.webkit.org/show_bug.cgi?id=120769, positionForPoint for a region attempts to use the associated named flow to perform its task.
However, this should happen only when the region is valid. If the region is invalid, part of a dependency cycle, positionForPoint should behave as usual
for a block instead of a region, otherwise it may run into an infinite loop due to cyclic dependencies and a crash will occur.

This patch ensures that positionForPoint region specifie behaviour is followed only if the region is valid - not part of a dependency cycle.

Test: fast/regions/selection/invalid-region-selection-crash.html

* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::positionForPoint):

LayoutTests:

* fast/regions/selection/invalid-region-selection-crash-expected.txt: Added.
* fast/regions/selection/invalid-region-selection-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Create a skeleton for CSS Selector code generation
https://bugs.webkit.org/show_bug.cgi?id=126044

Source/JavaScriptCore: 

Reviewed by Antti Koivisto and Gavin Barraclough.

* assembler/LinkBuffer.h:
Add a new owner UID for code compiled for CSS.
Export the symbols needed to link code from WebCore.

Source/WebCore: 

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-12-22
Reviewed by Antti Koivisto and Gavin Barraclough.

Add CSSCompiler, which provides the basic infrastructure to compile
CSS Selectors on x86_64.

Compilation happens in two phases.
1) The various matching and relation of each CSSSelector is aggregated into units
   matching a single element: SelectorFragment.
   SelectorFragment also knows about the relations between different fragments,
   and contains all the information to generate the code for a particular element.
2) The compiler then goes over the fragments, and generate code based on the information
   of each fragment.

It the current state, SelectorCompiler only compiles the tag matching selectors and
any of the relation between selectors.

Depending on the relation and position of a fragment, failure on traversal or matching
does not necessarily causes the complete selector. A failure can cause matching to
resume from the parent or the sibling of a previously visisted node.
The implementation of this is done through the BacktrackingAction. In case of failure,
the next starting state is setup and the program counter jumps back to the appropriate
starting point.

When backtracking, the method used to save the starting point depends on the type
of backtracking.
The child/parent relation (">") is very common so it uses an additional register to keep
the next starting point (m_descendantBacktrackingStart).
The indirect sibling relation ("~") is much less common and uses the stack to save
the next starting point.

* WebCore.xcodeproj/project.pbxproj:
* cssjit/SelectorCompiler.cpp: Added.
(WebCore::SelectorCompiler::SelectorFragment::SelectorFragment):
(WebCore::SelectorCompiler::compileSelector):
(WebCore::SelectorCompiler::fragmentRelationForSelectorRelation):
(WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
(WebCore::SelectorCompiler::updateChainStates):
(WebCore::SelectorCompiler::isFirstAncestor):
(WebCore::SelectorCompiler::isFirstAdjacent):
(WebCore::SelectorCompiler::isAfterChildRelation):
(WebCore::SelectorCompiler::solveBacktrackingAction):
(WebCore::SelectorCompiler::requiresAdjacentTail):
(WebCore::SelectorCompiler::requiresDescendantTail):
(WebCore::SelectorCompiler::SelectorCodeGenerator::computeBacktrackingInformation):
(WebCore::SelectorCompiler::testIsElementFlagOnNode):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElement):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateParentElementTreeWalker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAncestorTreeWalker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToPreviousAdjacent):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateDirectAdjacentTreeWalker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateIndirectAdjacentTreeWalker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::markParentElementIfResolvingStyle):
(WebCore::SelectorCompiler::SelectorCodeGenerator::linkFailures):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAdjacentBacktrackingTail):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateDescendantBacktrackingTail):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateBacktrackingTailsIfNeeded):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
* cssjit/SelectorCompiler.h: Added.
(WebCore::SelectorCompilationStatus::SelectorCompilationStatus):
(WebCore::SelectorCompilationStatus::operator Status):
(WebCore::SelectorCompiler::simpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::selectorCheckerFunctionWithCheckingContext):
* dom/Element.cpp:
(WebCore::Element::setChildrenAffectedByDirectAdjacentRules):
(WebCore::Element::setChildrenAffectedByForwardPositionalRules):
* dom/Element.h:
(WebCore::Element::tagQNameMemoryOffset):
(WebCore::Element::setChildrenAffectedByForwardPositionalRules):
* dom/Node.h:
(WebCore::Node::parentNodeMemoryOffset):
(WebCore::Node::previousSiblingMemoryOffset):
(WebCore::Node::nodeFlagsMemoryOffset):
(WebCore::Node::flagIsElement):
* dom/QualifiedName.h:
(WebCore::QualifiedName::QualifiedNameImpl::localNameMemoryOffset):
(WebCore::QualifiedName::QualifiedNameImpl::namespaceMemoryOffset):
(WebCore::QualifiedName::implMemoryOffset):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Small build fix for GTK+ with the CMake build

* CMakeLists.txt: Remove duplicate include directory and add missing directories
necessary for GTK+.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160984 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][CMake] Integrate GResource for inspector files (and others?)
https://bugs.webkit.org/show_bug.cgi?id=125569

Reviewed by Gustavo Noronha Silva.

Source/WebInspectorUI:

* GNUmakefile.am: Use the new generation script instead of generating with
shell scripting in the makefile.

Source/WebKit2:

* GNUmakefile.am: Use the newly added static WebKit2InspectorGResourceBundle.xml
instead of generating the same file each time.
* PlatformGTK.cmake: Add support for building the GResource bundles into WebKit2.
* UIProcess/API/gtk/WebKit2InspectorGResourceBundle.xml: Added.

Tools:

* gtk/generate-inspector-gresource-manifest.py: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][SOUP] WebContext::allowSpecificHTTPSCertificateForHost does not work correctly when m_usesNetworkProcess is false
https://bugs.webkit.org/show_bug.cgi?id=125564

Reviewed Carlos Garcia Campos.

WebContext::allowSpecificHTTPSCertificateForHost should send
AllowSpecificHTTPSCertificateForHost to the web process when
m_usesNetworkProcess is false. Also we shouldn't guard
WebProcess::allowSpecificHTTPSCertificateForHost with
!ENABLE(NETWORK_PROCESS) because we need this method when
m_usesNetworkProcess is false.

Patch by Kwang Yul Seo <skyul@company100.net> on 2013-12-22

* UIProcess/WebContext.cpp:
(WebKit::WebContext::allowSpecificHTTPSCertificateForHost):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/soup/WebProcessSoup.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160986 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] run-gtk-tests should always run glib tests with -k option
https://bugs.webkit.org/show_bug.cgi?id=126132

Reviewed by Philippe Normand.

With -k command line option, gtester continues running all other
test cases after a failure.

* Scripts/run-gtk-tests:
(TestRunner._run_test_glib): Use -k option when runing glib tests
to not stop on failure.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Clear ScratchBuffer::m_lastLayerSize when clearing the scratch buffer.
https://bugs.webkit.org/show_bug.cgi?id=126150

Reviewed by NOBODY (OOPS!).

Since ScratchBuffer::clearScratchBuffer only clears m_lastRadius,
ShadowBlur doesn't draw shadow into the re-created scratch buffer if it
tries to draw shadow without blurRadius.

Clear m_lastLayerSize to empty is enought to ensure that there is no
drawn contents in the scratch buffer.

No new tests due to the flaky nature of reproducing the issue.

* platform/graphics/ShadowBlur.cpp:
(WebCore::ScratchBuffer::clearScratchBuffer):