Enable the CSSVariables setting in css-variable-definition.html test
https://bugs.webkit.org/show_bug.cgi?id=116231

Reviewed by Andreas Kling.

CSSVariablesEnabled setting must be set to true to allow
CSSVariables at runtime.

Modified also the indent size to 4 spaces.

* css3/css-variable-definition-expected.html:
* css3/css-variable-definition.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DocumentOrderedMap doesn't need to have two HashMaps
https://bugs.webkit.org/show_bug.cgi?id=116167

Reviewed by Geoffrey Garen.

Previously, we had two hash maps: m_map and m_duplicateCounts in DocumentOrderedMap to keep track
of the first element and the number of duplicates for a given name. This patch simplifies this structure
by having a single hash map that contains both the pointer and the number of duplicates.

In addition, this patch fixes a regression introduced in r149652 that window and document name maps
were not updated for some elements inside a SVG use element, and makes use of the newly added list of
the matching elements in SelectorQuery.

* dom/DocumentOrderedMap.cpp:
(WebCore::DocumentOrderedMap::clear): Updated to use the new hash map.
(WebCore::DocumentOrderedMap::add): Ditto.
(WebCore::DocumentOrderedMap::remove): Ditto.
(WebCore::DocumentOrderedMap::get): Ditto.
(WebCore::DocumentOrderedMap::getAllElementsById): Added.

* dom/DocumentOrderedMap.h:

(WebCore::DocumentOrderedMap::MapEntry::MapEntry): Added.
(WebCore::DocumentOrderedMap::containsSingle): Updated to use new hash map.
(WebCore::DocumentOrderedMap::contains): Ditto.
(WebCore::DocumentOrderedMap::containsMultiple): Ditto.

* dom/Element.cpp:
(WebCore::Element::insertedInto): This function didn't add this element to window and document's name maps
if the element had already been inserted into a tree scope, and the current call was inserting an ancestor
of the tree scope into the document. We were exiting early per scope != treeScope().

Fixed the bug by splitting updateId into two functions updateIdForTreeScope and updateIdForDocument.
The former is called when this element is inserted into a new tree scope, and the latter is called when
this element is inserted into a HTML document even if it had already been inside some tree scope.

(WebCore::Element::removedFrom): This function didn't remove this element from tree scope's id maps if
the tree scope wasn't a document. Fixed the bug by simply checking that the removal happens beneath the
current tree scope.
(WebCore::Element::updateName):
(WebCore::Element::updateNameForTreeScope): Renamed from updateName.
(WebCore::Element::updateNameForDocument): Extracted from updateName.
(WebCore::Element::updateId):
(WebCore::Element::updateIdForTreeScope): Renamed from updateId.
(WebCore::Element::updateIdForDocument): Extracted from updateId.

* dom/Element.h:

* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::canUseIdLookup): Refactored to return the id subselector instead of checking if
the first subselector happens to be matching an id.
(WebCore::SelectorDataList::execute): Use the subselector canUseIdLookup returned. Also make use of newly
added getAllElementsById when there are multiple matching elements for a given id.

* dom/SelectorQuery.h:

* dom/TreeScope.cpp:
(WebCore::TreeScope::getAllElementsById): Added.

* dom/TreeScope.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add support for building WebCore to the cmake build
https://bugs.webkit.org/show_bug.cgi?id=116128

Reviewed by Gustavo Noronha Silva.

.:

* Source/PlatformGTK.cmake: Added.
* Source/cmake/OptionsGTK.cmake: Added more logic and variables to support WebCore and properly
defined some existing variables.

Source/WebCore:

* PlatformGTK.cmake: Added.
* platform/gtk/GtkVersioning.c: Include "config.h" because we removed
the autotoolsconfig.h include from the header.
* platform/gtk/GtkVersioning.h: Remove autotoolsconfig.h include to support for
non-autotools build systems.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150189 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Documentation for WEBKIT_DEBUG logging channels is out of date
https://bugs.webkit.org/show_bug.cgi?id=114764

Reviewed by Gustavo Noronha Silva.

* docs/webkitenvironment.xml: Update documentation to reflect current list of
logging channels.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150191 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] [CMake] Disable the shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=116237

