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
[WK2] Implement platform specific Resource Response for SOUP
https://bugs.webkit.org/show_bug.cgi?id=125422

Reviewed by Martin Robinson.

SOUP specific Resource Response implementation for the Network
Process.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::continueWillSendRequest):
* WebProcess/Network/WebResourceLoader.cpp:
(WebKit::WebResourceLoader::didReceiveResponseWithCertificateInfo):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Build with network process unconditionally
https://bugs.webkit.org/show_bug.cgi?id=126128

Reviewed by Martin Robinson.

.:

* Source/autotools/SetupAutomake.m4: Remove network process
conditional for Makefiles.
* Source/autotools/SetupWebKitFeatures.m4: Remove network process
feature.

Source/WebKit2:

Build always with the network process enabled and decide whether
to use it or not using an environment variable. This makes a lot
easier to work on the network process and also to switch between
using it or not.

* GNUmakefile.am: Make sure we always include the WebKit2Prefix.h.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(createDefaultWebContext): Use the network process when
WEBKIT_USE_NETWORK_PROCESS environment variable is present.
* WebKit2Prefix.h: Always enable network process for GTK port.

Tools:

* Scripts/webkitperl/FeatureList.pm: Remove network-process
feature command line option.

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

Rebaseline tests after 160908.

* platform/efl/TestExpectations:
* platform/efl/editing/inserting/break-blockquote-after-delete-expected.png: Added.
* platform/efl/editing/inserting/break-blockquote-after-delete-expected.txt: Added.
* platform/efl/fast/css-generated-content/table-row-group-to-inline-expected.txt:
* platform/efl/fast/dynamic/011-expected.txt:
* platform/efl/fast/forms/formmove3-expected.txt:
* platform/efl/fast/forms/preserveFormDuringResidualStyle-expected.txt:
* platform/efl/fast/invalid/001-expected.txt:
* platform/efl/fast/invalid/003-expected.txt:
* platform/efl/fast/invalid/004-expected.txt:
* platform/efl/fast/invalid/007-expected.txt:
* platform/efl/fast/invalid/019-expected.txt:
* platform/efl/fast/multicol/span/span-as-immediate-child-generated-content-expected.txt:
* platform/efl/fast/multicol/span/span-as-immediate-columns-child-dynamic-expected.txt:
* platform/efl/fast/multicol/span/span-as-nested-columns-child-dynamic-expected.txt:
* platform/efl/fast/ruby/ruby-base-merge-block-children-crash-expected.txt:
* platform/efl/tables/mozilla/bugs/bug113235-1-expected.txt:
* platform/efl/tables/mozilla/bugs/bug647-expected.txt:
* platform/efl/tables/mozilla/other/wa_table_tr_align-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160990 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][WK2] WebGL is not working with GLES
https://bugs.webkit.org/show_bug.cgi?id=126138

Reviewed by Martin Robinson.

m_texture has been unnecessarily regenerated. It's generated in GraphicsContext3D
constructor for offscreen rendering. And m_compositorTexture is used by only Mac port.
They create it in their GraphicsContext3D constructor so that we don't need to recreate it
in GC3DOpenGLES::reshapeFBOs.

No new tests since no functionality changed.

* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::~GraphicsContext3D):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GStreamer] video/audio seeking is not unified.
https://bugs.webkit.org/show_bug.cgi?id=125852

Patch by Piotr Grad <p.grad@samsung.com> on 2013-12-23
Reviewed by Philippe Normand.

This bug is fixing regression with seeking audio/video elements and unifies seeking
in MediaPlayerPrivateGStreamer.

Test: media/video-seek-with-negative-playback.html

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::seek):
(WebCore::MediaPlayerPrivateGStreamer::seekIncludingRate):
(WebCore::MediaPlayerPrivateGStreamer::setRate):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160992 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] [CMake] Generate pkg-config files
https://bugs.webkit.org/show_bug.cgi?id=125685

Reviewed by Martin Robinson.

.:

* Source/cmake/OptionsGTK.cmake: set variables used for filling in the values in the
pkg-config files.

