[Win] WebKit.make Makefile doesn't copy resource bundle to DSTROOT
https://bugs.webkit.org/show_bug.cgi?id=125160

Reviewed by Tim Horton.

* WebKit.vcxproj/WebKit.make: Add copy command for resource bundle.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ANGLE fails to build with trunk clang: unused constant kTraceBufferLen
https://bugs.webkit.org/show_bug.cgi?id=125164
https://code.google.com/p/angleproject/issues/detail?id=534

Reviewed by Darin Adler.

Move the definition of the constant kTraceBufferLen under the macro
guard TRACE_ENABLED since it's only referenced in code guarded by
TRACE_ENABLED.

* src/compiler/debug.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tweak build fixes.

* Shared/APIClient.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Checking second-to-last bit in address is a typo
https://bugs.webkit.org/show_bug.cgi?id=125162

Patch by Myles C. Maxfield <mmaxfield@apple.com> on 2013-12-03
Reviewed by Darin Adler.

After talking with the original author of this line,
is was a typo to make sure that the second-to-last bit
in an address is 0. Instead, we want to make sure that
the address is aligned to a 4-byte boundary

No behavior change, so no test is necessary

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove WTF:: prefix from types in messages.in files.
https://bugs.webkit.org/show_bug.cgi?id=124578

Patch by Tamas Gergely <tgergely.u-szeged@partner.samsung.com> on 2013-12-03
Reviewed by Anders Carlsson.

The WTF:: prefixes are removed from the messages.in files, and the
messages.py now handles unprefixed non-template WTF classes (only
the WTF::String class is used currently). Tests are also updated.

* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.messages.in:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.messages.in:
* PluginProcess/PluginControllerProxy.messages.in:
* PluginProcess/PluginProcess.messages.in:
* Scripts/webkit2/messages.py:
(forward_declarations_and_headers):
(class_template_headers):
(argument_coder_headers_for_type):
* Scripts/webkit2/messages_unittest.py:
(std):
* Shared/Network/CustomProtocols/CustomProtocolManager.messages.in:
* UIProcess/Downloads/DownloadProxy.messages.in:
* UIProcess/Plugins/PluginProcessProxy.messages.in:
* UIProcess/Storage/StorageManager.messages.in:
* UIProcess/WebContext.messages.in:
* UIProcess/WebCookieManagerProxy.messages.in:
* UIProcess/WebDatabaseManagerProxy.messages.in:
* UIProcess/WebIconDatabase.messages.in:
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/WebMediaCacheManagerProxy.messages.in:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/Cookies/WebCookieManager.messages.in:
* WebProcess/Geolocation/WebGeolocationManager.messages.in:
* WebProcess/MediaCache/WebMediaCacheManager.messages.in:
* WebProcess/Notifications/WebNotificationManager.messages.in:
* WebProcess/Plugins/PluginProcessConnection.messages.in:
* WebProcess/Plugins/PluginProxy.messages.in:
* WebProcess/Storage/StorageAreaMap.messages.in:
* WebProcess/WebCoreSupport/WebDatabaseManager.messages.in:
* WebProcess/WebPage/WebInspector.messages.in:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.messages.in:
* WebProcess/soup/WebSoupRequestManager.messages.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove some CSS Variables leftovers
https://bugs.webkit.org/show_bug.cgi?id=125167

Patch by Nick Diego Yamane <nick.yamane@openbossa.org> on 2013-12-03
Reviewed by Darin Adler.

Source/WebCore:

No new tests needed. Only removing leftover code.

* css/CSSBasicShapes.cpp:
* css/CSSBasicShapes.h:

Source/WebKit/blackberry:

* WebCoreSupport/AboutDataEnableFeatures.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160023 268f45cc-cd09-0410-ab3c-d52691b4dbfc
XML fragment parsing algorithm doesn't use the context element's default namespace URI
https://bugs.webkit.org/show_bug.cgi?id=125132

Reviewed by Darin Adler.

