WebKit-https.git
4 years ago[Mac] Update for output device API change
eric.carlson@apple.com [Sun, 29 Mar 2015 02:07:43 +0000 (02:07 +0000)]
[Mac] Update for output device API change
https://bugs.webkit.org/show_bug.cgi?id=143187

Reviewed by Zalan Bujtas.

The API used for output device is being deprecated, update to the replacement.

* WebCore.xcodeproj/project.pbxproj: Add SPI headers.

* platform/graphics/MediaPlaybackTarget.h:
(WebCore::MediaPlaybackTarget::MediaPlaybackTarget): Update for API change.
(WebCore::MediaPlaybackTarget::setDevicePickerContext):
(WebCore::MediaPlaybackTarget::devicePickerContext):

* platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
(WebCore::MediaPlaybackTarget::encode):
(WebCore::MediaPlaybackTarget::decode):

* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
(WebCore::MediaPlaybackTargetPickerMac::MediaPlaybackTargetPickerMac):
(WebCore::MediaPlaybackTargetPickerMac::~MediaPlaybackTargetPickerMac):
(WebCore::MediaPlaybackTargetPickerMac::outputeDeviceAvailabilityChangedTimerFired):
(WebCore::MediaPlaybackTargetPickerMac::devicePicker):
(WebCore::MediaPlaybackTargetPickerMac::currentDeviceDidChange):
(WebCore::MediaPlaybackTargetPickerMac::stopMonitoringPlaybackTargets):
(-[WebAVOutputDeviceMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]):
(-[WebAVOutputDevicePickerMenuControllerHelper observeValueForKeyPath:ofObject:change:context:]): Deleted.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):

* platform/spi/cocoa/AVKitSPI.h: Copied from Source/WebCore/platform/spi/ios/AVKitSPI.h. Moved
    from ios directory, added Mac includes and prototypes.
* platform/spi/ios/AVKitSPI.h: Removed.

* platform/spi/mac/AVFoundationSPI.h: Added.

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

4 years agoOptimize RenderLayer::intersectsDamageRect() slightly
simon.fraser@apple.com [Sat, 28 Mar 2015 23:17:30 +0000 (23:17 +0000)]
Optimize RenderLayer::intersectsDamageRect() slightly
https://bugs.webkit.org/show_bug.cgi?id=143186

Reviewed by Zalan Bujtas.

We can early return from RenderLayer::intersectsDamageRect() if the
damageRect is empty, since nothing will intersect with the empty rect.

Slight performance gain when scrolling overflow-scroll with lots of nested,
clipping layers.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):

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

4 years agoRemove an unused SPI method from WebKitLegacy
andersca@apple.com [Sat, 28 Mar 2015 20:44:39 +0000 (20:44 +0000)]
Remove an unused SPI method from WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=143185

Reviewed by Sam Weinig.

Source/WebCore:

* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::storeCopyOfCache): Deleted.
* loader/appcache/ApplicationCacheStorage.h:

Source/WebKit/mac:

* WebView/WebDataSource.mm:
(-[WebDataSource _transferApplicationCache:]): Deleted.
* WebView/WebDataSourcePrivate.h:

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

4 years agoWeb Inspector: ES6: Better support for Symbol types in Type Profiler
saambarati1@gmail.com [Sat, 28 Mar 2015 17:28:11 +0000 (17:28 +0000)]
Web Inspector: ES6: Better support for Symbol types in Type Profiler
https://bugs.webkit.org/show_bug.cgi?id=141257

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

ES6 introduces the new primitive type Symbol. This patch makes JSC's
type profiler support this new primitive type.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* inspector/protocol/Runtime.json:
* runtime/RuntimeType.cpp:
(JSC::runtimeTypeForValue):
* runtime/RuntimeType.h:
(JSC::runtimeTypeIsPrimitive):
* runtime/TypeSet.cpp:
(JSC::TypeSet::addTypeInformation):
(JSC::TypeSet::dumpTypes):
(JSC::TypeSet::doesTypeConformTo):
(JSC::TypeSet::displayName):
(JSC::TypeSet::inspectorTypeSet):
(JSC::TypeSet::toJSONString):
* runtime/TypeSet.h:
(JSC::TypeSet::seenTypes):
* tests/typeProfiler/driver/driver.js:
* tests/typeProfiler/symbol.js: Added.
(wrapper.foo):
(wrapper.bar):
(wrapper.bar.bar.baz):
(wrapper):

Source/WebInspectorUI:

The Web Inspector's visualization of JSC's type profiler
should have support for the Symbol type.

* UserInterface/Models/TypeSet.js:
(WebInspector.TypeSet):
(WebInspector.TypeSet.prototype.get primitiveTypeNames):
* UserInterface/Views/TypeTokenView.css:
TypeTokenView will display Symbol type tokens using the same color that
Symbol values are displayed as formatted values.

(.type-token-symbol):
* UserInterface/Views/TypeTokenView.js:
(WebInspector.TypeTokenView.prototype._displayTypeName):
(WebInspector.TypeTokenView):

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

4 years agoWeb Inspector: Adopt Array.prototype.includes and String.prototype.includes
commit-queue@webkit.org [Sat, 28 Mar 2015 16:38:00 +0000 (16:38 +0000)]
Web Inspector: Adopt Array.prototype.includes and String.prototype.includes
https://bugs.webkit.org/show_bug.cgi?id=143176

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-28
Reviewed by Timothy Hatcher.

Source/WebInspectorUI:

* UserInterface/Base/Utilities.js:
Remove our custom implementations of Array/String contains functions.

* UserInterface/Base/Main.js:
(WebInspector._updateContentViewForCurrentNavigationSidebar):
(WebInspector._contentBrowserCurrentContentViewDidChange):
* UserInterface/Controllers/CodeMirrorCompletionController.js:
(WebInspector.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions.):
(WebInspector.CodeMirrorCompletionController.prototype._generateJavaScriptCompletions):
* UserInterface/Controllers/CodeMirrorTokenTrackingController.js:
(WebInspector.CodeMirrorTokenTrackingController.prototype._updateHoveredTokenInfo):
(WebInspector.CodeMirrorTokenTrackingController.prototype._processJavaScriptExpression):
* UserInterface/Controllers/FrameResourceManager.js:
(WebInspector.FrameResourceManager.prototype._extraDomainsActivated):
(WebInspector.FrameResourceManager):
* UserInterface/Controllers/LayerTreeManager.js:
(WebInspector.LayerTreeManager.prototype.layerTreeMutations):
* UserInterface/Controllers/StorageManager.js:
(WebInspector.StorageManager.prototype._extraDomainsActivated):
(WebInspector.StorageManager):
* UserInterface/Models/Branch.js:
(WebInspector.Branch.prototype.addRevision):
* UserInterface/Models/CSSKeywordCompletions.js:
(WebInspector.CSSKeywordCompletions.forProperty):
* UserInterface/Models/CSSRule.js:
(WebInspector.CSSRule.prototype.get matchedSelectors):
* UserInterface/Models/CSSStyleDeclaration.js:
* UserInterface/Models/Color.js:
(WebInspector.Color.fromString):
* UserInterface/Models/DOMNode.js:
* UserInterface/Models/DOMNodeStyles.js:
(WebInspector.DOMNodeStyles.prototype._parseStyleDeclarationPayload):
* UserInterface/Views/CSSStyleDeclarationSection.js:
(WebInspector.CSSStyleDeclarationSection.prototype.refresh):
* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
(WebInspector.CSSStyleDetailsSidebarPanel.prototype._updatePseudoClassCheckboxes):
(WebInspector.CSSStyleDetailsSidebarPanel):
* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser.prototype._updateContentViewSelectionPathNavigationItem):
* UserInterface/Views/DOMTreeElement.js:
* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._resourceAdded):
* UserInterface/Views/GeneralTreeElement.js:
(WebInspector.GeneralTreeElement.prototype.addClassName):
(WebInspector.GeneralTreeElement.prototype.removeClassName):
* UserInterface/Views/LegacyConsoleMessageImpl.js:
(WebInspector.LegacyConsoleMessageImpl.prototype._formatParameterAsTable):
* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype._updateMessagesSelection):
* UserInterface/Views/NavigationBar.js:
(WebInspector.NavigationBar.prototype._findNavigationItem):
* UserInterface/Views/Sidebar.js:
(WebInspector.Sidebar.prototype.findSidebarPanel):
Replace contains with includes where appropriate.

LayoutTests:

* inspector/css/pseudo-element-matches.html:

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

4 years agoWeb Inspector: Tweak node styles in ObjectTreeView
commit-queue@webkit.org [Sat, 28 Mar 2015 16:33:48 +0000 (16:33 +0000)]
Web Inspector: Tweak node styles in ObjectTreeView
https://bugs.webkit.org/show_bug.cgi?id=143179

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-28
Reviewed by Timothy Hatcher.

* UserInterface/Views/LogContentView.css:
(.console-group-messages .outline-disclosure.single-node li):
* UserInterface/Views/DOMTreeOutline.css:
(.dom-tree-outline.single-node li):
This style makes sense as a generic DOMTreeOutline style.

* UserInterface/Views/FormattedValue.css:
(.formatted-node > .dom-tree-outline):
(.formatted-node > .dom-tree-outline ol):
(.formatted-node > .dom-tree-outline li.hovered:not(.selected) .selection):
Style for nodes in ObjectTreeView.

* UserInterface/Views/ObjectTreeArrayIndexTreeElement.css:
(.object-tree-array-index .index-value .formatted-node .dom-tree-outline):
Styles for node in Array value.

* UserInterface/Views/FormattedValue.js:
(WebInspector.FormattedValue.createElementForNode):
Address the FIXME.

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

4 years agonullptr cleanup in InlineFooBox classes
commit-queue@webkit.org [Sat, 28 Mar 2015 11:59:49 +0000 (11:59 +0000)]
nullptr cleanup in InlineFooBox classes
https://bugs.webkit.org/show_bug.cgi?id=143178

Patch by Joonghun Park <jh718.park@samsung.com> on 2015-03-28
Reviewed by Csaba Osztrogonác.

No new tests, no behavior changes

Replace 0 with nullptr in InlineFooBox classes.

* rendering/InlineBox.cpp:
(WebCore::InlineBox::prevLeafChildIgnoringLineBreak):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::removeChild):
(WebCore::InlineFlowBox::deleteLine):
(WebCore::InlineFlowBox::placeBoxesInInlineDirection):
(WebCore::InlineFlowBox::addTextBoxVisualOverflow):
* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::InlineFlowBox):
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::InlineTextBox):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::getLogicalStartBoxWithNode):
(WebCore::RootInlineBox::getLogicalEndBoxWithNode):
* rendering/RootInlineBox.h:
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::SVGInlineTextBox):
(WebCore::SVGInlineTextBox::releasePaintingResource):
(WebCore::SVGInlineTextBox::restoreGraphicsContextAfterTextPainting):
* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::closestLeafChildForPosition):
(WebCore::findFirstAndLastAttributesInVector):
* rendering/svg/SVGRootInlineBox.h:

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

4 years agoREGRESSION(r181326): It made dfg-int16array.js and dfg-int8array.js fail on AArch64...
ossy@webkit.org [Sat, 28 Mar 2015 09:57:07 +0000 (09:57 +0000)]
REGRESSION(r181326): It made dfg-int16array.js and dfg-int8array.js fail on AArch64 Linux
https://bugs.webkit.org/show_bug.cgi?id=142629

Unreviewed gardening, unskip now passing tests after r182091.

* js/script-tests/dfg-int16array.js:
* js/script-tests/dfg-int8array.js:

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

4 years agoDeconstruction parameters are bound too late
saambarati1@gmail.com [Sat, 28 Mar 2015 06:01:33 +0000 (06:01 +0000)]
Deconstruction parameters are bound too late
https://bugs.webkit.org/show_bug.cgi?id=143148

Reviewed by Filip Pizlo.

Source/JavaScriptCore:

Currently, a deconstruction pattern named with the same
name as a function will shadow the function. This is
wrong. It should be the other way around.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):

LayoutTests:

* js/regress/deconstructing-parameters-overridden-by-function-expected.txt: Added.
* js/regress/deconstructing-parameters-overridden-by-function.html: Added.
* js/regress/script-tests/deconstructing-parameters-overridden-by-function.js: Added.
(f):
(test):
(.arg):

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

4 years agoMore modern loops in RenderLayer.cpp
simon.fraser@apple.com [Sat, 28 Mar 2015 05:45:27 +0000 (05:45 +0000)]
More modern loops in RenderLayer.cpp
https://bugs.webkit.org/show_bug.cgi?id=143175

Reviewed by Ryosuke Niwa.

Use modern loops in more places in RenderLayer.app.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::update3DTransformedDescendantStatus):
(WebCore::RenderLayer::paint):
(WebCore::performOverlapTests):
(WebCore::RenderLayer::paintFixedLayersInNamedFlows):
(WebCore::RenderLayer::paintList):
(WebCore::RenderLayer::collectFragments):
(WebCore::RenderLayer::updatePaintingInfoForFragments):
(WebCore::RenderLayer::paintTransformedLayerIntoFragments):
(WebCore::RenderLayer::calculateClipRects):

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

4 years agonullptr cleanup in RenderLayer
simon.fraser@apple.com [Sat, 28 Mar 2015 05:45:20 +0000 (05:45 +0000)]
nullptr cleanup in RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=143174

Reviewed by Ryosuke Niwa.

Replace 0 with nullptr in RenderLayer.cpp.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::filterRenderer):
(WebCore::RenderLayer::updateLayerPositionsAfterLayout):
(WebCore::RenderLayer::updateLayerPositionsAfterOverflowScroll):
(WebCore::RenderLayer::positionNewlyCreatedOverflowControls):
(WebCore::RenderLayer::enclosingOverflowClipLayer):
(WebCore::RenderLayer::enclosingCompositingLayer):
(WebCore::RenderLayer::enclosingCompositingLayerForRepaint):
(WebCore::RenderLayer::enclosingFilterLayer):
(WebCore::RenderLayer::enclosingFilterRepaintLayer):
(WebCore::RenderLayer::clippingRootForPainting):
(WebCore::RenderLayer::transparentPaintingAncestor):
(WebCore::transparencyClipBox):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::removeOnlyThisLayer):
(WebCore::RenderLayer::insertOnlyThisLayer):
(WebCore::accumulateOffsetTowardsAncestor):
(WebCore::RenderLayer::enclosingScrollableArea):
(WebCore::RenderLayer::enclosingPaginationLayerInSubtree):
(WebCore::RenderLayer::enclosingElement):
(WebCore::RenderLayer::enclosingFlowThreadAncestor):
(WebCore::RenderLayer::hitTestFixedLayersInNamedFlows):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::hitTestTransformedLayerInFragments):
(WebCore::RenderLayer::hitTestLayerByApplyingTransform):
(WebCore::RenderLayer::hitTestList):
(WebCore::RenderLayer::updateClipRects):
(WebCore::RenderLayer::clipRects):
(WebCore::RenderLayer::calculateClipRects):

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