Source/JavaScriptCore:

* PlatformGTK.cmake: Added. Generate javascriptcoregtk-3.0.pc.

Source/WebKit:

* PlatformGTK.cmake: generate webkitgtk-3.0.pc.

Source/WebKit2:

* PlatformGTK.cmake: generate webkit2gtk.pc.

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

[GTK][CMake] libtool-compatible soversion calculation
Reviewed by Gustavo Noronha Silva.

* Source/cmake/OptionsGTK.cmake: Specify the appropriate libtool triples and use
the CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE macro to specify the library-specific
version information.
* Source/cmake/WebKitHelpers.cmake: Add some helpful macros.

Source/JavaScriptCore: [GTK][CMake] libtool-compatible soversion calculation
https://bugs.webkit.org/show_bug.cgi?id=125511

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Use the POPULATE_LIBRARY_VERSION macro and the
library-specific version information.

Source/WebKit: [GTK][CMake] libtool-compatible soversion calculation
https://bugs.webkit.org/show_bug.cgi?id=125511

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Use the POPULATE_LIBRARY_VERSION macro and the
library-specific version information.

Source/WebKit2: [GTK][CMake] libtool-compatible soversion calculation
https://bugs.webkit.org/show_bug.cgi?id=125511

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Use the POPULATE_LIBRARY_VERSION macro and the
library-specific version information.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160994 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CMake] Fix typo from r160812
https://bugs.webkit.org/show_bug.cgi?id=126145

Reviewed by Gustavo Noronha Silva.

* CMakeLists.txt: Fix typo when detecting the type of library.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Clean up compiler optimizations flags for libWTF, libJSC
https://bugs.webkit.org/show_bug.cgi?id=126157

Reviewed by Gustavo Noronha Silva.

Source/JavaScriptCore: 