Reviewed by Gustavo Noronha Silva.

* Source/cmake/OptionsGTK.cmake: Disable shadow DOM by default.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150192 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac rebaseline. The flakiness dashboard tells us that it started at r150101
but reverting the change locally didn't fix the problem as far as Beth and I checked.

* platform/mac/platform/mac/fast/text/thai-combining-mark-positioning-expected.txt: Added.
* platform/mac/platform/mac/fast/text/webfont-after-tiny-monospace-text-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150193 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Re-land r150168 with some OS version guards.

* WebView/WebFrameView.mm:
(-[WebFrameView drawRect:]):
(-[WebFrameView wantsUpdateLayer]):
(-[WebFrameView updateLayer]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150194 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a test expectation per bug 116238 and remove lines erroneously added in r150090.

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150195 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash properly on iOS
https://bugs.webkit.org/show_bug.cgi?id=115782

Reviewed by Darin Adler.

Improve crash handling. <rdar://problem/13842771>

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


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] Minimum layout width is lost if the WebProcess crashes
https://bugs.webkit.org/show_bug.cgi?id=116202
<rdar://problem/13202320>

Reviewed by Darin Adler.

Send the minimum layout width to the WebProcess upon initialization,
so that crashed-and-restarted WebProcesses have the correct width.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
(WebPageCreationParameters):
Add minimumLayoutWidth WebPage creation parameter.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
Send the current minimumLayoutWidth to the WebPage when it's created.

(WebKit::WebPageProxy::setMinimumLayoutWidth):
Store minimumLayoutWidth changes that come in while the WebProcess is
not valid, so that the correct width is sent once it is restarted.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Set minimumLayoutWidth to the value provided by our creation parameters.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[jhbuild] Should remove the sources directory as well when cleaning
https://bugs.webkit.org/show_bug.cgi?id=116229

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2013-05-16
Reviewed by Martin Robinson.

* Scripts/update-webkit-libs-jhbuild:
(cleanJhbuild): remove the Source directory as well when cleaning.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150198 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSValue shouldn't protect/unprotect its context
https://bugs.webkit.org/show_bug.cgi?id=116234

Reviewed by Mark Hahnenberg.

Our retain on _context is sufficient.

* API/JSValue.mm:
(-[JSValue initWithValue:inContext:]):
(-[JSValue dealloc]):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make the Find Banner in Safari work again with the docked Web Inspector.

https://webkit.org/b/116182
rdar://problem/13857423

Reviewed by Benjamin Poulain.