4 years agoWeb Inspector: TypeProfiler doesn't work on files with ES6 Class Syntax
commit-queue@webkit.org [Sat, 28 Mar 2015 05:04:23 +0000 (05:04 +0000)]
Web Inspector: TypeProfiler doesn't work on files with ES6 Class Syntax
https://bugs.webkit.org/show_bug.cgi?id=143169

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-27
Reviewed by Timothy Hatcher.

* UserInterface/Models/ScriptSyntaxTree.js:
(WebInspector.ScriptSyntaxTree.prototype._recurse):
(WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
(WebInspector.ScriptSyntaxTree):
Add basic support for Esprima's ES6 Class/Method/Spread nodes.
There are more ES6 features that should be covered, but this
covers all the features we use in Web Inspector source, so
Type Profiling can work with our own source.

Treat Methods like getters / setters right now because their
syntax is very similiar to getters/setters. There is a bug
handling generic ES6 cleanup to better name things.

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

4 years agoWeb Inspector: Uncaught TDZ Exception with Type Profiler
commit-queue@webkit.org [Sat, 28 Mar 2015 04:42:48 +0000 (04:42 +0000)]
Web Inspector: Uncaught TDZ Exception with Type Profiler
https://bugs.webkit.org/show_bug.cgi?id=143167

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-27
Reviewed by Timothy Hatcher.

* UserInterface/Views/TypePropertiesSection.js:
(WebInspector.TypePropertyTreeElement):
Avoid TDZ issue by not using "this" before "super".

* UserInterface/Models/ScriptSyntaxTree.js:
(WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
(WebInspector.ScriptSyntaxTree):
Better handle unsupported node types by returning null and avoiding an exception.

* UserInterface/Views/SourceCodeTextEditor.js:
Fix an issue I saw once where the sourceCode was a Script itself.

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

4 years agoWeb Inspector: Uncaught exception while debugging, after performSearch callback line...
commit-queue@webkit.org [Sat, 28 Mar 2015 04:41:47 +0000 (04:41 +0000)]
Web Inspector: Uncaught exception while debugging, after performSearch callback line does not exists
https://bugs.webkit.org/show_bug.cgi?id=143172

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-27
Reviewed by Timothy Hatcher.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.customPerformSearch.searchResultCallback):
(WebInspector.SourceCodeTextEditor.prototype.customPerformSearch):
Gracefully handle if the line does not exist.

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

4 years ago.:
gyuyoung.kim@samsung.com [Sat, 28 Mar 2015 04:18:13 +0000 (04:18 +0000)]
.:
[CMake] Remove unnecessary INCLUDE_IF_EXISTS macro
https://bugs.webkit.org/show_bug.cgi?id=143138

Reviewed by Csaba Osztrogonác.

INCLUDE_IF_EXISTS isn't used except for 2 places. However those uses can
be replaced with WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS.

* Source/cmake/OptionsWindows.cmake:
Set "PORT" instead of "PORT_FALLBACK" because there is no benefit to define PORT_FALLBACK.
* Source/cmake/WebKitMacros.cmake:

Tools:
[CMake] Remove unnecessary INCLUDE_IF_EXISTS macro
https://bugs.webkit.org/show_bug.cgi?id=143138

Reviewed by Csaba Osztrogonác.

INCLUDE_IF_EXISTS isn't used except for 2 places. However those uses can
be replaced with WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS.

* ImageDiff/CMakeLists.txt:
Use WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS() instead of INCLUDE_IF_EXISTS.
* WebKitTestRunner/CMakeLists.txt: ditto.

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

4 years agoparse doesn't initialize the 16-bit version of the JSC parser with defaultConstructorKind
rniwa@webkit.org [Sat, 28 Mar 2015 04:02:49 +0000 (04:02 +0000)]
parse doesn't initialize the 16-bit version of the JSC parser with defaultConstructorKind
https://bugs.webkit.org/show_bug.cgi?id=143170

Reviewed by Benjamin Poulain.

Assert that we never use 16-bit version of the parser to parse a default constructor
since both base and derived default constructors should be using a 8-bit string.

* parser/Parser.h:
(JSC::parse):

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

4 years ago[TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
yoon@igalia.com [Sat, 28 Mar 2015 03:15:07 +0000 (03:15 +0000)]
[TexMap] Seperate BitmapTexture related classes implementations from TextureMapper
https://bugs.webkit.org/show_bug.cgi?id=142386

Reviewed by Žan Doberšek.

TextureMapper and TextureMapperGL are bloated and tightly coupled with
BitmapTexture. We should move these classes to seperated file of their own.
Also, this patch removes friend relationship from TextureMapperGL and  its
subsidiary classes.

The main purpose of this refactoring is to expose BitmapTexturePool to
renderers of platformlayers like Video and Canvas. By doing this, each
renderer can acquire textures from the global texture pool to paint
their contents directly.

Source/WebCore:

No new tests needed.

* PlatformEfl.cmake:
* PlatformGTK.cmake:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
Include BitmapTextureGL and BitmapTexturePool explicitly

* platform/graphics/texmap/BitmapTexture.cpp: Added.
* platform/graphics/texmap/BitmapTexture.h: Added.
(WebCore::BitmapTexture::updateContents):
Exclude BitmapTexture class from TextureMapper

* platform/graphics/texmap/BitmapTextureGL.cpp: Added.
* platform/graphics/texmap/BitmapTextureGL.h: Added.
Exclude BitmapTextureGL class from TextureMapperGL
(WebCore::BitmapTextureGL::clipStack): Added.
Add the getter for clipStack for TextureMapperGL
(WebCore::BitmapTextureGL::Bind): Deleted.
(WebCore::BitmapTextureGL::BindAsSurface): Added.
Bind used TextureMapperGL's internal data directly to compute projection matrix as a friend class,
However, TextureMapperGL can compute projection matrix itself after binding job, so this
friend ship is not needed. Also, this patch renames Bind to BindAsSurface to remove ambiguity.

* platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Added.
* platform/graphics/texmap/BitmapTextureImageBuffer.h: Added.
Exclude BitmapTextureImageBuffer class from TextureMapperImageBuffer

* platform/graphics/texmap/BitmapTexturePool.cpp: Added.
* platform/graphics/texmap/BitmapTexturePool.h: Added.
Exclude BitmapTexturePool class from TextureMapperGL
(WebCore::BitmapTexturePool::acquireTexture):
Modified to use passed GraphicsContext3D instead of TextureMapperGL to remove redundant coupling

* platform/graphics/texmap/TextureMapper.cpp:
* platform/graphics/texmap/TextureMapper.h:
Remove BitmapTexturePool and BitmapTexture from its implementation.

* platform/graphics/texmap/TextureMapperGL.cpp:
* platform/graphics/texmap/TextureMapperGL.h:
Remove BitmapTextureGL from its implementation.
(WebCore::TextureMapperGL::TextureMapperGL):
(WebCore::TextureMapperGL::clipStack):
(WebCore::TextureMapperGL::bindSurface):
(WebCore::TextureMapperGL::currentSurface):
Add a getter of the current surface for filtering operation in BitmapTextureGL.
It would be clear to move filtering operation from BitmapTextureGL to TextureMapperGL later.

(WebCore::TextureMapperGL::ClipStack):
Move inner class declaration to public.

* platform/graphics/texmap/TextureMapperImageBuffer.cpp:
* platform/graphics/texmap/TextureMapperImageBuffer.h:
Remove BitmapTextureImageBuffer from its implementation.

Source/WebKit2:

* Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp: Include BitmapTextureGL.h explicitly

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

4 years agoES6 Classes: Runtime error in JIT'd class calling super() with arguments and supercla...
rniwa@webkit.org [Sat, 28 Mar 2015 03:09:20 +0000 (03:09 +0000)]
ES6 Classes: Runtime error in JIT'd class calling super() with arguments and superclass has default constructor
https://bugs.webkit.org/show_bug.cgi?id=142862

Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Add a test that used to fail in DFG now that the bug has been fixed by r181993.

* tests/stress/class-syntax-derived-default-constructor.js: Added.

Source/WebInspectorUI:

Removed the workaround for the bug since it has been fixed by r181993.

* UserInterface/Base/Object.js:
* UserInterface/Models/DebuggerDashboard.js:
* UserInterface/Models/NetworkTimeline.js:
* UserInterface/Models/ReplayDashboard.js:
* UserInterface/Models/Revision.js:

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

4 years agoWeb Inspector: Add Setter Icon for ObjectTreeView
joepeck@webkit.org [Sat, 28 Mar 2015 02:56:24 +0000 (02:56 +0000)]
Web Inspector: Add Setter Icon for ObjectTreeView
https://bugs.webkit.org/show_bug.cgi?id=143129

Reviewed by Timothy Hatcher.

* UserInterface/Images/Pencil.svg: Added.
New icon used to indicate setter properties.

* Localizations/en.lproj/localizedStrings.js:
Remove "Read only" and replace with "Setter".

* UserInterface/Views/ObjectTreeArrayIndexTreeElement.js:
(WebInspector.ObjectTreeArrayIndexTreeElement.prototype._titleFragment):
(WebInspector.ObjectTreeArrayIndexTreeElement):
* UserInterface/Views/ObjectTreePropertyTreeElement.js:
(WebInspector.ObjectTreePropertyTreeElement.prototype._createTitlePropertyStyle):
(WebInspector.ObjectTreePropertyTreeElement.prototype._createTitleAPIStyle):
Update cases that created setter / getter elements.

* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement):
(WebInspector.ObjectTreeBaseTreeElement.prototype.createInteractiveGetterElement): Deleted.
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property :matches(.getter, .setter)):
(.object-tree-property .spacer):
(.object-tree-property .getter):
(.object-tree-property .setter):
(.object-tree-property .getter + .setter):
New setter element and styles. Setters are always non-interactable right now.

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

4 years agoload8Signed() and load16Signed() should be renamed to avoid confusion
msaboff@apple.com [Sat, 28 Mar 2015 02:55:12 +0000 (02:55 +0000)]
load8Signed() and load16Signed() should be renamed to avoid confusion
https://bugs.webkit.org/show_bug.cgi?id=143168

Reviewed by Benjamin Poulain.

Renamed load8Signed() to load8SignedExtendTo32() and load16Signed() to load16SignedExtendTo32().

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::load8SignedExtendTo32):
(JSC::MacroAssemblerARM::load16SignedExtendTo32):
(JSC::MacroAssemblerARM::load8Signed): Deleted.
(JSC::MacroAssemblerARM::load16Signed): Deleted.
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::load16SignedExtendTo32):
(JSC::MacroAssemblerARM64::load8SignedExtendTo32):
(JSC::MacroAssemblerARM64::load16Signed): Deleted.
(JSC::MacroAssemblerARM64::load8Signed): Deleted.
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::load16SignedExtendTo32):
(JSC::MacroAssemblerARMv7::load8SignedExtendTo32):
(JSC::MacroAssemblerARMv7::load16Signed): Deleted.
(JSC::MacroAssemblerARMv7::load8Signed): Deleted.
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::load8SignedExtendTo32):
(JSC::MacroAssemblerMIPS::load16SignedExtendTo32):
(JSC::MacroAssemblerMIPS::load8Signed): Deleted.
(JSC::MacroAssemblerMIPS::load16Signed): Deleted.
* assembler/MacroAssemblerSH4.h:
(JSC::MacroAssemblerSH4::load8SignedExtendTo32):
(JSC::MacroAssemblerSH4::load8):
(JSC::MacroAssemblerSH4::load16SignedExtendTo32):
(JSC::MacroAssemblerSH4::load16):
(JSC::MacroAssemblerSH4::load8Signed): Deleted.
(JSC::MacroAssemblerSH4::load16Signed): Deleted.
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::load8SignedExtendTo32):
(JSC::MacroAssemblerX86Common::load16SignedExtendTo32):
(JSC::MacroAssemblerX86Common::load8Signed): Deleted.
(JSC::MacroAssemblerX86Common::load16Signed): Deleted.
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitIntTypedArrayGetByVal):

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

4 years agoUse a typedef for the WKPluginLoadClientPolicy enum
andersca@apple.com [Sat, 28 Mar 2015 01:57:22 +0000 (01:57 +0000)]
Use a typedef for the WKPluginLoadClientPolicy enum
https://bugs.webkit.org/show_bug.cgi?id=143161

Reviewed by Tim Horton.

* UIProcess/API/C/WKPluginLoadPolicy.h:

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

4 years agoWeb Inspector: Uncaught Exceptions with Context Menus
commit-queue@webkit.org [Sat, 28 Mar 2015 00:59:28 +0000 (00:59 +0000)]
Web Inspector: Uncaught Exceptions with Context Menus
https://bugs.webkit.org/show_bug.cgi?id=143162

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-27
Reviewed by Timothy Hatcher.

* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.contextMenuCleared):

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

4 years agoWeb Inspector: Disable editing in Metrics section while it is not working
commit-queue@webkit.org [Sat, 28 Mar 2015 00:57:53 +0000 (00:57 +0000)]
Web Inspector: Disable editing in Metrics section while it is not working
https://bugs.webkit.org/show_bug.cgi?id=143165

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-27
Reviewed by Timothy Hatcher.

* UserInterface/Views/BoxModelDetailsSectionRow.js:
(WebInspector.BoxModelDetailsSectionRow.prototype._updateMetrics.createElement):
(WebInspector.BoxModelDetailsSectionRow.prototype._applyUserInput):
Disable double click to edit while it is not working. The value setter
and add methods no longer exist.

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