* GNUmakefile.am: Remove the -fstrict-aliasing and -O3 compiler flags for libWTF.la. -O3 gets
overridden by -O2 that's listed in CXXFLAGS (or -O0 in case of debug builds) and -fstrict-aliasing
is enabled when -O2 is used (and shouldn't be enabled in debug builds anyway).

Source/WTF: 

* GNUmakefile.am: Remove the -fstrict-aliasing and -O3 compiler flags for libWTF.la. -O3 gets
overridden by -O2 that's listed in CXXFLAGS (or -O0 in case of debug builds) and -fstrict-aliasing
is enabled when -O2 is used (and shouldn't be enabled in debug builds anyway).


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160996 268f45cc-cd09-0410-ab3c-d52691b4dbfc
webkit gtk 2.2.3 stable tarball compilation error
https://bugs.webkit.org/show_bug.cgi?id=125987

Reviewed by Gustavo Noronha Silva.

Only try including <gdk/gdkwayland.h> and using GDK_IS_WAYLAND_DISPLAY if the Wayland support has been
enabled and when not compiling with GTK+ 2 (which occurs when building for libPlatformGtk2).

* platform/graphics/GLContext.cpp:
(WebCore::GLContext::createContextForWindow):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Layout tests editing/selection/5057506.html and editing/selection/5057506-2.html
frequently time out on Mac WK2
https://bugs.webkit.org/show_bug.cgi?id=124437

* platform/mac-wk2/TestExpectations: Marked the latter test accordingly. It used
to me marked as image failure, but I don't see this happen recently on the dashboard.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160999 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AudioSessionManager should be MediaSessionManager
https://bugs.webkit.org/show_bug.cgi?id=126087

Reviewed by Jer Noble.

No new tests, no change in functionality.

* WebCore.xcodeproj/project.pbxproj: Change file names.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): MediaSessionManagerToken::create() takes a client
    interface instead of the media type.
* html/HTMLMediaElement.h:

* platform/audio/AudioSessionListener.h: Include <wtf/Noncopyable.h>.

AudioSessionManager.* -> MediaSessionManager.*
* platform/audio/AudioSessionManager.cpp: Removed.
* platform/audio/AudioSessionManager.h: Removed.
* platform/audio/MediaSessionManager.cpp: Copied from Source/WebCore/platform/audio/AudioSessionManager.cpp.
(MediaSessionManagerToken::create):
(MediaSessionManagerToken::MediaSessionManagerToken):
(MediaSessionManagerToken::~MediaSessionManagerToken):
(MediaSessionManager::sharedManager):
(MediaSessionManager::MediaSessionManager):
(MediaSessionManager::has):
(MediaSessionManager::count):
(MediaSessionManager::addToken):
(MediaSessionManager::removeToken):
(MediaSessionManager::updateSessionState):
* platform/audio/MediaSessionManager.h: Copied from Source/WebCore/platform/audio/AudioSessionManager.h.

* platform/audio/mac/AudioDestinationMac.cpp:
(WebCore::AudioDestinationMac::AudioDestinationMac): MediaSessionManagerToken::create() takes a
    client interface instead of the media type.
* platform/audio/mac/AudioDestinationMac.h:

* platform/audio/mac/AudioSessionMac.cpp:
* platform/audio/mac/AudioSessionManagerMac.cpp: Removed.
* platform/audio/mac/MediaSessionManagerMac.cpp: Copied from Source/WebCore/platform/audio/mac/AudioSessionManagerMac.cpp.
(MediaSessionManager::updateSessionState):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161000 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r160945.
http://trac.webkit.org/changeset/160945
https://bugs.webkit.org/show_bug.cgi?id=126164

Seems to have broken multiple canvas tests (Requested by ap on
#webkit).

PerformanceTests:

* Canvas/reuse.html: Removed.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cg/ImageBufferBackingStoreCache.cpp: Removed.
* platform/graphics/cg/ImageBufferBackingStoreCache.h: Removed.
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::createIOSurface):
(WebCore::ImageBuffer::ImageBuffer):
(WebCore::ImageBuffer::~ImageBuffer):

LayoutTests:

* fast/canvas/canvas-backing-store-reuse-expected.txt: Removed.
* fast/canvas/canvas-backing-store-reuse.html: Removed.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161001 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Convert ThreadCondition in WebKit2 over to std::condition_variable
https://bugs.webkit.org/show_bug.cgi?id=126161

Reviewed by Sam Weinig.

* Platform/CoreIPC/Connection.cpp:
(CoreIPC::Connection::waitForMessage):
(CoreIPC::Connection::processIncomingMessage):
* Platform/CoreIPC/Connection.h:
* Shared/BlockingResponseMap.h:
(BlockingResponseMap::waitForResponse):
(BlockingResponseMap::didReceiveResponse):
(BlockingResponseMap::cancel):
* UIProcess/API/mac/WKPrintingView.h:
* UIProcess/API/mac/WKPrintingView.mm:
(pageDidDrawToPDF):
(-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
(prepareDataForPrintingOnSecondaryThread):
(-[WKPrintingView knowsPageRange:]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161002 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore: <rdar://problem/15682948> Update copyright strings
        
Reviewed by Dan Bernstein.

* Info.plist:
* JavaScriptCore.vcxproj/JavaScriptCore.resources/Info.plist:

Source/WebCore: <rdar://problem/15682948> Update copyright strings

Reviewed by Dan Bernstein

* Info.plist:

Source/WebKit/mac: <rdar://problem/15682948> Update copyright strings

Reviewed by Dan Bernstein.

* Info.plist:

Source/WebKit2: <rdar://problem/15682948> Update copyright strings

Reviewed by Dan Bernstein

* DatabaseProcess/EntryPoint/mac/LegacyProcess/Info.plist:
* DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService.Development/Info.plist:
* DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist:
* Info.plist:
* NetworkProcess/EntryPoint/mac/LegacyProcess/Info.plist:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info.plist:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
* PluginProcess/EntryPoint/mac/LegacyProcess/Info.plist:
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
* PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/Info.plist:
* WebProcess/EntryPoint/mac/LegacyProcess/Info.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/Info.plist:

WebKitLibraries: <rdar://problem/15682948> Update copyright strings

Reviewed by Dan Bernstein.

* win/tools/scripts/COPYRIGHT-END-YEAR:



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