Source/WebCore:

Always use the context element's namespace as the default namespace URI when one is not specified by xmlns.

The new behavior matches that of Internet Explorer and the specified behavior in HTML5:
http://www.w3.org/TR/2013/CR-html5-20130806/the-xhtml-syntax.html#parsing-xhtml-fragments

"The default namespace is the namespace for which the DOM isDefaultNamespace() method on the element would
return true."

Test: fast/parser/fragment-parsing-in-document-without-xmlns.html

* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser):

LayoutTests:

Added a test for parsing a markup fragment inside a XHTML document without xmlns.
The parsed fragment should use the context element's namespace as the default namespace.

* fast/parser/fragment-parsing-in-document-without-xmlns-expected.txt: Added.
* fast/parser/fragment-parsing-in-document-without-xmlns.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: restore navigation panel state across reloads and reopens
https://bugs.webkit.org/show_bug.cgi?id=122125

Patch by Brian J. Burg <burg@cs.washington.edu> on 2013-12-03
Reviewed by Timothy Hatcher.

The previous strategy for restoring content views after inspector
re-open did not consider the active sidebar and its selection, and
tried to recreate the appropriate selection from the saved content
view. However, doesn't work for tree elements in the sidebar panel
that don't change views when selected, such as script breakpoints,
special breakpoints, call stack, timeline sections, etc.

This patch implements a new strategy that saves the navigation
sidebar panel's view state by serializing the identity of the
selected element's represented object. Relevant represented
object classes implement the saveIdentityToCookie() method. Each
represented object class also adds a TypeIdentifier property to
its constructor, to aid inexact matching based on represented
object type, rather than its complete identity.

When restoring, the navigation sidebar attempts to match added
tree elements against the pending cookie, and selects the element
if it matches. A represented object matches if its serialized
identity matches the previously saved serialized identity.

The inspector view state is now only saved on the page hide event
(for saving across reopen) and when the main frame commits its
provisional load (for saving across same-page reloads). It
consolidates similar view state settings into a single setting.

* UserInterface/ApplicationCacheFrame.js:
(WebInspector.ApplicationCacheFrame): Add cookie keys and type identifier.
(WebInspector.ApplicationCacheFrame.prototype.saveIdentityToCookie): Added.
* UserInterface/ApplicationCacheManager.js: remove objectForCookie().
* UserInterface/Breakpoint.js:
(WebInspector.Breakpoint): Add cookie keys and type identifier.
(WebInspector.Breakpoint.prototype.saveIdentityToCookie):
* UserInterface/CookieStorageObject.js:
(WebInspector.CookieStorageObject.prototype.saveIdentityToCookie): Added.
* UserInterface/DOMStorageObject.js:
(WebInspector.DOMStorageObject): Add cookie keys and type identifier.
(WebInspector.DOMStorageObject.prototype.saveIdentityToCookie): Added.
* UserInterface/DatabaseObject.js:
(WebInspector.DatabaseObject): Add cookie keys and type identifier.
(WebInspector.DatabaseObject.prototype.saveIdentityToCookie): Added.
* UserInterface/DatabaseTableObject.js:
(WebInspector.DatabaseTableObject): Add cookie keys and type identifier.
(WebInspector.DatabaseTableObject.prototype.saveIdentityToCookie): Added.
* UserInterface/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype.saveStateToCookie): Added.
(WebInspector.DebuggerSidebarPanel.prototype.restoreStateFromCookie): Added.
* UserInterface/Frame.js:
(WebInspector.Frame): Add cookie keys and type identifier.
(WebInspector.Frame.prototype.saveIdentityToCookie): Added.
* UserInterface/FrameResourceManager.js: remove objectForCookie().
* UserInterface/InstrumentSidebarPanel.js:
(WebInspector.InstrumentSidebarPanel.prototype.showTimelineForRecordType):
Return the shown timeline, if any.