4 years agoWeb Inspector: Uncaught Exceptions evaluating code while paused
commit-queue@webkit.org [Sat, 28 Mar 2015 00:56:03 +0000 (00:56 +0000)]
Web Inspector: Uncaught Exceptions evaluating code while paused
https://bugs.webkit.org/show_bug.cgi?id=143163

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-27
Reviewed by Timothy Hatcher.

* UserInterface/Models/CallFrame.js:
(WebInspector.CallFrame.prototype.collectScopeChainVariableNames):
We define a property named "valueForCaseInsensitiveKey" on Object.prototype
that is readonly. So we should avoid Object.prototype when building our
result list. This should probably move to a Map object eventually.

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

4 years agoWeb Inspector: Remove unused testing properties
commit-queue@webkit.org [Sat, 28 Mar 2015 00:54:31 +0000 (00:54 +0000)]
Web Inspector: Remove unused testing properties
https://bugs.webkit.org/show_bug.cgi?id=143156

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-27
Reviewed by Timothy Hatcher.

* UserInterface/Views/LegacyConsoleMessageImpl.js:
(WebInspector.LegacyConsoleMessageImpl.prototype._formatMessage):
* UserInterface/Views/Section.js:
(WebInspector.Section.prototype.get subtitleAsTextForTest): Deleted.

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

4 years agoWeb Inspector: Uncaught Exception: TypeError: Attempted to assign to readonly - DOMNo...
commit-queue@webkit.org [Sat, 28 Mar 2015 00:51:18 +0000 (00:51 +0000)]
Web Inspector: Uncaught Exception: TypeError: Attempted to assign to readonly - DOMNodeDetailsSidebarPanel.js
https://bugs.webkit.org/show_bug.cgi?id=143139

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-03-27
Reviewed by Timothy Hatcher.

DataGridNodes do not have a selectable setter. TreeElements do.
DataGridNodes are always selectable. Match current behavior by
removing all instances of attempting to set the selectability
which would, under strict mode, result in an error.

* UserInterface/Views/ApplicationCacheFrameContentView.js:
(WebInspector.ApplicationCacheFrameContentView.prototype._populateDataGrid):
* UserInterface/Views/CookieStorageContentView.js:
(WebInspector.CookieStorageContentView.prototype._rebuildTable):
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._createAttributesDataGrid):
(WebInspector.DOMNodeDetailsSidebarPanel):
* UserInterface/Views/DOMStorageContentView.js:
(WebInspector.DOMStorageContentView.prototype.reset):
* UserInterface/Views/DataGrid.js:

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

4 years agoFix flakey dfg-int8array.js and dfg-int16array.js tests for ARM64
msaboff@apple.com [Sat, 28 Mar 2015 00:40:56 +0000 (00:40 +0000)]
Fix flakey dfg-int8array.js and dfg-int16array.js tests for ARM64
https://bugs.webkit.org/show_bug.cgi?id=138390

Reviewed by Mark Lam.

Source/JavaScriptCore:

Changed load8Signed() and load16Signed() to only sign extend the loaded value to 32 bits
instead of 64 bits.  This is what X86-64 does.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::load16Signed):
(JSC::MacroAssemblerARM64::load8Signed):

LayoutTests:

Reenabled the tests for ARM64/iOS.  Left the tests disabled for ARM64/linux and will let linux
developers test and reenable under existing but https://bugs.webkit.org/show_bug.cgi?id=142629.

* js/script-tests/dfg-int16array.js:
* js/script-tests/dfg-int8array.js:

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

4 years ago[WK2][NetworkCache] Use WTF::WorkQueue abstraction inside NetworkCacheStatistics
cdumez@apple.com [Fri, 27 Mar 2015 23:49:15 +0000 (23:49 +0000)]
[WK2][NetworkCache] Use WTF::WorkQueue abstraction inside NetworkCacheStatistics
https://bugs.webkit.org/show_bug.cgi?id=143154

Reviewed by Antti Koivisto.

Use WTF::WorkQueue abstraction inside NetworkCacheStatistics, like we
already do in NetworkCacheStorage.

* NetworkProcess/cache/NetworkCacheStatistics.cpp: Renamed from Source/WebKit2/NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm.
(WebKit::NetworkCache::executeSQLCommand):
(WebKit::NetworkCache::executeSQLStatement):
(WebKit::NetworkCache::Statistics::open):
(WebKit::NetworkCache::Statistics::Statistics):
(WebKit::NetworkCache::Statistics::initialize):
(WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
(WebKit::NetworkCache::Statistics::shrinkIfNeeded):
(WebKit::NetworkCache::Statistics::recordRetrievalRequest):
(WebKit::NetworkCache::Statistics::recordNotCachingResponse):
(WebKit::NetworkCache::retrieveDecisionToDiagnosticKey):
(WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
(WebKit::NetworkCache::storeDecisionToDiagnosticKey):
(WebKit::NetworkCache::Statistics::recordRetrievalFailure):
(WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
(WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
(WebKit::NetworkCache::Statistics::markAsRequested):
(WebKit::NetworkCache::Statistics::writeTimerFired):
(WebKit::NetworkCache::Statistics::queryWasEverRequested):
(WebKit::NetworkCache::Statistics::clear):
(WebKit::NetworkCache::Statistics::addHashesToDatabase):
(WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
* NetworkProcess/cache/NetworkCacheStatistics.h:
(WebKit::NetworkCache::Statistics::serialBackgroundIOQueue):
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoSupport building WTF on Windows without Cygwin
mmaxfield@apple.com [Fri, 27 Mar 2015 23:08:01 +0000 (23:08 +0000)]
Support building WTF on Windows without Cygwin
https://bugs.webkit.org/show_bug.cgi?id=143084

Reviewed by Brent Fulgham.

Tools:
Windows without Cygwin doesn't have curl, unzip, or grep. Luckily, Perl does all of these things.
This patch also migrates to using File::Spec->catfile() for directory separators.

* Scripts/update-webkit-dependency:
(wanted):
* Scripts/update-webkit-support-libs:
(wanted):
(downloadExpectedVersionNumber):
(zipFileVersion):
(toUnixPath): Deleted.
* Scripts/webkitdirs.pm:
(determineSourceDir):
(windowsSourceSourceDir):
(windowsLibrariesDir):
(windowsOutputDir):
(checkInstalledTools):
(buildVisualStudioProject):

Source/WTF:
Windows doesn't have "touch".

* WTF.vcxproj/WTFGenerated.make:

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

4 years agoWebProcess started by editable WKWebView spends 15% of its initialization time loadin...
timothy_horton@apple.com [Fri, 27 Mar 2015 23:01:37 +0000 (23:01 +0000)]
WebProcess started by editable WKWebView spends 15% of its initialization time loading DataDetectors
https://bugs.webkit.org/show_bug.cgi?id=143142
<rdar://problem/20324495>

Reviewed by Anders Carlsson.

Calling DataDetectorsLibrary() is expensive; we should avoid doing it
until actually necessary. When loading a page that makes a caret selection,
ServicesOverlayController was calling DataDetectorsLibrary() (ignoring the fact
that a caret selection can't have any services associated with it) to avoid
crashing on systems where DataDetectors is not available. Instead, we should
first check if there's anything to do, and then check for the existence
of DataDetectors.

* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
Build the list of phone number ranges, and bail (clearing the potential highlights)
if it is empty, before calling DataDetectorsLibrary().

(WebCore::ServicesOverlayController::buildSelectionHighlight):
Check the list of selection rects, and bail (clearing the potential highlights)
if it is empty, before calling DataDetectorsLibrary().

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

4 years agoSafari clears selection when its window gets activated via mouse down
rniwa@webkit.org [Fri, 27 Mar 2015 22:56:15 +0000 (22:56 +0000)]
Safari clears selection when its window gets activated via mouse down
https://bugs.webkit.org/show_bug.cgi?id=143157

Reviewed by Anders Carlsson.

The bug was caused by PlatformMouseEvent created in WebKit2 not having its event number
even though we were correctly calling setActivationEventNumber in WebPage::acceptsFirstMouse.

Fixed the bug by storing [NSEvent eventNumber] in WebMouseEvent on Mac in WebKit2 as done in WebKit1.

* Shared/WebEvent.h:
(WebKit::WebMouseEvent::eventNumber):
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
* Shared/WebMouseEvent.cpp:
(WebKit::WebMouseEvent::WebMouseEvent):
(WebKit::WebMouseEvent::encode):
(WebKit::WebMouseEvent::decode):
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebMouseEvent):

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

4 years agoOnly do the Connection::setShouldCloseConnectionOnMachExceptions() hack where necessary
andersca@apple.com [Fri, 27 Mar 2015 22:07:47 +0000 (22:07 +0000)]
Only do the Connection::setShouldCloseConnectionOnMachExceptions() hack where necessary
https://bugs.webkit.org/show_bug.cgi?id=143141
rdar://problem/19471284

Reviewed by Andreas Kling.

* Platform/IPC/Connection.h:
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate):
(IPC::Connection::platformInitialize):
(IPC::Connection::open):
* Shared/ChildProcessProxy.cpp:
(WebKit::ChildProcessProxy::didFinishLaunching):
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::didFinishLaunching):

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

4 years agoImplement iOS WebKit2 PDF Find-in-Page
timothy_horton@apple.com [Fri, 27 Mar 2015 22:04:55 +0000 (22:04 +0000)]
Implement iOS WebKit2 PDF Find-in-Page
https://bugs.webkit.org/show_bug.cgi?id=143065
<rdar://problem/16793370>

Reviewed by Dan Bernstein.

* Platform/spi/ios/CorePDFSPI.h:
Add some SPI.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _countStringMatches:options:maxCount:]):
(-[WKWebView _findString:options:maxCount:]):
(-[WKWebView _hideFindUI]):
If we have a custom content view, forward find-in-page methods to it.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/API/Cocoa/_WKFindOptions.h:
Move _WKFindOptions into its own file.

* UIProcess/Cocoa/WKWebViewContentProvider.h:
Add find-related methods to the WKWebViewContentProvider protocol.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_initWithFrame:webView:]):
(-[WKPDFView dealloc]):
Maintain a dispatch queue for searching the PDF.

(-[WKPDFView web_setContentProviderData:suggestedFilename:]):
Fix a type.

(-[WKPDFView _ensureViewForPage:]):
Split the code to create/parent a page view out from _revalidateViews,
so that the find code can create/parent the targetted UIPDFPageView
in order to install the find highlight in it, but before it is scrolled into view.

(-[WKPDFView _revalidateViews]):
Use the stored page index instead of counting again.
Don't unparent page views that have find-in-page highlights in them, because
we won't know enough to recreate them later.

(-[WKPDFView _computePageAndDocumentFrames]):
Put the page index in PDFPageInfo, for reference elsewhere.

(-[WKPDFView _stringCompareOptionsFromWKFindOptions:]):
(-[WKPDFView _computeMatchesForString:options:maxCount:completionHandler:]):
Asynchronously (and on our serial queue) search the PDF for the given string.
We'll cache the most recent results to avoid searching more than once,
cancel existing searches when another begins (since it's a serial queue,
this ensures we'll only have one search active at a time).

(-[WKPDFView web_countStringMatches:options:maxCount:]):
Count the number of matches for the given string, and inform the FindClient
of the result.

(-[WKPDFView _didFindMatch:]):
When we find a match, create a view for it, highlight the match, and
zoom so that it's in-view.

(-[WKPDFView web_findString:options:maxCount:]):
Incrementally search the document for the given string. We do an incremental
search even if we have all of the results so that we can anchor the search
in the right place if the new string is a prefix of the old string, etc.
Wrap around appropriately when searching past the beginning or end of the
document. If we have all of the results (there were less than maxCount results),
look through the cached matches for the incrementally-found result and
report its index to the client.

(-[WKPDFView web_hideFindUI]):
Dismiss the selection and clear some state so we start the next search afresh.

* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoWebProcessProxy should not retain WebBackForwardListItems forever.
akling@apple.com [Fri, 27 Mar 2015 22:01:54 +0000 (22:01 +0000)]
WebProcessProxy should not retain WebBackForwardListItems forever.
<https://webkit.org/b/143152>
<rdar://problem/19925709>

Reviewed by Anders Carlsson.

Have WebProcessProxy actually forget about a WebBackForwardListItem after it's removed from
the WebBackForwardList.

This ensures that we don't accumulate too many of these objects, which can get quite large
due to the session state encoded in them.

We already have graceful handling of the case where an incoming IPC message references
a removed back/forward list item.

* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::didRemoveItem):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::backForwardRemovedItem):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::removeBackForwardItem):
* UIProcess/WebProcessProxy.h:

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

4 years agoAdd back previously broken assert from bug 141869
saambarati1@gmail.com [Fri, 27 Mar 2015 21:56:35 +0000 (21:56 +0000)]
Add back previously broken assert from bug 141869
https://bugs.webkit.org/show_bug.cgi?id=143005

Reviewed by Michael Saboff.

* runtime/ExceptionHelpers.cpp:
(JSC::invalidParameterInSourceAppender):

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

4 years agoUse the correct timebase to log scrollperf blank pixel counts on iOS
simon.fraser@apple.com [Fri, 27 Mar 2015 21:38:43 +0000 (21:38 +0000)]
Use the correct timebase to log scrollperf blank pixel counts on iOS
https://bugs.webkit.org/show_bug.cgi?id=143149

Reviewed by Tim Horton.

MobileSafari and WebKit need to collect scrollperf data using the same timebase;
MobileSafari can't call WTF::monotonicallyIncreasingTime(), so use CFAbsoluteTimeGetCurrent()
everywhere.

* UIProcess/Cocoa/RemoteLayerTreeScrollingPerformanceData.mm:
(WebKit::RemoteLayerTreeScrollingPerformanceData::appendBlankPixelCount):

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

4 years ago[Mac] Safari fails to fire page "load" event with video[preload=none]
jer.noble@apple.com [Fri, 27 Mar 2015 21:32:38 +0000 (21:32 +0000)]
[Mac] Safari fails to fire page "load" event with video[preload=none]
https://bugs.webkit.org/show_bug.cgi?id=143147

Reviewed by Simon Fraser.

Source/WebCore:

Test: media/video-page-load-preload-none.html

When told to load() when preload == None, set the networkState to Idle.
This causes HTMLMediaElement to set the shouldDelayLoadEvent flag to
false, and allows the page's 'load' event to fire.