* UIProcess/mac/WebInspectorProxyMac.mm:
(WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
(WebKit::WebInspectorProxy::platformDetach):
Preserve the top position of the inspected view so banners in Safari still work.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add more Mac test expectations.

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Build Xvfb with jhbuild
https://bugs.webkit.org/show_bug.cgi?id=115907

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.com> on 2013-05-16
Reviewed by Martin Robinson.

Tools:

Build our own Xvfb so that we can avoid problems with the system Xvfb
relying on symbols not present in our jhbuilt libraries such as pixman,
and also to ensure we have the fix for a GLX module crasher.

* DumpRenderTree/gtk/DumpRenderTree.cpp:
(resetDefaultsToConsistentValues): enable accelerated compositing.
* gtk/install-dependencies: list packages required for building Xvfb.
* gtk/jhbuild.modules: add xserver as a jhbuild module.
* gtk/patches/xserver-remove-bogus-dependencies.patch: Added.
* gtk/patches/xserver-fix-glx-init.patch: Added. Fixes a crash while
initializing the GLX module for Xvfb.

LayoutTests:

Unskip and create baselines for transforms/3d and some webgl tests. We can unskip
more, but I prefer to only dip the toe in the waters first, to see how the bots
react.

* platform/gtk/TestExpectations:
* platform/gtk/transforms/3d/general/perspective-non-layer-expected.txt: Added.
* platform/gtk/transforms/3d/general/perspective-units-expected.txt: Added.
* platform/gtk/transforms/3d/hit-testing/backface-hit-test-expected.txt: Added.
* platform/gtk/transforms/3d/hit-testing/backface-no-transform-hit-test-expected.txt: Added.
* platform/gtk/transforms/3d/point-mapping/3d-point-mapping-2-expected.txt: Added.
* platform/gtk/transforms/3d/point-mapping/3d-point-mapping-3-expected.txt: Added.
* platform/gtk/transforms/3d/point-mapping/3d-point-mapping-coplanar-expected.txt: Added.
* platform/gtk/transforms/3d/point-mapping/3d-point-mapping-deep-expected.txt: Added.
* platform/gtk/transforms/3d/point-mapping/3d-point-mapping-expected.txt: Added.
* platform/gtk/transforms/3d/point-mapping/3d-point-mapping-origins-expected.txt: Added.
* platform/gtk/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt: Added.
* platform/gtk/transforms/3d/point-mapping/3d-point-mapping-preserve-3d-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-webView:updateHistoryTitle:forURL: does not pass a frame to the delegate
https://bugs.webkit.org/show_bug.cgi?id=116243

Reviewed by Anders Carlsson.

Added a WebFrame parameter to the delegate method.

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::setTitle): Pass the frame to the delegate. Maintain
compatibility with clients that implement the old delegate method that
doesn’t take a frame.
* WebView/WebDelegateImplementationCaching.h:
(WebHistoryDelegateImplementationCache): Added a field to cache the
implementation of the old delegate method.
* WebView/WebHistoryDelegate.h: Changed the signature of the delegate method.
* WebView/WebView.mm:
(-[WebView _cacheHistoryDelegateImplementations]): Cache the implementation
of the new delegate method, but also check for the old one.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
svg/as-image/img-zoom-svg-stylesheet.html crashes with NetworkProcess enabled.
<rdar://problem/13837408> and https://bugs.webkit.org/show_bug.cgi?id=115917

Reviewed by Sam Weinig.

Source/WebCore:

Give WebKit2 the ability to not mis-cast.

* loader/FrameLoaderClient.h:
(WebCore::FrameLoaderClient::isEmptyFrameLoaderClient): Defaults to false, and include a FIXME
  to remove it once https://bugs.webkit.org/show_bug.cgi?id=116233 is resolved.

* loader/EmptyClients.h: Make isEmptyFrameLoaderClient() return true, and add a FIXME to remove it.

Source/WebKit2:

* NetworkProcess/SchedulableLoader.cpp:
(WebKit::SchedulableLoader::SchedulableLoader): ASSERT that either there’s a frame and page ID, or
  that the client cannot be asked for credentials.

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleLoad): Only cast the FrameLoaderClient and get WebFrame/WebPage
  if that is actually possible. Set the clientCredentialPolicy based on whether or not WebFrame/WebPage are
  available since they are needed to ask the UIProcess for credentials. ASSERT that either there’s both
  a frame and page ID or that the client won’t be asked for credentials.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS] CSS Variables are case-sensitive
https://bugs.webkit.org/show_bug.cgi?id=116239

Reviewed by Ryosuke Niwa.

Source/WebCore:

The CSS Variables specification states that variables are
case-sensitive, unlike other CSS properties.

Test: fast/css/variables/case-sensitive.html

* css/CSSParser.cpp:
(WebCore::CSSParserString::substring): Replace
the now unnecessary lowerSubstring() with this method.
Also, since the method is only used by the CSS variables
implementation, #ifdef it.
(WebCore::CSSParser::createPrimitiveVariableNameValue):
(WebCore::CSSParser::storeVariableDeclaration):
Do not normalize variable declarations to lowercase.
* css/CSSParserValues.h:
(CSSParserString): Replace the lowerSubstring() declaration
and wrap with #if/#endif.

LayoutTests:

* fast/css/variables/case-sensitive-expected.html: Renamed from
fast/css/variables/case-insensitive-expected.html.
* fast/css/variables/case-sensitive.html: Renamed from
LayoutTests/fast/css/variables/case-insensitive.html.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] fast/events/mouse-cursor-image-set.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=116244

Add a flaky test expectation on Mac.

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: canvas/philip/tests/2d.text.draw.fontface.notinpage.html fails
https://bugs.webkit.org/show_bug.cgi?id=116245

Add a passing/failing test expectation.

* platform/mac/TestExpectations:


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