(WebInspector.InstrumentSidebarPanel.prototype.saveStateToCookie): Added.
(WebInspector.InstrumentSidebarPanel.prototype.restoreStateFromCookie): Added.
(WebInspector.InstrumentSidebarPanel.prototype.showProfile):
Return the shown profile, if any.

* UserInterface/Main.js:
(WebInspector): Added cookie keys for the selected sidebar and
typeidentifier of the sidebar's selected tree element.

(WebInspector.contentLoaded): Remove callbacks for
resolveAndShowPendingContentViewCookie(). Consolidate all saved
inspector view state into one Setting. Move special-cased
restoring of the console to the restoration method. Move saving
of last opened navigation panel to the saving method.

(WebInspector._mainResourceDidChange): Try to restore saved view
state when the main resource changes.

(WebInspector._provisionalLoadCommitted): Update the saved view
state when the navigation commits. This is the last chance to save
it before the main resource changes and the navigation panel view
state is discarded and rebuilt.

(WebInspector._pageHidden): Update the saved view state when the
inspector page is hidden, but before state is discarded.

(WebInspector._navigationSidebarPanelSelected): Don't save last
navigation sidebar panel.
(WebInspector._updateCookieForInspectorViewState): Renamed from
_updateCurrentContentViewCookie. It delegates view state
serialization to the currently open navigation sidebar, rather
than the current content view.

(WebInspector._contentBrowserRepresentedObjectsDidChange): Don't
spuriously serialize the current view state cookie on every
ContentView change.

(WebInspector._restoreInspectorViewStateFromCookie): Renamed from
_showContentViewForCookie. It now restores a specific navigation
panel and delegates remaining view state restoration to the panel
itself. Last-resort selection of any tree element with the same
type identifier was moved to the navigation panel's restore method.

* UserInterface/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.prototype.set contentTreeOutline):
(WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
Save references to all created TreeOutlines in a Set, so we can
restore any tree's selection.

(WebInspector.NavigationSidebarPanel.prototype.saveStateToCookie):
Added. Find the selected tree element from all tree outlines and
ask it to serialize its identity.

(WebInspector.NavigationSidebarPanel.prototype.restoreStateFromCookie):
Added. Eagerly search existing tree elements for a matching
representedObject. If none exists, save the pending cookie and
schedule last-resort matching using the provided timeout interval.

(WebInspector.NavigationSidebarPanel.prototype._treeElementAddedOrChanged):
Check if the added tree element matches a pending view state
cookie, if one exists.

(WebInspector.NavigationSidebarPanel.prototype.treeElementMatchesCookie):
Added. Check if the tree element's representedObject matches the
pending view state cookie.

(WebInspector.NavigationSidebarPanel.prototype._checkElementsForPendingViewStateCookie):
Added. For each provided tree element, check if the tree
element's represented object produces the same serialized identity
as the pending view state cookie that we are trying to resolve.
If a match is found (possibly by relaxing to matching anything
with the same type), select the tree element and clear both the
pending view state cookie and last-resort selection timer.

* UserInterface/Resource.js:
(WebInspector.Resource): Add cookie keys and type identifier.
(WebInspector.Resource.prototype.saveIdentityToCookie): Added.

* UserInterface/ResourceClusterContentView.js:
(WebInspector.ResourceClusterContentView.prototype.saveToCookie):
(WebInspector.ResourceClusterContentView.prototype.restoreFromCookie):
Since identity state is serialized by the representedObject, these
methods only need to save view-specific state, such as the visible
subview. Remove extraneous state.

* UserInterface/Script.js:
(WebInspector.Script): Add cookie keys and type identifier.
(WebInspector.Script.prototype.saveIdentityToCookie): Added.
* UserInterface/StorageManager.js: remove objectForCookie().
* UserInterface/TimelineManager.js: remove objectForCookie().
* UserInterface/TimelinesContentView.js:
(WebInspector.TimelinesContentView.prototype.saveToCookie):
(WebInspector.TimelinesContentView.prototype.restoreFromCookie):
Since identity state is serialized by the representedObject, these
methods only need to save view-specific state, such as the visible
subview. Remove extraneous state.

* UserInterface/TreeOutline.js: Add TreeOutline.prototype.constructor
so other code can assume the constructor property exists.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160025 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Build fix for iOS.

Reviewed by Tim Horton.

* Shared/WebCoreArgumentCoders.cpp: Added missing header.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCrypto HMAC doesn't check key algorithm's hash
https://bugs.webkit.org/show_bug.cgi?id=125114

Update layout test result for a last minute change in test content.

* crypto/subtle/hmac-check-algorithm-expected.txt:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160027 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove old WebKit::APIClient cruft
https://bugs.webkit.org/show_bug.cgi?id=125173

Reviewed by Antti Koivisto.

* Shared/APIClient.h:
* Shared/APIClientTraits.cpp: Removed.
* Shared/APIClientTraits.h: Removed.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Plugins/PDF/PDFPlugin.mm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support exporting private WebCrypto RSA keys
https://bugs.webkit.org/show_bug.cgi?id=124483

Reviewed by Anders Carlsson.

Source/WebCore: 

Test: crypto/subtle/rsa-export-private-key.html

It might be better to have our own bignum implementation in WTF, but we currently
don't, and the need for this computation is Common Crypto specific anyway.

* crypto/CommonCryptoUtilities.h:
* crypto/CommonCryptoUtilities.cpp:
(WebCore::CCBigNum::CCBigNum):
(WebCore::CCBigNum::~CCBigNum):
(WebCore::CCBigNum::operator=):
(WebCore::CCBigNum::data):
(WebCore::CCBigNum::operator-):
(WebCore::CCBigNum::operator%):
(WebCore::CCBigNum::inverse):
Added a minimal wrapper around CommonCrypto BigNum.

* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPrivateKeyComponents): Compute missing parts using CCBigNum.
(WebCore::CryptoKeyRSA::exportData): Implemented private key case.