Drive-by fix: add setNetworkState() and setReadyState() methods to
MediaPlayerPrivateAVFoundation, reducing a bunch of code duplication.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::load):
(WebCore::MediaPlayerPrivateAVFoundation::setNetworkState):
(WebCore::MediaPlayerPrivateAVFoundation::setReadyState):
(WebCore::MediaPlayerPrivateAVFoundation::updateStates):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:

LayoutTests:

* media/video-page-load-preload-none-expected.txt: Added.
* media/video-page-load-preload-none.html: Added.

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

4 years agoCalling crypto.webkitSubtle.generateKey causes page memory to never be released
ap@apple.com [Fri, 27 Mar 2015 21:02:31 +0000 (21:02 +0000)]
Calling crypto.webkitSubtle.generateKey causes page memory to never be released
https://bugs.webkit.org/show_bug.cgi?id=143151
rdar://problem/18940687

Reviewed by Tim Horton.

* crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::generatePair): Don't.

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

4 years agoNull dereference in InbandMetadataTextTrack handling
bfulgham@apple.com [Fri, 27 Mar 2015 20:41:33 +0000 (20:41 +0000)]
Null dereference in InbandMetadataTextTrack handling
https://bugs.webkit.org/show_bug.cgi?id=143144
<rdar://problem/18983250>

Reviewed by Eric Carlson.

* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
(WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes): Check for null return value from
'client()', just like we do in all other methods.

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

4 years agoCorrect test results after r182012.
bfulgham@apple.com [Fri, 27 Mar 2015 20:39:49 +0000 (20:39 +0000)]
Correct test results after r182012.

The test now produces identical results on all platforms, so update the root test result,
and remove custom non-matching expectations. This corrects Windows, GTK, and EFL builds, and
should not harm the Mac build.

* accessibility/aria-toggle-button-with-title-expected.txt:
* platform/mac/accessibility/aria-toggle-button-with-title-expected.txt: Removed.
* platform/win/accessibility/aria-toggle-button-with-title-expected.txt: Removed.

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

4 years ago[WK2][NetworkCache] Rename requestNeedsRevalidation() to requestRequiresRevalidation()
cdumez@apple.com [Fri, 27 Mar 2015 20:17:00 +0000 (20:17 +0000)]
[WK2][NetworkCache] Rename requestNeedsRevalidation() to requestRequiresRevalidation()
https://bugs.webkit.org/show_bug.cgi?id=143137

Reviewed by Antti Koivisto.

Rename requestNeedsRevalidation() to requestRequiresRevalidation() as I
think it is more accurate. It is not the request that needs revalidating.
The requests just requires us to revalidate the response.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::requestRequiresRevalidation):
(WebKit::NetworkCache::canUse):
(WebKit::NetworkCache::requestNeedsRevalidation): Deleted.

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

4 years agoForward additional CFNetwork ATS information to child processes
oliver@apple.com [Fri, 27 Mar 2015 19:04:28 +0000 (19:04 +0000)]
Forward additional CFNetwork ATS information to child processes
https://bugs.webkit.org/show_bug.cgi?id=143136

Reviewed by Anders Carlsson.

Source/WebCore:

Declare SPI.

* platform/spi/cf/CFNetworkSPI.h:

Source/WebKit2:

Add additional process creation parameter information, and pass it
to the child processes that actually use CFNetwork.

* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
* Shared/Network/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* Shared/Network/NetworkProcessCreationParameters.h:
* Shared/Plugins/PluginProcessCreationParameters.cpp:
(WebKit::PluginProcessCreationParameters::encode):
(WebKit::PluginProcessCreationParameters::decode):
* Shared/Plugins/PluginProcessCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformInitializePluginProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

4 years agoGardening: skipping inspector-protocol/debugger/setBreakpoint-dfg-and-modify-local...
mark.lam@apple.com [Fri, 27 Mar 2015 19:04:04 +0000 (19:04 +0000)]
Gardening: skipping inspector-protocol/debugger/setBreakpoint-dfg-and-modify-local.html until crash is fixed.
<https://webkit.org/b/143105>

Not reviewed.

* TestExpectations:

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

4 years ago[WK2][NetworkCache] We only cache responses with status codes that are cacheable...
cdumez@apple.com [Fri, 27 Mar 2015 18:24:39 +0000 (18:24 +0000)]
[WK2][NetworkCache] We only cache responses with status codes that are cacheable by default
https://bugs.webkit.org/show_bug.cgi?id=143125
<rdar://problem/20321172>

Reviewed by Antti Koivisto.

Source/WebCore:

Export a couple of extra symbols.

* platform/network/ResourceResponseBase.h:

Source/WebKit2:

We Previously only cached responses with status codes that are cacheable
by default [1]. However, RFC 7234 [2] allows us to cache responses with
other status codes, as long as they have explicit headers allowing
caching:
- 'Expires' header field
- 'max-age' response directive

This patch updates our caching policy accordingly to improve efficiency.

[1] http://tools.ietf.org/html/rfc7231#page-48
[2] http://tools.ietf.org/html/rfc7234#section-4.3.2

Test: http/tests/cache/disk-cache/disk-cache-307-status-code.html

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::canStore):

LayoutTests:

Add layout test to check that responses with status code 307 (which is not
cacheable by default) are cached if they have explicit expiration headers.

Also update a couple of other disk cache tests to cover heuristic
freshness (http://tools.ietf.org/html/rfc7234#section-4.2.2), relying on
'Last-Modified' header to estimate freshness if usual expiration headers
are not available.

* http/tests/cache/disk-cache/disk-cache-204-status-code-expected.txt:
* http/tests/cache/disk-cache/disk-cache-204-status-code.html:
* http/tests/cache/disk-cache/disk-cache-307-status-code-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-307-status-code.html: Added.
* http/tests/cache/disk-cache/disk-cache-404-status-code-expected.txt:
* http/tests/cache/disk-cache/disk-cache-404-status-code.html:

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

4 years agoUnreviewed gardening.
ossy@webkit.org [Fri, 27 Mar 2015 18:00:05 +0000 (18:00 +0000)]
Unreviewed gardening.

* js/script-tests/array-length-shortening.js: Unskip, r182058 fixed it.

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

4 years agoHTMLMediaElement will fire 'seeked' before seek completes, leading to currentTime...
jer.noble@apple.com [Fri, 27 Mar 2015 17:30:38 +0000 (17:30 +0000)]
HTMLMediaElement will fire 'seeked' before seek completes, leading to currentTime discontinuities.
https://bugs.webkit.org/show_bug.cgi?id=143132

Reviewed by Eric Carlson.

When seeking, if the ready state rises to >= HAVE_CURRENT_DATA, we will fire the 'seeked'
event and continue playback. However, if a media engine updates the ready state before its
seek operation actually completes, the currentTime it returns may still be the time before
the seek.

Wait until both the ready state rises to HAVE_CURRENT_DATA and m_player->seeking() returns
false before firing the 'seeked' event.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):

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

4 years agoMake some more objects use FastMalloc
ggaren@apple.com [Fri, 27 Mar 2015 17:27:47 +0000 (17:27 +0000)]
Make some more objects use FastMalloc
https://bugs.webkit.org/show_bug.cgi?id=143122

Reviewed by Csaba Osztrogonác.

Source/JavaScriptCore:

* API/JSCallbackObject.h:
* heap/IncrementalSweeper.h:
* jit/JITThunks.h:
* runtime/JSGlobalObjectDebuggable.h:
* runtime/RegExpCache.h:

Source/WebCore:

* Modules/geolocation/GeolocationController.h:
* Modules/geolocation/NavigatorGeolocation.h:
* Modules/indexeddb/DOMWindowIndexedDatabase.h:
* Modules/notifications/NotificationController.h:
* Modules/webdatabase/DatabaseServer.h:
* css/CSSFontFaceSource.h:
* html/HTMLMediaSession.h:
* inspector/InspectorIndexedDBAgent.h:
* inspector/InspectorReplayAgent.h:
* page/CaptionUserPreferencesMediaAF.h:
* page/PageConsoleClient.h:
* page/PageDebuggable.h:
* page/animation/CSSPropertyAnimation.cpp:
* page/mac/ServicesOverlayController.h:
* platform/RemoteCommandListener.h:
* platform/Timer.h:
* platform/audio/MediaSessionManager.h:
* platform/mac/SystemSleepListenerMac.h:
* platform/mac/ThemeMac.h:
* rendering/svg/RenderSVGResourceSolidColor.h:
* replay/ReplayController.h:

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

4 years agoFEMorphology::platformApplyGeneric() should bail out if the radius is less than or...
commit-queue@webkit.org [Fri, 27 Mar 2015 17:02:46 +0000 (17:02 +0000)]
FEMorphology::platformApplyGeneric() should bail out if the radius is less than or equal to zero.
https://bugs.webkit.org/show_bug.cgi?id=142885.

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-03-27
Reviewed by Dean Jackson.

Source/WebCore:

FEMorphology class implementation code clean up.

Tests: svg/filters/feMorphology-radius-cases.svg

* platform/graphics/filters/FEMorphology.cpp:
(WebCore::shouldSupersedeExtremum): Reuse code instead of repeating it and
use < and > instead of =< and >=.

(WebCore::pixelArrayIndex): Returns the array index of a pixel in an image
buffer, given: position(x, y), image width and the color channel.

(WebCore::columnExtremum): Returns the extremum of a column of pixels.

(WebCore::kernelExtremum): Returns the extremum of a filter kernel.

(WebCore::FEMorphology::platformApplyGeneric): Apply some code clean-up.
The kernel size should be equal to radius of the filter. The extra pixel
was causing the resulted image to be asymmetric in some cases.

(WebCore::FEMorphology::platformApplyDegenerate):
(WebCore::FEMorphology::platformApplySoftware): After applying scaling, we
still need to check the resulted radius is negative (overflow case) or less
than one (zero radius case) and treat these cases differently.

(WebCore::FEMorphology::morphologyOperator): Deleted.
(WebCore::FEMorphology::radiusX): Deleted.
(WebCore::FEMorphology::radiusY): Deleted.
* platform/graphics/filters/FEMorphology.h:
(WebCore::FEMorphology::morphologyOperator):
(WebCore::FEMorphology::radiusX):
(WebCore::FEMorphology::radiusY):
Move a single line functions from the source file to the header file.

LayoutTests:

* svg/filters/feMorphology-radius-cases-expected.svg: Added.
* svg/filters/feMorphology-radius-cases.svg: Added.
Test different cases for radius of the feMorphology filter. There are three
cases for the radius:
    1. radius < 0: This is an error case, the source image should not be rendered.
    2. radius = 0: This case is treated as if the filter never exists.
    3. radius > 0: If the scaled radius is > 0, the filter is applied.

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

4 years agoFix WinCairo bot.
commit-queue@webkit.org [Fri, 27 Mar 2015 16:59:24 +0000 (16:59 +0000)]
Fix WinCairo bot.
https://bugs.webkit.org/show_bug.cgi?id=143086

Patch by Alex Christensen <achristensen@webkit.org> on 2015-03-27
Reviewed by Brent Fulgham.

* Scripts/webkitdirs.pm:
(buildVisualStudioProject):
(runSvnUpdateAndResolveChangeLogs):
Use ActivePerl-friendly perl.

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

4 years agoMove CacheValidation to platform
antti@apple.com [Fri, 27 Mar 2015 16:49:21 +0000 (16:49 +0000)]
Move CacheValidation to platform
https://bugs.webkit.org/show_bug.cgi?id=143133

Reviewed by Chris Dumez.

It deals with platform types only and is currently violating layering.

* WebCore.xcodeproj/project.pbxproj:
* loader/cache/CacheValidation.cpp: Removed.
* loader/cache/CacheValidation.h: Removed.
* platform/network/CacheValidation.cpp: Copied from Source/WebCore/loader/cache/CacheValidation.cpp.
* platform/network/CacheValidation.h: Copied from Source/WebCore/loader/cache/CacheValidation.h.

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

4 years agoURTBF after r182059 to fix the EFL build.
ossy@webkit.org [Fri, 27 Mar 2015 16:42:16 +0000 (16:42 +0000)]
URTBF after r182059 to fix the EFL build.

* TestWebKitAPI/CMakeLists.txt:

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

4 years agoUnreviewed, rolling out r177896.
commit-queue@webkit.org [Fri, 27 Mar 2015 16:15:39 +0000 (16:15 +0000)]
Unreviewed, rolling out r177896.
https://bugs.webkit.org/show_bug.cgi?id=142978

Loading libgstclutter.so in-process hangs web process
(Requested by mcatanzaro on #webkit).

Reverted changeset:

"[GStreamer] Disable gst-plugin-scanner if seccomp filters are
enabled"
https://bugs.webkit.org/show_bug.cgi?id=140069
http://trac.webkit.org/changeset/177896

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

4 years agoRespect cache-control directives in request
antti@apple.com [Fri, 27 Mar 2015 15:13:02 +0000 (15:13 +0000)]
Respect cache-control directives in request
https://bugs.webkit.org/show_bug.cgi?id=143121
Source/WebCore:

rdar://problem/19714040

Reviewed by Chris Dumez.

Test: http/tests/cache/disk-cache/disk-cache-request-headers.html

* loader/cache/CacheValidation.cpp:
(WebCore::isCacheHeaderSeparator):
(WebCore::isControlCharacter):
(WebCore::trimToNextSeparator):
(WebCore::parseCacheHeader):
(WebCore::parseCacheControlDirectives):

    Factor Cache-control parsing here so it can be used for both requests and responses.

* loader/cache/CacheValidation.h:
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::ResourceResponseBase):
(WebCore::ResourceResponseBase::parseCacheControlDirectives):
(WebCore::ResourceResponseBase::cacheControlContainsNoCache):
(WebCore::ResourceResponseBase::cacheControlContainsNoStore):
(WebCore::ResourceResponseBase::cacheControlContainsMustRevalidate):
(WebCore::ResourceResponseBase::cacheControlMaxAge):
(WebCore::isCacheHeaderSeparator): Deleted.
(WebCore::isControlCharacter): Deleted.
(WebCore::trimToNextSeparator): Deleted.
(WebCore::parseCacheHeader): Deleted.
* platform/network/ResourceResponseBase.h:

Source/WebKit2:

rdar://problem/19714040

Reviewed by Chris Dumez.

Better support for https://tools.ietf.org/html/rfc7234#section-5.2.1

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::canUse):

    Consider requests with Cache-control: no-cache and max-age=0 expired.

(WebKit::NetworkCache::canStore):

    Don't store requests with Cache-control: no-store.

(WebKit::NetworkCache::Cache::store):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheStatisticsCocoa.mm:
(WebKit::NetworkCache::storeDecisionToDiagnosticKey):

LayoutTests:

Reviewed by Chris Dumez.

* http/tests/cache/disk-cache/disk-cache-request-headers-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-request-headers.html: Added.

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

4 years agoObjects with numeric properties intermittently get a phantom 'length' property
msaboff@apple.com [Fri, 27 Mar 2015 14:28:34 +0000 (14:28 +0000)]
Objects with numeric properties intermittently get a phantom 'length' property
https://bugs.webkit.org/show_bug.cgi?id=142792

Reviewed by Csaba Osztrogonác.

Source/JavaScriptCore:

Fixed a > (greater than) that should be a >> (right shift) in the code that disassembles
test and branch instructions.  This function is used for linking tbz/tbnz branches between
two seperately JIT'ed sections of code.  Sometime we'd create a bogus tbz instruction in
the failure case checks in the GetById array length stub created for "obj.length" access.
If the failure case code address was at a negative offset from the stub, we'd look for bit 1
being set when we should have been looking for bit 0.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::disassembleTestAndBranchImmediate):

LayoutTests:

New regression test.

* js/regress-142792-expected.txt: Added.
* js/regress-142792.html: Added.
* js/script-tests/regress-142792.js: Added.
(isArrayLike):
(filter):

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

4 years agoInsert exception check around toPropertyKey call
utatane.tea@gmail.com [Fri, 27 Mar 2015 11:08:49 +0000 (11:08 +0000)]
Insert exception check around toPropertyKey call
https://bugs.webkit.org/show_bug.cgi?id=142922

Reviewed by Geoffrey Garen.

In some places, exception check is missing after/before toPropertyKey.
However, since it calls toString, it's observable to users,

Missing exception checks in Object.prototype methods can be
observed since it would be overridden with toObject(null/undefined) errors.
We inserted exception checks after toPropertyKey.

Missing exception checks in GetById related code can be
observed since it would be overridden with toObject(null/undefined) errors.
In this case, we need to insert exception checks before/after toPropertyKey
since RequireObjectCoercible followed by toPropertyKey can cause exceptions.

JSValue::get checks null/undefined and raise an exception if |this| is null or undefined.
However, we need to check whether the baseValue is object coercible before executing JSValue::toPropertyKey.
According to the spec, we first perform RequireObjectCoercible and check the exception.
And second, we perform ToPropertyKey and check the exception.
Since JSValue::toPropertyKey can cause toString call, this is observable to users.
For example, if the target is not object coercible,
ToPropertyKey should not be executed, and toString should not be executed by ToPropertyKey.
So the order of observable actions (RequireObjectCoercible and ToPropertyKey) should be correct to the spec.

This patch introduces JSValue::requireObjectCoercible and use it because of the following 2 reasons.

1. Using toObject instead of requireObjectCoercible produces unnecessary wrapper object.

toObject converts primitive types into wrapper objects.
But it is not efficient since wrapper objects are not necessary
if we look up methods from primitive values's prototype. (using synthesizePrototype is better).

2. Using the result of toObject is not correct to the spec.

To align to the spec correctly, we cannot use JSObject::get
by using the wrapper object produced by the toObject suggested in (1).
If we use JSObject that is converted by toObject, getter will be called by using this JSObject as |this|.
It is not correct since getter should be called with the original |this| value that may be primitive types.

So in this patch, we use JSValue::requireObjectCoercible
to check the target is object coercible and raise an error if it's not.

* dfg/DFGOperations.cpp:
* jit/JITOperations.cpp:
(JSC::getByVal):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::getByVal):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::requireObjectCoercible):
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncHasOwnProperty):
(JSC::objectProtoFuncDefineGetter):
(JSC::objectProtoFuncDefineSetter):
(JSC::objectProtoFuncLookupGetter):
(JSC::objectProtoFuncLookupSetter):
(JSC::objectProtoFuncPropertyIsEnumerable):
* tests/stress/exception-in-to-property-key-should-be-handled-early-in-object-methods.js: Added.
(shouldThrow):
(if):
* tests/stress/exception-in-to-property-key-should-be-handled-early.js: Added.
(shouldThrow):
(.):

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

4 years ago[GStreamer] share GL context in pipeline, part 2
vjaquez@igalia.com [Fri, 27 Mar 2015 10:31:00 +0000 (10:31 +0000)]
[GStreamer] share GL context in pipeline, part 2
https://bugs.webkit.org/show_bug.cgi?id=143049

Reviewed by Carlos Garcia Campos.

.:

* Source/cmake/OptionsGTK.cmake: USE_GSTREAMER_GL is set only if
OpenGL/ES2 is found and GLX/EGL is found too.

Source/WebCore:

This patch, instead of cluttering the GstGL attributes creation in
::handleSyncMessage(), creates a new method ::ensureGstGLContext(),
where those attributes are defined. This method is guarded by
USE(GSTREAMER_GL)

::handlSyncMessage() shall return nothing, according to GStreamer
documentation, not a boolean.

The GstGL attributes are now GRefPtr<> to avoid memory leaks.

The GstGLAPI and GstGLPlatform are now set given by the pre-processor
directives, and the code in ::ensureGstGLContext() is simpler.

No new tests because this is platform specific and it depends in the
run-time availability and configurations of GstGL elements.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
Don't initialise the GstGL attributes since are GRefPtr<>
(WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Changed the
signature to use void instead of gboolean.
(WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): New method.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:

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

4 years agoWeb Inspector: Convert more misc View classes to ES6
timothy@apple.com [Fri, 27 Mar 2015 07:26:35 +0000 (07:26 +0000)]
Web Inspector: Convert more misc View classes to ES6
https://bugs.webkit.org/show_bug.cgi?id=143128

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CompletionSuggestionsView.js:
* UserInterface/Views/ComputedStyleDetailsPanel.js:
* UserInterface/Views/DashboardContainerView.js:
* UserInterface/Views/DashboardView.js:
* UserInterface/Views/DebuggerDashboardView.js:
* UserInterface/Views/DefaultDashboardView.js:
* UserInterface/Views/FilterBarButton.js:
* UserInterface/Views/MetricsStyleDetailsPanel.js:
* UserInterface/Views/ObjectPreviewView.js:
* UserInterface/Views/ObjectTreeView.js:
* UserInterface/Views/QuickConsole.js:
* UserInterface/Views/ReplayDashboardView.js:
* UserInterface/Views/RulesStyleDetailsPanel.js:
* UserInterface/Views/StyleDetailsPanel.js:
Converted to ES6 classes.

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

4 years agoWeb Inspector: Convert TextEditor classes to ES6
timothy@apple.com [Fri, 27 Mar 2015 07:26:27 +0000 (07:26 +0000)]
Web Inspector: Convert TextEditor classes to ES6
https://bugs.webkit.org/show_bug.cgi?id=143127

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CSSStyleDeclarationTextEditor.js:
Removed a comment about const, we can't use it in strict mode / classes.

* UserInterface/Views/SourceCodeTextEditor.js:
* UserInterface/Views/TextEditor.js:
Converted to ES6 classes.

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

4 years agoWeb Inspector: clicking on console record while REPL is focused does not select a...
nvasilyev@apple.com [Fri, 27 Mar 2015 06:48:10 +0000 (06:48 +0000)]
Web Inspector: clicking on console record while REPL is focused does not select a new record
https://bugs.webkit.org/show_bug.cgi?id=142171

Reviewed by Timothy Hatcher.

* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView.prototype._mousedown):

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

4 years agoOptimized Fullscreen fails to cleanup because of no longer necessary release of m_pla...
commit-queue@webkit.org [Fri, 27 Mar 2015 06:36:48 +0000 (06:36 +0000)]
Optimized Fullscreen fails to cleanup because of no longer necessary release of m_playerController in exitFullscreen()
https://bugs.webkit.org/show_bug.cgi?id=143120

Patch by Jeremy Jones <jeremyj@apple.com> on 2015-03-26
Reviewed by Eric Carlson.

We used to release m_playerController in WebVideoFullscreenInterfaceAVKit::exitFullscreen() in order to make sure
media state was reset. This is no longer necessary as we now have a way the model can explicitly request resetting the
media state via resetMediaState(). m_playerController is already released in
WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal(). Releasing it prematurely can actually prevent the exit
fullscreen process from completing successfully.

* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::exitFullscreen):

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

4 years agoInline continuation code should not take anonymous containing wrapper granted.
zalan@apple.com [Fri, 27 Mar 2015 04:41:46 +0000 (04:41 +0000)]
Inline continuation code should not take anonymous containing wrapper granted.
https://bugs.webkit.org/show_bug.cgi?id=133312

Reviewed by Dave Hyatt.

It's wrong to assume that when RenderInline is part of an inline continuation, its containing block
is an anonymous wrapper and its sibling might be a block level renderer.
When the inline continuation is no longer needed, for example when the block level renderer that initiated the continuation
is detached from the render tree, the inline renderes still continue to form continuation.(however they no longer require
anonymous wrappers)

Source/WebCore:

Test: fast/inline/crash-when-position-property-is-changed-and-no-longer-in-continuation.html

* rendering/RenderInline.cpp:
(WebCore::updateStyleOfAnonymousBlockContinuations):
(WebCore::RenderInline::styleDidChange):

LayoutTests:

* fast/inline/crash-when-position-property-is-changed-and-no-longer-in-continuation-expected.txt: Added.
* fast/inline/crash-when-position-property-is-changed-and-no-longer-in-continuation.html: Added.

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

4 years agoWebContent Crash when instantiating class with Type Profiling enabled
joepeck@webkit.org [Fri, 27 Mar 2015 02:55:57 +0000 (02:55 +0000)]
WebContent Crash when instantiating class with Type Profiling enabled
https://bugs.webkit.org/show_bug.cgi?id=143037

Reviewed by Ryosuke Niwa.

* bytecompiler/BytecodeGenerator.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitMoveEmptyValue):
We cannot profile the type of an uninitialized empty JSValue.
Nor do we expect this to be necessary, since it is effectively
an unseen undefined value. So add a way to put the empty value
without profiling.

(JSC::BytecodeGenerator::emitMove):
Add an assert to try to catch this issue early on, and force
callers to explicitly use emitMoveEmptyValue instead.

* tests/typeProfiler/classes.js: Added.
(wrapper.Base):
(wrapper.Derived):
(wrapper):
Add test coverage both for this case and classes in general.

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

4 years agoiOS file upload panel menu items need icons
jhoneycutt@apple.com [Fri, 27 Mar 2015 02:24:55 +0000 (02:24 +0000)]
iOS file upload panel menu items need icons
<https://bugs.webkit.org/show_bug.cgi?id=143042>
<rdar://problem/20178678>

Reviewed by Andy Estes.

* Platform/spi/ios/UIKitSPI.h:
Declare new SPI methods _UIImageGetWebKitTakePhotoOrVideoIcon and
_UIImageGetWebKitPhotoLibraryIcon().

* UIProcess/ios/forms/WKFileUploadPanel.mm:
(photoLibraryIcon):
(cameraIcon):
If UIKit SPI exists, use it. Otherwise, return nil.

(-[WKFileUploadPanel _showDocumentPickerMenu]):
Use icons.

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

4 years ago[GTK] Web Inspector: New Images for Console Types
agomez@igalia.com [Fri, 27 Mar 2015 01:53:07 +0000 (01:53 +0000)]
[GTK] Web Inspector: New Images for Console Types
https://bugs.webkit.org/show_bug.cgi?id=142301

Reviewed by Joseph Pecoraro.

Add more free icons and for the Web Inspector in GTK+.

* UserInterface/Images/gtk/Eye.svg: Added.
* UserInterface/Images/gtk/Frames.png: Added.
* UserInterface/Images/gtk/Frames@2x.png: Added.
* UserInterface/Images/gtk/FramesLarge.png: Added.
* UserInterface/Images/gtk/FramesLarge@2x.png: Added.
* UserInterface/Images/gtk/Reload.svg:
* UserInterface/Images/gtk/ReloadFull.svg: Added.
* UserInterface/Images/gtk/TypeBoolean.svg: Added.
* UserInterface/Images/gtk/TypeNull.svg: Added.
* UserInterface/Images/gtk/TypeNumber.svg: Added.
* UserInterface/Images/gtk/TypeObject.svg: Added.
* UserInterface/Images/gtk/TypeRegex.svg: Added.
* UserInterface/Images/gtk/TypeString.svg: Added.
* UserInterface/Images/gtk/TypeSymbol.svg: Added.
* UserInterface/Images/gtk/TypeUndefined.svg: Added.

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

4 years agoWeb Inspector: ES6: Provide a better view for Classes in the console
joepeck@webkit.org [Fri, 27 Mar 2015 01:42:37 +0000 (01:42 +0000)]
Web Inspector: ES6: Provide a better view for Classes in the console
https://bugs.webkit.org/show_bug.cgi?id=142999

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/Runtime.json:
Provide a new `subtype` enum "class". This is a subtype of `type`
"function", all other subtypes are subtypes of `object` types.
For a class, the frontend will immediately want to get the prototype
to enumerate its methods, so include the `classPrototype`.

* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::subtype):
Denote class construction functions as "class" subtypes.

* inspector/InjectedScriptSource.js:
Handling for the new "class" type.

* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedFunctionExecutable::isClassConstructorFunction):
* runtime/Executable.h:
(JSC::FunctionExecutable::isClassConstructorFunction):
* runtime/JSFunction.h:
* runtime/JSFunctionInlines.h:
(JSC::JSFunction::isClassConstructorFunction):
Check if this function is a class constructor function. That information
is on the UnlinkedFunctionExecutable, so plumb it through to JSFunction.

Source/WebInspectorUI:

* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject):
(WebInspector.RemoteObject.fromPrimitiveValue):
(WebInspector.RemoteObject.fromPayload):
(WebInspector.RemoteObject.prototype.get classPrototype):
(WebInspector.RemoteObject.prototype.isClass):
Update our RemoteObject model object for the new subtype
and its unique properties.