LayoutTests: 

* crypto/subtle/rsa-export-private-key-expected.txt: Added.
* crypto/subtle/rsa-export-private-key.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160029 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebGL] Implement OES texture float linear
https://bugs.webkit.org/show_bug.cgi?id=124871

Reviewed by Brent Fulgham.

Source/WebCore:

Implement the OES_texture_float_linear extension. Generally
we'd also enable OES_texture_half_float_linear at the same
time, but that's blocked on webkit.org/b/110936.

Test: fast/canvas/webgl/oes-texture-float-linear.html

* CMakeLists.txt: Add new files.
* DerivedSources.cpp: Ditto.
* DerivedSources.make: Generate new file from IDL.
* GNUmakefile.list.am: Add new files.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: New files for OESTextureFloatLinear.

* bindings/js/JSWebGLRenderingContextCustom.cpp:
(WebCore::toJS): Map the new name into the appropriate type.

* html/canvas/OESTextureFloatLinear.cpp: Added. This is a very simple class
that's mostly empty.
(WebCore::OESTextureFloatLinear::OESTextureFloatLinear):
(WebCore::OESTextureFloatLinear::~OESTextureFloatLinear):
(WebCore::OESTextureFloatLinear::getName):
(WebCore::OESTextureFloatLinear::create):
* html/canvas/OESTextureFloatLinear.h: Added.
* html/canvas/OESTextureFloatLinear.idl: Added.

* html/canvas/WebGLExtension.h: Declare the new name in the enum of extensions.

* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::drawArrays): Call new name.
(WebCore::WebGLRenderingContext::drawElements): Call new name.
(WebCore::WebGLRenderingContext::getExtension): Create the new extension if asked.
(WebCore::WebGLRenderingContext::checkTextureCompleteness): Renamed from handleNPOTTextures. Now
checks for the type of the texture too.
* html/canvas/WebGLRenderingContext.h: Member variable for new extension.