* UserInterface/Views/FormattedValue.js:
(WebInspector.FormattedValue.createElementForTypesAndValue):
(WebInspector.FormattedValue.createObjectTreeOrFormattedValueForRemoteObject):
Better handle "class", as it is a new function subtype.

* UserInterface/Views/LegacyConsoleMessageImpl.js:
(WebInspector.LegacyConsoleMessageImpl):
(WebInspector.LegacyConsoleMessageImpl.prototype._formatParameterAsObject):
Format a "class" with ObjectTreeView.

* UserInterface/Views/ObjectTreeArrayIndexTreeElement.js:
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
* UserInterface/Views/ObjectTreePropertyTreeElement.css:
(.object-tree-property .getter.disabled):
(.object-tree-property .getter:not(.disabled):hover):
(.object-tree-property .getter:hover): Deleted.
* UserInterface/Views/ObjectTreePropertyTreeElement.js:
In ClassAPI mode, you cannot invoke a getter since we don't have
an instance to invoke it on. So disable interactivity with getters.

* UserInterface/Views/ObjectTreeView.js:
(WebInspector.ObjectTreeView):
Update the modes to include an API mode for instances and classes.

(WebInspector.ObjectTreeView.defaultModeForObject):
* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype._showPopoverForObject):
Simplify ObjectTree construction to automatically determine mode based
on the RemoteObject that was provided.

* Localizations/en.lproj/localizedStrings.js:
"Getter" tooltip.

LayoutTests:

* inspector/model/remote-object-expected.txt:
* inspector/model/remote-object.html:
Update the test to include coverage of the new "class" subtype of "function".

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

4 years agoREGRESSION (r181358 and r181507): Lots of sites think that we support touch events...
timothy_horton@apple.com [Fri, 27 Mar 2015 01:02:38 +0000 (01:02 +0000)]
REGRESSION (r181358 and r181507): Lots of sites think that we support touch events on OS X
https://bugs.webkit.org/show_bug.cgi?id=142888
<rdar://problem/20227304>

Reviewed by Beth Dakin.

* dom/Document.idl:
* dom/Element.idl:
* html/HTMLBodyElement.idl:
* html/HTMLFrameSetElement.idl:
* page/DOMWindow.idl:
Re-conditionalize a lot of event listeners; sites test ("ontouchstart" in window), which
is not covered by NotEnumerable, and so r181358 and r181507 broke a bunch of sites
(apple.com, blaze.com, anything using nicescroll.js, etc.) by causing them to think
that (Mac) Safari was touch-enabled.

* fast/dom/event-handler-attributes-expected.txt:
* fast/dom/event-handler-attributes.html:
* fast/events/event-attribute-expected.txt:
* platform/win/fast/events/event-attribute-expected.txt:
Revert some changes to these tests and their results.

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

4 years agoOS X build fix after r182037.
enrica@apple.com [Fri, 27 Mar 2015 00:13:59 +0000 (00:13 +0000)]
OS X build fix after r182037.

Unreviewed.

* UIProcess/API/mac/WKView.mm:
(-[WKView _addFontPanelObserver]):
(-[WKView removeWindowObservers]):
(-[WKView observeValueForKeyPath:ofObject:change:context:]):

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

4 years agoiOS build fix after r182037.
enrica@apple.com [Fri, 27 Mar 2015 00:08:26 +0000 (00:08 +0000)]
iOS build fix after r182037.

Unreviewed.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setEditable:]):

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

4 years agoFunction.prototype.toString should not decompile the AST
ggaren@apple.com [Thu, 26 Mar 2015 23:41:16 +0000 (23:41 +0000)]
Function.prototype.toString should not decompile the AST
https://bugs.webkit.org/show_bug.cgi?id=142853

Reviewed by Darin Adler.

Following up on Darin's review comments.

* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):

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

4 years agoWeb Inspector: Convert TreeElement classes to ES6
timothy@apple.com [Thu, 26 Mar 2015 23:38:12 +0000 (23:38 +0000)]
Web Inspector: Convert TreeElement classes to ES6
https://bugs.webkit.org/show_bug.cgi?id=143111

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ApplicationCacheFrameTreeElement.js:
* UserInterface/Views/ApplicationCacheManifestTreeElement.js:
* UserInterface/Views/BreakpointTreeElement.js:
* UserInterface/Views/CallFrameTreeElement.js:
* UserInterface/Views/ContentFlowTreeElement.js:
* UserInterface/Views/CookieStorageTreeElement.js:
* UserInterface/Views/DOMStorageTreeElement.js:
* UserInterface/Views/DOMTreeElement.js:
* UserInterface/Views/DOMTreeOutline.js:
* UserInterface/Views/DatabaseHostTreeElement.js:
* UserInterface/Views/DatabaseTableTreeElement.js:
* UserInterface/Views/DatabaseTreeElement.js:
* UserInterface/Views/FolderTreeElement.js:
* UserInterface/Views/FolderizedTreeElement.js:
* UserInterface/Views/FrameTreeElement.js:
* UserInterface/Views/GeneralTreeElement.js:
* UserInterface/Views/IndexedDatabaseHostTreeElement.js:
* UserInterface/Views/IndexedDatabaseObjectStoreIndexTreeElement.js:
* UserInterface/Views/IndexedDatabaseObjectStoreTreeElement.js:
* UserInterface/Views/IndexedDatabaseTreeElement.js:
* UserInterface/Views/LegacyConsoleMessageImpl.js:
* UserInterface/Views/LogTreeElement.js:
* UserInterface/Views/NavigationSidebarPanel.js:
* UserInterface/Views/ObjectTreeArrayIndexTreeElement.js:
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
* UserInterface/Views/ObjectTreeMapEntryTreeElement.js:
* UserInterface/Views/ObjectTreePropertyTreeElement.js:
* UserInterface/Views/ObjectTreeSetIndexTreeElement.js:
* UserInterface/Views/ObjectTreeView.js:
* UserInterface/Views/ProfileNodeTreeElement.js:
* UserInterface/Views/PropertiesSection.js:
* UserInterface/Views/ResourceTreeElement.js:
* UserInterface/Views/ScriptTreeElement.js:
* UserInterface/Views/SearchResultTreeElement.js:
* UserInterface/Views/SourceCodeTimelineTreeElement.js:
* UserInterface/Views/SourceCodeTreeElement.js:
* UserInterface/Views/SourceMapResourceTreeElement.js:
* UserInterface/Views/StorageTreeElement.js:
* UserInterface/Views/TimelineDataGrid.js:
* UserInterface/Views/TimelineRecordTreeElement.js:
* UserInterface/Views/TreeElementStatusButton.js:
* UserInterface/Views/TreeOutline.js:
* UserInterface/Views/TreeOutlineDataGridSynchronizer.js:
* UserInterface/Views/TypePropertiesSection.js:
Converted to ES6 classes where possible.

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

4 years agoWeb Inspector: Convert sidebar classes to ES6
timothy@apple.com [Thu, 26 Mar 2015 23:37:55 +0000 (23:37 +0000)]
Web Inspector: Convert sidebar classes to ES6
https://bugs.webkit.org/show_bug.cgi?id=143108

Reviewed by Joseph Pecoraro.

* UserInterface/Models/KeyboardShortcut.js:
(WebInspector.KeyboardShortcut._handleKeyDown): Continue if callback is null.
(WebInspector.KeyboardShortcut.prototype.set callback): Added.

* UserInterface/Views/ApplicationCacheDetailsSidebarPanel.js:
* UserInterface/Views/CSSStyleDetailsSidebarPanel.js:
* UserInterface/Views/DOMDetailsSidebarPanel.js:
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
* UserInterface/Views/DebuggerSidebarPanel.js:
* UserInterface/Views/DetailsSidebarPanel.js:
* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
* UserInterface/Views/NavigationSidebarPanel.js:
* UserInterface/Views/ProbeDetailsSidebarPanel.js:
* UserInterface/Views/ResourceDetailsSidebarPanel.js:
* UserInterface/Views/ResourceSidebarPanel.js:
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
* UserInterface/Views/Sidebar.js:
* UserInterface/Views/SidebarPanel.js:
* UserInterface/Views/TimelineSidebarPanel.js:
Converted to ES6 classes.

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

4 years agoWeb Inspector: Convert some View classes to ES6 classes
timothy@apple.com [Thu, 26 Mar 2015 23:37:45 +0000 (23:37 +0000)]
Web Inspector: Convert some View classes to ES6 classes
https://bugs.webkit.org/show_bug.cgi?id=143107

Reviewed by Joseph Pecoraro.

* UserInterface/Protocol/InspectorBackend.js:
* UserInterface/Protocol/InspectorFrontendAPI.js:
(InspectorFrontendAPI.contextMenuItemSelected): Updated to the right function path.
* UserInterface/Views/BoxModelDetailsSectionRow.js:
* UserInterface/Views/BreakpointActionView.js:
* UserInterface/Views/CodeMirrorAdditions.js:
* UserInterface/Views/ColorPicker.js:
* UserInterface/Views/ColorWheel.js:
* UserInterface/Views/ContextMenu.js:
* UserInterface/Views/DOMTreeElementPathComponent.js:
* UserInterface/Views/DetailsSection.js:
* UserInterface/Views/DetailsSectionDataGridRow.js:
* UserInterface/Views/DetailsSectionGroup.js:
* UserInterface/Views/DetailsSectionPropertiesRow.js:
* UserInterface/Views/DetailsSectionRow.js:
* UserInterface/Views/DetailsSectionSimpleRow.js:
* UserInterface/Views/DetailsSectionTextRow.js:
* UserInterface/Views/EditingSupport.js:
* UserInterface/Views/EventListenerSection.js:
* UserInterface/Views/EventListenerSectionGroup.js:
* UserInterface/Views/FilterBar.js:
* UserInterface/Views/FindBanner.js:
* UserInterface/Views/GeneralTreeElementPathComponent.js:
* UserInterface/Views/GoToLineDialog.js:
* UserInterface/Views/GradientSlider.js:
* UserInterface/Views/HierarchicalPathComponent.js:
* UserInterface/Views/HierarchicalPathNavigationItem.js:
* UserInterface/Views/HoverMenu.js:
* UserInterface/Views/Popover.js:
* UserInterface/Views/ProbeSetDetailsSection.js:
* UserInterface/Views/ResourceTimelineDataGridNodePathComponent.js:
* UserInterface/Views/SearchBar.js:
* UserInterface/Views/Slider.js:
Converted to ES6 ckasses.

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

4 years agoWeb Inspector: Convert Base and Protocol files to ES6 classes
timothy@apple.com [Thu, 26 Mar 2015 23:37:30 +0000 (23:37 +0000)]
Web Inspector: Convert Base and Protocol files to ES6 classes
https://bugs.webkit.org/show_bug.cgi?id=143106

Reviewed by Joseph Pecoraro.

* UserInterface/Base/EventListener.js:
* UserInterface/Base/EventListenerSet.js:
* UserInterface/Protocol/ApplicationCacheObserver.js:
* UserInterface/Protocol/CSSObserver.js:
* UserInterface/Protocol/ConsoleObserver.js:
* UserInterface/Protocol/DOMObserver.js:
* UserInterface/Protocol/DOMStorageObserver.js:
* UserInterface/Protocol/DatabaseObserver.js:
* UserInterface/Protocol/DebuggerObserver.js:
* UserInterface/Protocol/InspectorBackend.js:
* UserInterface/Protocol/InspectorObserver.js:
* UserInterface/Protocol/LayerTreeObserver.js:
* UserInterface/Protocol/MessageDispatcher.js:
* UserInterface/Protocol/NetworkObserver.js:
* UserInterface/Protocol/PageObserver.js:
* UserInterface/Protocol/RemoteObject.js:
* UserInterface/Protocol/ReplayObserver.js:
* UserInterface/Protocol/RuntimeObserver.js:
* UserInterface/Protocol/TimelineObserver.js:
Converted to ES6 classes where possible.

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

4 years ago"lineNo" does not match WebKit coding style guidelines
ggaren@apple.com [Thu, 26 Mar 2015 23:35:47 +0000 (23:35 +0000)]
"lineNo" does not match WebKit coding style guidelines
https://bugs.webkit.org/show_bug.cgi?id=143119

Reviewed by Michael Saboff.

We can afford to use whole words.

Source/JavaScriptCore:

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::lineNumberForBytecodeOffset):
(JSC::CodeBlock::expressionRangeForBytecodeOffset):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedFunctionExecutable::link):
(JSC::UnlinkedFunctionExecutable::fromGlobalCode):
* bytecode/UnlinkedCodeBlock.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::WhileNode::emitBytecode):
* debugger/Debugger.cpp:
(JSC::Debugger::toggleBreakpoint):
* interpreter/Interpreter.cpp:
(JSC::StackFrame::computeLineAndColumn):
(JSC::GetStackTraceFunctor::operator()):
(JSC::Interpreter::execute):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::computeLineAndColumn):
* parser/Nodes.h:
(JSC::Node::firstLine):
(JSC::Node::lineNo): Deleted.
(JSC::StatementNode::firstLine): Deleted.
* parser/ParserError.h:
(JSC::ParserError::toErrorObject):
* profiler/LegacyProfiler.cpp:
(JSC::createCallIdentifierFromFunctionImp):
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
* runtime/Executable.cpp:
(JSC::ScriptExecutable::ScriptExecutable):
(JSC::ScriptExecutable::newCodeBlockFor):
(JSC::FunctionExecutable::fromGlobalCode):
* runtime/Executable.h:
(JSC::ScriptExecutable::firstLine):
(JSC::ScriptExecutable::setOverrideLineNumber):
(JSC::ScriptExecutable::hasOverrideLineNumber):
(JSC::ScriptExecutable::overrideLineNumber):
(JSC::ScriptExecutable::lineNo): Deleted.
(JSC::ScriptExecutable::setOverrideLineNo): Deleted.
(JSC::ScriptExecutable::hasOverrideLineNo): Deleted.
(JSC::ScriptExecutable::overrideLineNo): Deleted.
* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
* runtime/FunctionConstructor.h:
* tools/CodeProfile.cpp:
(JSC::CodeProfile::report):
* tools/CodeProfile.h:
(JSC::CodeProfile::CodeProfile):

Source/WebCore:

* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction):
* bindings/js/JSMainThreadExecStateInstrumentation.h:
(WebCore::JSMainThreadExecState::instrumentFunctionCall):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):

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

4 years agoREGRESSION(r1807689): Slower startup time for WKWebView.
enrica@apple.com [Thu, 26 Mar 2015 23:24:02 +0000 (23:24 +0000)]
REGRESSION(r1807689): Slower startup time for WKWebView.
https://bugs.webkit.org/show_bug.cgi?id=143115
rdar://problem/20233711

Reviewed by Anders Carlsson.

In http://trac.webkit.org/changeset/180768 we added an observer to
track visibility of the NSFontPanel to ensure we could fetch the font
information for the current selection when the panel first becomes visible.
It turns out that adding the observer requires the shared font panel
object to be created.
That is apparently a very expensive operation that is regressing
the initialization time for the WKWebView.
We should initialize the NSFontPanel lazily, only when we make the entire
view editable.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setEditable:]):
* UIProcess/API/mac/WKView.mm:
(-[WKView addWindowObserversForWindow:]):
(-[WKView _addFontPanelObserver]):
(-[WKView removeWindowObservers]):
(-[WKView observeValueForKeyPath:ofObject:change:context:]):
* UIProcess/API/mac/WKViewInternal.h:

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

4 years agoApply blur effect to media control background.
roger_fong@apple.com [Thu, 26 Mar 2015 23:23:57 +0000 (23:23 +0000)]
Apply blur effect to media control background.
https://bugs.webkit.org/show_bug.cgi?id=143116.
<rdar://problem/20316964>.

Reviewed by Brent Fulgham.

There are still a few issues, like the borders of the controls being blurred with black,
and the volume slider background not showing the blur effect. Will fix those separately.
Add CSS for new divs to create blur effect using back drop filters and blend modes.
* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-panel):
(audio::-webkit-media-controls-panel-tint):
(audio::-webkit-media-controls-panel-background):
(audio::-webkit-media-controls-panel .volume-box):
(audio::-webkit-media-controls-volume-slider-container-background):
(audio::-webkit-media-controls-volume-slider-container-tint):
(audio::-webkit-media-controls-toggle-closed-captions-button): Adjust fill.
(audio::-webkit-media-controls-fullscreen-button): Adjust fill.
(audio::-webkit-media-controls-fullscreen-button.exit): Adjust fill.
(video:-webkit-full-screen::-webkit-media-controls-panel):
(audio:-webkit-full-screen::-webkit-media-controls-panel-tint):
(audio:-webkit-full-screen::-webkit-media-controls-panel-background):
(video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
(video:-webkit-full-screen::-webkit-media-controls-play-button):
(video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
(video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
(video:-webkit-full-screen::-webkit-media-controls-timeline-container):
(video:-webkit-full-screen::-webkit-media-controls-status-display):
(audio::-webkit-media-controls-panel .volume-box:active): Deleted.
* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.createControls):
(Controller.prototype.configureInlineControls): Add new divs for blurred background effect.
(Controller.prototype.configureFullScreenControls): Ditto.
(Controller.prototype.handlePanelMouseDown): The tint div is now in front.
(Controller.prototype.drawTimelineBackground): Adjust colors to make border look better with new background.
(Controller.prototype.drawVolumeBackground): Ditto.

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

4 years agoAssertion firing in JavaScriptCore/parser/parser.h for statesman.com site
ggaren@apple.com [Thu, 26 Mar 2015 23:12:39 +0000 (23:12 +0000)]
Assertion firing in JavaScriptCore/parser/parser.h for statesman.com site
https://bugs.webkit.org/show_bug.cgi?id=142974

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

This patch does two things:

(1) Restore JavaScriptCore's sanitization of line and column numbers to
one-based values.

We need this because WebCore sometimes provides huge negative column
numbers.

(2) Solve the attribute event listener line numbering problem a different
way: Rather than offseting all line numbers by -1 in an attribute event
listener in order to arrange for a custom result, instead use an explicit
feature for saying "all errors in this code should map to this line number".

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedFunctionExecutable::link):
(JSC::UnlinkedFunctionExecutable::fromGlobalCode):
* bytecode/UnlinkedCodeBlock.h:
* interpreter/Interpreter.cpp:
(JSC::StackFrame::computeLineAndColumn):
(JSC::GetStackTraceFunctor::operator()):
* interpreter/Interpreter.h:
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::computeLineAndColumn):
* parser/ParserError.h:
(JSC::ParserError::toErrorObject): Plumb through an override line number.
When a function has an override line number, all syntax and runtime
errors in the function will map to it. This is useful for attribute event
listeners.

* parser/SourceCode.h:
(JSC::SourceCode::SourceCode): Restore the old sanitization of line and
column numbers to one-based integers. It was kind of a hack to remove this.

* runtime/Executable.cpp:
(JSC::ScriptExecutable::ScriptExecutable):
(JSC::FunctionExecutable::fromGlobalCode):
* runtime/Executable.h:
(JSC::ScriptExecutable::setOverrideLineNo):
(JSC::ScriptExecutable::hasOverrideLineNo):
(JSC::ScriptExecutable::overrideLineNo):
* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
* runtime/FunctionConstructor.h: Plumb through an override line number.

Source/WebCore:

* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::initializeJSFunction): Use the new override
line number API to guarantee that errors will map to the .html file locations
that we like.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::eventHandlerPosition): Added a FIXME to cover
some cases where our line and column numbers are still nonsense.

LayoutTests:

No test covering this ASSERT because I couldn't design a way to reproduce
it after trying for a few hours. Simply loading the original ASSERTing
content from disk is not enough to reproduce this bug.

* fast/profiler/dead-time-expected.txt:
* fast/profiler/inline-event-handler-expected.txt:
* fast/profiler/stop-profiling-after-setTimeout-expected.txt: These are
progressions, where we used to get the line number wrong.

* fast/dom/attribute-event-listener-errors-expected.txt: Added.
* fast/dom/attribute-event-listener-errors.html: Added. This test covers
a subtle way in which the new mechanism for attribute event listener
line numbers is more accurate than the old one.

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

4 years agoRelevant repainted objects callback is inaccurate and inconsistent for PDF
bdakin@apple.com [Thu, 26 Mar 2015 23:06:27 +0000 (23:06 +0000)]
Relevant repainted objects callback is inaccurate and inconsistent for PDF
documents
https://bugs.webkit.org/show_bug.cgi?id=143118
-and corresponding-
rdar://problem/13371582

Reviewed by Tim Horton.

Investigating this bug resulted in finding two things that should change for the
relevant repainted objects heuristic. First, we should not count any objects
painted while updating control tints. And secondly, we should not use it at all
for plugin documents. In other documents, we count the plugin area as “painted”
when we get to paint whether or not the plugin has actually loaded. This is
intentional because it allows us to account for chunks of the page that will be
filled in by possibly slow-loading ads. However, if the plugin is the whole
document, then the heuristic just doesn’t make any sense and it leads to
inconsistent behavior at different window sizes. So we’ll only count plugins when
the document is not a plugin document.

Don’t count objects during this paint!
* page/FrameView.cpp:
(WebCore::FrameView::updateControlTints):
* page/Page.h:
(WebCore::Page::setIsCountingRelevantRepaintedObjects):

Make sure the document is not a plugin document.
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::paint):

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

4 years agoProgress towards CMake on Mac.
commit-queue@webkit.org [Thu, 26 Mar 2015 22:53:46 +0000 (22:53 +0000)]
Progress towards CMake on Mac.
https://bugs.webkit.org/show_bug.cgi?id=143112

Patch by Alex Christensen <achristensen@webkit.org> on 2015-03-26
Reviewed by Chris Dumez.

.:

* Source/cmake/OptionsMac.cmake:

Source/WebCore:

* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* platform/graphics/mac/IconMac.mm:

Source/WebKit:

* PlatformMac.cmake:

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKit2:

* CMakeLists.txt:
* PlatformMac.cmake:
* UIProcess/Cocoa/WebPageProxyCocoa.mm:

Source/WTF:

* wtf/PlatformMac.cmake:

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

4 years ago[WK2][Cocoa] Add private API to override the network disk cache size
cdumez@apple.com [Thu, 26 Mar 2015 22:52:14 +0000 (22:52 +0000)]
[WK2][Cocoa] Add private API to override the network disk cache size
https://bugs.webkit.org/show_bug.cgi?id=143113
<rdar://problem/20315669>

Reviewed by Antti Koivisto.

Add private API to let the client override the network disk cache size.
By default, the network disk cache is automatically determined based on
the CacheModel and the available disk space. However, for testing
purposes, it can be used for the client-side to be able to override
the disk cache size.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::setMaximumSize):
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformSetCacheModel):
* Shared/Network/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* Shared/Network/NetworkProcessCreationParameters.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
* UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
(-[_WKProcessPoolConfiguration diskCacheSizeOverride]):
(-[_WKProcessPoolConfiguration setDiskCacheSizeOverride:]):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::WebProcessPool):
(WebKit::WebProcessPool::ensureNetworkProcess):
* UIProcess/WebProcessPool.h:

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

4 years agoLayout test results URL loads in WK1 but not WK2 minibrowser
ap@apple.com [Thu, 26 Mar 2015 22:35:30 +0000 (22:35 +0000)]
Layout test results URL loads in WK1 but not WK2 minibrowser
https://bugs.webkit.org/show_bug.cgi?id=143117

Reviewed by Tim Horton.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController fetch:]): Fix this, international domain names, and
everything.
(-[WK2BrowserWindowController updateTextFieldFromURL:]): Ditto.

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

4 years ago[iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
jer.noble@apple.com [Thu, 26 Mar 2015 22:31:46 +0000 (22:31 +0000)]
[iOS] Accessibility crashing because MediaPlayer is laying out UI off the main thread
https://bugs.webkit.org/show_bug.cgi?id=142970

Reviewed by Eric Carlson.

isMainThread() will (ironically) return true if called from the web thread. Rather than dispatch
synchronously to the main thread to allocate the _volumeView, dispatch asynchronously and handle
the case where the MPVolumeView has not yet been created.

* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper allocateVolumeView]): Dispatch to the main thread to allocate. Move notification
    registration to -setVolumeView:.
(-[WebMediaSessionHelper setVolumeView:]): Added. Register/Unregister for route availablitiy notifications.
(-[WebMediaSessionHelper hasWirelessTargetsAvailable]): Handle the possibility of a nil _volumeView.

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

4 years ago[Darwin] Boost the web process QoS level while handling a synchronous IPC message.
akling@apple.com [Thu, 26 Mar 2015 22:20:45 +0000 (22:20 +0000)]
[Darwin] Boost the web process QoS level while handling a synchronous IPC message.
<https://webkit.org/b/142988>
<rdar://problem/20264346>

Reviewed by Antti Koivisto and Anders Carlsson.

Add a mechanism for IPC::Connection to boost the main thread for the duration
of processing a synchronous message.

This fixes an issue where the UI process would block on a synchronous request
to the web process that was being carried out at a lower QoS level.

* Platform/IPC/Connection.cpp:
(IPC::Connection::Connection): Save the main thread's pthread_t while we have
a chance to retreive it.

(IPC::Connection::processIncomingMessage): Optionally boost the main thread when
processing an incoming message with the IsSyncMessage flag set.

* Platform/IPC/Connection.h:
(IPC::Connection::setShouldBoostMainThreadOnSyncMessage): Added. When this mode is
enabled, Connection will give a temporary QoS override to the main thread when
receiving a synchronous message. Ownership of the override is handed to the
MessageDecoder, which resets the main thread QoS in its destructor.

* Platform/IPC/MessageDecoder.cpp:
(IPC::MessageDecoder::~MessageDecoder): Remove any QoS override owned by this message.

* Platform/IPC/MessageDecoder.h:
(IPC::MessageDecoder::setQOSClassOverride): Added. Takes ownership of a QoS override
to make sure it stays in effect until this message has been dispatched.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeConnection): Set up main thread QoS boosting for the
web process's connection to the UI process.

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

4 years agoCursor doesn't change back to pointer when leaving Mail
rniwa@webkit.org [Thu, 26 Mar 2015 21:43:21 +0000 (21:43 +0000)]
Cursor doesn't change back to pointer when leaving Mail
https://bugs.webkit.org/show_bug.cgi?id=132038

Reviewed by Anders Carlsson.

Fixed the bug by adding a cursor rect and making the primary tracking area update the cursor so that
AppKit will reset the cursor as it leaves the WebView.

We use nil cursor here since we manually update the cursor by calling [NSCursor set].

Source/WebKit/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView setDataSource:]): Use NSTrackingCursorUpdate option in creating the primary tracking area.

Source/WebKit2:

* UIProcess/API/mac/WKView.mm:
(-[WKView initWithFrame:processPool:configuration:webView:]):
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::recommendedScrollbarStyleDidChange):

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

4 years agoFix state maching debugging after r181964
benjamin@webkit.org [Thu, 26 Mar 2015 21:02:29 +0000 (21:02 +0000)]
Fix state maching debugging after r181964
https://bugs.webkit.org/show_bug.cgi?id=143082

Patch by Benjamin Poulain <bpoulain@apple.com> on 2015-03-26
Reviewed by Alex Christensen.

* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):

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

4 years agoIf we're in code for accessing scoped arguments, we should probably check if the...
fpizlo@apple.com [Thu, 26 Mar 2015 20:48:06 +0000 (20:48 +0000)]
If we're in code for accessing scoped arguments, we should probably check if the object is a scoped arguments rather than checking if it's a direct arguments.

Reviewed by Michael Saboff.

* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitScopedArgumentsGetByVal):
* tests/stress/scoped-then-direct-arguments-get-by-val-in-baseline.js: Added.

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

4 years agoImprove the offsetWidth/Height layout optimization
hyatt@apple.com [Thu, 26 Mar 2015 19:09:24 +0000 (19:09 +0000)]
Improve the offsetWidth/Height layout optimization
https://bugs.webkit.org/show_bug.cgi?id=143008

Reviewed by Zalan Bujtas.

* dom/Document.cpp:
(WebCore::Document::updateLayoutIfDimensionsOutOfDate):
* dom/Document.h:
Change Element* to Element&. Clean up the dimension bits to use shifting. Remove both the inline and
the positioning restrictions on the optimization check.

* dom/Element.cpp:
(WebCore::Element::offsetWidth):
(WebCore::Element::offsetHeight):
Change to use Element& instead of Element*.