* html/canvas/WebGLTexture.cpp:
(WebCore::WebGLTexture::WebGLTexture):
(WebCore::WebGLTexture::needToUseBlackTexture): Takes an extra parameter which indicates
if it has an extension enabled.
(WebCore::WebGLTexture::update): Note it is a float type when updating.
* html/canvas/WebGLTexture.h: New flag to indicate float type.

* platform/graphics/Extensions3D.h: New flag type.
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension): Add a comment about the extension.

LayoutTests:

Add the Khronos test files for this extension.

Add the JS test file for OES_texture_float_linear and OES_texture_half_float_linear
even though it's only used for the former at the moment.

* fast/canvas/webgl/oes-texture-float-linear.html: Added.
* fast/canvas/webgl/resources/oes-texture-float-and-half-float-linear.js: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160030 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove TiledCoreAnimationDrawingArea(Proxy)IOS
https://bugs.webkit.org/show_bug.cgi?id=125176

Reviewed by Simon Fraser.

Remove unused code.

* UIProcess/API/ios/WKContentView.mm:
* UIProcess/ios/TiledCoreAnimationDrawingAreaProxyIOS.h: Removed.
* UIProcess/ios/TiledCoreAnimationDrawingAreaProxyIOS.mm: Removed.
* Shared/DrawingAreaInfo.h:
* WebProcess/WebPage/DrawingArea.cpp:
(WebKit::DrawingArea::create):
* WebProcess/WebPage/ios/TiledCoreAnimationDrawingAreaIOS.h: Removed.
* WebProcess/WebPage/ios/TiledCoreAnimationDrawingAreaIOS.mm: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160031 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    AXPress event coordinates are always sent as (0, 0)
    https://bugs.webkit.org/show_bug.cgi?id=76677

    Reviewed by Simon Fraser.

    Make sure a press targets an element's center point.

    * accessibility/press-targets-center-point-expected.txt: Added.
    * accessibility/press-targets-center-point.html: Added.

    Set the coordinates of a simulated press equal to the center of the target
    element when the simulated press does not have a related mouse event.

    Test: accessibility/press-targets-center-point.html

    * dom/Element.cpp:
    (WebCore::Element::clientRect):
    (WebCore::Element::screenRect):
    * dom/Element.h:
    * dom/EventDispatcher.cpp:
    (WebCore::EventDispatcher::dispatchSimulatedClick):
    * dom/MouseEvent.cpp:
    (WebCore::SimulatedMouseEvent::create):
    (WebCore::SimulatedMouseEvent::SimulatedMouseEvent):
    * dom/MouseEvent.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Indexed Database work should be done on a non-main queue
https://bugs.webkit.org/show_bug.cgi?id=125127

Reviewed by Darin Adler.

Add a non-main WorkQueue to the DatabaseProcess:
* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::DatabaseProcess):
(WebKit::DatabaseProcess::queue):
* DatabaseProcess/DatabaseProcess.h:

* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::UniqueIDBDatabase):
(WebKit::UniqueIDBDatabase::enqueueDatabaseQueueRequest): Add an AsyncRequest to the deque then schedule performing
  the requests on the background WorkQueue.
(WebKit::UniqueIDBDatabase::processDatabaseRequestQueue): Processes all enqueued database requests.
(WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadata): Renamed from getIDBDatabaseMetadata().
(WebKit::UniqueIDBDatabase::getOrEstablishIDBDatabaseMetadataInternal): For doing i/o on a background queue/thread.
* DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:

Add a creator that takes the abort handler as an argument, and rename requestedCompleted()
to completeRequest(). This makes more sense in more situations:
* Shared/AsyncRequest.cpp:
(WebKit::AsyncRequest::AsyncRequest):
(WebKit::AsyncRequest::setAbortHandler):
* Shared/AsyncRequest.h:
(WebKit::AsyncRequest::completeRequest):

Update for the AsyncRequest rename:
* WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
(WebKit::WebIDBServerConnection::didGetOrEstablishIDBDatabaseMetadata):

* DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
(WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata):

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