(WebCore::Element::clientWidth):
(WebCore::Element::clientHeight):
(WebCore::Element::scrollWidth):
(WebCore::Element::scrollHeight):
Turn on the optimization for clientWidth/Height and scrollWidth/Height.

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

4 years ago[Linux] SeccompFilters: improve the port-agnostic whitelist
commit-queue@webkit.org [Thu, 26 Mar 2015 19:00:05 +0000 (19:00 +0000)]
[Linux] SeccompFilters: improve the port-agnostic whitelist
https://bugs.webkit.org/show_bug.cgi?id=140064

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2015-03-26
Reviewed by Žan Doberšek.

Allow the web process to access several files and directories that it
was previously prohibited from accessing. This makes the web process
much less likely to break.

* Shared/linux/SeccompFilters/SyscallPolicy.cpp:
(WebKit::SyscallPolicy::addDefaultWebProcessPolicy):

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

4 years agoRemove unneeded isConditionalRequest check from NetworkResourceLoader
antti@apple.com [Thu, 26 Mar 2015 18:49:40 +0000 (18:49 +0000)]
Remove unneeded isConditionalRequest check from NetworkResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=143096

Reviewed by Anders Carlsson.

This check is leftover from implementation that allowed disk cache to validate conditional
request itself. The case can't happen as NetworkCache canRetrieve test does not allow
conditional requests in the first place.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didReceiveResponseAsync):
(WebKit::isConditionalRequest): Deleted.

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

4 years agoRename Storage::Entry to Storage::Record
antti@apple.com [Thu, 26 Mar 2015 18:39:22 +0000 (18:39 +0000)]
Rename Storage::Entry to Storage::Record
https://bugs.webkit.org/show_bug.cgi?id=143101

Reviewed by Chris Dumez.

Lets have just one type called Entry in the cache code.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::Cache::store):
(WebKit::NetworkCache::Cache::update):
(WebKit::NetworkCache::Cache::traverse):
(WebKit::NetworkCache::Cache::dumpContentsToFile):
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::Entry):
(WebKit::NetworkCache::Entry::encodeAsStorageRecord):
(WebKit::NetworkCache::Entry::decodeStorageRecord):
(WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
(WebKit::NetworkCache::Entry::buffer):
(WebKit::NetworkCache::Entry::shareableResourceHandle):
(WebKit::NetworkCache::Entry::encode): Deleted.
(WebKit::NetworkCache::Entry::decode): Deleted.
(WebKit::NetworkCache::Entry::initializeBufferFromStorageEntry): Deleted.
* NetworkProcess/cache/NetworkCacheEntry.h:
(WebKit::NetworkCache::Entry::sourceStorageRecord):
(WebKit::NetworkCache::Entry::sourceStorageEntry): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::RecordMetaData::RecordMetaData):
(WebKit::NetworkCache::decodeRecordMetaData):
(WebKit::NetworkCache::decodeRecordHeader):
(WebKit::NetworkCache::decodeRecord):
(WebKit::NetworkCache::encodeRecordMetaData):
(WebKit::NetworkCache::encodeRecordHeader):
(WebKit::NetworkCache::Storage::dispatchReadOperation):
(WebKit::NetworkCache::retrieveFromMemory):
(WebKit::NetworkCache::Storage::store):
(WebKit::NetworkCache::Storage::update):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
(WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
(WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
(WebKit::NetworkCache::EntryMetaData::EntryMetaData): Deleted.
(WebKit::NetworkCache::decodeEntryMetaData): Deleted.
(WebKit::NetworkCache::decodeEntryHeader): Deleted.
(WebKit::NetworkCache::decodeEntry): Deleted.
(WebKit::NetworkCache::encodeEntryMetaData): Deleted.
(WebKit::NetworkCache::encodeEntryHeader): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:

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

4 years agoAdd --allowed-host support to run-webkit-tests
jer.noble@apple.com [Thu, 26 Mar 2015 18:16:02 +0000 (18:16 +0000)]
Add --allowed-host support to run-webkit-tests
https://bugs.webkit.org/show_bug.cgi?id=142938

Reviewed by Brent Fulgham.

Accept --allowed-host arguments from run-webkit-tests and pass them through to
DumpRenderTree and WebKitTestRunner.

Drive-by fix: Depending on the value of the --layout-test-dir parameter, layout test results
are placed in the wrong location. The argument is compared with each tests's path, and if a
relative path or a path with '..' was used, results are placed alongside the test. Take the
absolute path of the --layout-test-dir argument, collapsing path components like '..'.

* Scripts/webkitpy/layout_tests/run_webkit_tests.py:
(parse_args):
* Scripts/webkitpy/port/base.py:
(Port.__init__):
(Port.allowed_hosts):
* Scripts/webkitpy/port/driver.py:
(Driver.cmd_line):

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

4 years ago[Mac] Add an --allowed-host argument to DRT and WKTR to allow tests to connect to...
jer.noble@apple.com [Thu, 26 Mar 2015 18:12:56 +0000 (18:12 +0000)]
[Mac] Add an --allowed-host argument to DRT and WKTR to allow tests to connect to non-localhost servers
https://bugs.webkit.org/show_bug.cgi?id=142931

Reviewed by Brent Fulgham.

Currently, both DRT and WKTR will refuse to allow network connections to non-localhost servers
over HTTP/HTTPS. For certain testing scenarios, however, it would be useful if both DRT and
WKTR could be allowed to make HTTP/HTTPS connections to certain, specific servers defined at
runtime.

To allow this, add an optional argument to DRT and WKTR, --allowed-host, which will add the specified
hostname to a whitelist; requests to these hosts will allowed to proceed normally.

Drive-by fix: in InjectedBundlePage::willSendRequestForFrame, we get the top loading frame from the
injected bundle. But after the main resource load completes, the bundle nulls out it's pointer to the
top loading frame, which causes a subsequent crash when further resources are requested. Instead, get
the top loading frame from the page, as we do elsewhere in this class.

* DumpRenderTree/TestRunner.h:
(TestRunner::allowedHosts):
(TestRunner::setAllowedHosts):
* DumpRenderTree/mac/DumpRenderTree.mm:
(initializeGlobalsFromCommandLineOptions):
(runTest):
* DumpRenderTree/mac/ResourceLoadDelegate.mm:
(isAllowedHost):
(-[ResourceLoadDelegate webView:resource:willSendRequest:redirectResponse:fromDataSource:]):
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessage):
(WTR::InjectedBundle::isAllowedHost):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::isAllowedHost):
(WTR::InjectedBundlePage::willSendRequestForFrame):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/Options.cpp:
(WTR::handleOptionAllowedHost):
(WTR::OptionsHandler::OptionsHandler):
* WebKitTestRunner/Options.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize):
(WTR::TestController::resetStateToConsistentValues):
* WebKitTestRunner/TestController.h:

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

4 years agoApply ContentExtension actions after redirects.
beidson@apple.com [Thu, 26 Mar 2015 17:45:12 +0000 (17:45 +0000)]
Apply ContentExtension actions after redirects.
<rdar://problem/20062613> and https://bugs.webkit.org/show_bug.cgi?id=143055

Reviewed by Alex Christensen.

Source/WebCore:

Tests: http/tests/contentextensions/loading/main-resource-redirect-blocked.php
       http/tests/contentextensions/subresource-redirect-blocked.html

This patch moves the "run a URL against the content extension" code from CachedResourceLoader to
the ContentExtensionsBackend.

That allows it to be shared between the CachedResourceLoader where loads are initiated and
ResourceLoader where redirects are handled.

* contentextensions/ContentExtension.cpp:
(WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):

* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
(WebCore::ContentExtensions::ContentExtensionsBackend::displayNoneCSSRule):
* contentextensions/ContentExtensionsBackend.h:

* loader/NetscapePlugInStreamLoader.cpp:
(WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):

* loader/ResourceLoadInfo.h:

* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::ResourceLoader):
(WebCore::ResourceLoader::willSendRequest):
* loader/ResourceLoader.h:

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::SubresourceLoader):

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):

* page/UserContentController.cpp:
(WebCore::UserContentController::processContentExtensionRulesForLoad):
(WebCore::UserContentController::actionsForResourceLoad): Deleted.
(WebCore::UserContentController::globalDisplayNoneStyleSheet): Deleted.
(WebCore::UserContentController::displayNoneCSSRule): Deleted.
* page/UserContentController.h:

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame): Dump the fact that the load error is kWKErrorCodeCannotShowURL
  which is specifically interesting to a new test.

LayoutTests:

* http/tests/contentextensions/loading/main-resource-redirect-blocked-expected.txt: Added.
* http/tests/contentextensions/loading/main-resource-redirect-blocked.php: Added.
* http/tests/contentextensions/loading/main-resource-redirect-blocked.php.json: Added.
* http/tests/contentextensions/loading/resources/main-resource-redirect-blocked-target.html: Added.
* http/tests/contentextensions/resources/subresource-redirect.php: Added.
* http/tests/contentextensions/subresource-redirect-blocked-expected.txt: Added.
* http/tests/contentextensions/subresource-redirect-blocked.html: Added.
* http/tests/contentextensions/subresource-redirect-blocked.html.json: Added.

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

4 years agoCrash when laying out (char)0
mmaxfield@apple.com [Thu, 26 Mar 2015 17:29:53 +0000 (17:29 +0000)]
Crash when laying out (char)0
https://bugs.webkit.org/show_bug.cgi?id=143103

Reviewed by Dean Jackson.

We currently cache a character -> Font mapping in a HashMap.
However, keys in Hashmaps can't be 0. This patch simply skips
the cache in this case.

No new tests, for now. I'm having trouble creating a test because
the site that causes this bug generates their page using script,
and the script is all minified, and difficult to understand. I
will contact the owner of the site and ask for and unminified
version of their sources. However, I don't want to that to block
this tiny fix from going in.

* platform/graphics/Font.cpp:
(WebCore::Font::systemFallbackFontForCharacter):

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

4 years ago[Mac][EME] Crash at com.apple.WebCore: WebCore::CDMSessionMediaSourceAVFObjC::release...
jer.noble@apple.com [Thu, 26 Mar 2015 17:24:21 +0000 (17:24 +0000)]
[Mac][EME] Crash at com.apple.WebCore: WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys + 177
https://bugs.webkit.org/show_bug.cgi?id=143080

Reviewed by Eric Carlson.

Null-check m_certificate before dereferencing.

* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
(WebCore::CDMSessionMediaSourceAVFObjC::releaseKeys):

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

4 years agojs/promises-tests/promises-tests-2-3-3.html sometimes crashes under DFG::SpeculativeJ...
msaboff@apple.com [Thu, 26 Mar 2015 17:04:38 +0000 (17:04 +0000)]
js/promises-tests/promises-tests-2-3-3.html sometimes crashes under DFG::SpeculativeJIT::compile
https://bugs.webkit.org/show_bug.cgi?id=139865

Reviewed by Alexey Proskuryakov.

It appears that r181993 fixed this test as it removed the code where the crash occurred.

* TestExpectations: Re-enabled js/promises-tests/promises-tests-2-3-3 including marking it as Slow.

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

4 years agoAX: [role="button"][aria-pressed] should be exposed as AXCheckbox:AXToggleButton...
cfleizach@apple.com [Thu, 26 Mar 2015 16:35:58 +0000 (16:35 +0000)]
AX: [role="button"][aria-pressed] should be exposed as AXCheckbox:AXToggleButton, with role description of "toggle button"
https://bugs.webkit.org/show_bug.cgi?id=115298

Reviewed by Mario Sanchez Prada.

Source/WebCore:

A role=button + aria-pressed object should be exposed as AXCheckbox on Mac now. It should also convert the
aria-pressed state into a 0, 1, 2 number value for the Mac.

Test: platform/mac/accessibility/aria-pressed-button-attributes.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::checkboxOrRadioValue):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::isToggleButton):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

LayoutTests:

* accessibility/aria-toggle-button-with-title.html:
     Bad path for post test resources file, so that is fixed.
* platform/mac/accessibility/aria-pressed-button-attributes-expected.txt: Added.
* platform/mac/accessibility/aria-pressed-button-attributes.html: Added.
* platform/mac/accessibility/aria-toggle-button-with-title-expected.txt:
      Updated to reflect the new role of this object.

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

4 years ago[WK2] Let the compiler generate the NetworkCache::Key move constructor
cdumez@apple.com [Thu, 26 Mar 2015 16:24:06 +0000 (16:24 +0000)]
[WK2] Let the compiler generate the NetworkCache::Key move constructor
https://bugs.webkit.org/show_bug.cgi?id=143079

Reviewed by Antti Koivisto.

Let the compiler generate the NetworkCache::Key move constructor. The
generated one will do exactly the same thing as the one we had except
that it will move the m_hash member as well. I don't see any reason why
we weren't moving this member before (it is an std::array<uint8_t, 16>).

Also have the compiler generate a move assignment operator for
consistency. Although it is not currently useful, it could be at some
point.

* NetworkProcess/cache/NetworkCacheKey.cpp:
(WebKit::NetworkCache::Key::Key): Deleted.
* NetworkProcess/cache/NetworkCacheKey.h:

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

4 years ago[WK2][NetworkCache] Compute if a cached response has expired only when actually needed
cdumez@apple.com [Thu, 26 Mar 2015 16:21:44 +0000 (16:21 +0000)]
[WK2][NetworkCache] Compute if a cached response has expired only when actually needed
https://bugs.webkit.org/show_bug.cgi?id=143070

Reviewed by Antti Koivisto.

Compute if a cached response has expired only when actually needed:
- This is not a history navigation
and
- It does not have "Cache-Control: no-cache" header

Previously, we would always determine if the response has expired and
we often end up not using this information.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::responseHasExpired):
(WebKit::NetworkCache::canUse):

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

4 years agoFTL ScopedArguments GetArrayLength generates incorrect code and crashes in LLVM
fpizlo@apple.com [Thu, 26 Mar 2015 15:29:57 +0000 (15:29 +0000)]
FTL ScopedArguments GetArrayLength generates incorrect code and crashes in LLVM
https://bugs.webkit.org/show_bug.cgi?id=143098

Reviewed by Csaba Osztrogonác.

* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileGetArrayLength): Fix a typo.
* tests/stress/scoped-arguments-array-length.js: Added. This test previously always crashed in ftl-no-cjit mode.

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