WebKit-https.git
5 years agoStackmaps have problems with double register constraints
fpizlo@apple.com [Wed, 24 Feb 2016 18:49:45 +0000 (18:49 +0000)]
Stackmaps have problems with double register constraints
https://bugs.webkit.org/show_bug.cgi?id=154643

Reviewed by Geoffrey Garen.

This is currently a benign bug. I found it while playing.

* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::fillStackmap):
* b3/testb3.cpp:
(JSC::B3::testURShiftSelf64):
(JSC::B3::testPatchpointDoubleRegs):
(JSC::B3::zero):
(JSC::B3::run):

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

5 years agoRebaseline two W3C tests for ios-simulator after r197014
ryanhaddad@apple.com [Wed, 24 Feb 2016 18:14:41 +0000 (18:14 +0000)]
Rebaseline two W3C tests for ios-simulator after r197014

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt:
* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:

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

5 years agoFollow up fix for the TimelineRuler "select all" mode to fix zeroTime.
timothy@apple.com [Wed, 24 Feb 2016 17:56:11 +0000 (17:56 +0000)]
Follow up fix for the TimelineRuler "select all" mode to fix zeroTime.

https://bugs.webkit.org/show_bug.cgi?id=154561
rdar://problem/24779872

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype.set zeroTime): Change selectionStartTime
before _zeroTime so the check for entireRangeSelected still works.

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

5 years agoWeb Inspector: TimelineRuler should have a "select all" mode
mattbaker@apple.com [Wed, 24 Feb 2016 17:41:42 +0000 (17:41 +0000)]
Web Inspector: TimelineRuler should have a "select all" mode
https://bugs.webkit.org/show_bug.cgi?id=154561
<rdar://problem/24779872>

Reviewed by Timothy Hatcher.

TimelineRuler is initialized with a selected range of [0, Number.MAX_VALUE),
indicating the entire timeline is selected. This patch makes it possible to
return the ruler to this state, after being overwritten by a custom selection.
When no custom selection exists, the selection handles are hidden.

* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler.selection-hidden > :matches(.selection-drag, .selection-handle, .shaded-area)):
Style for hiding selection controls as needed.

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler):
Represent unbounded selection interval as [0, Number.MAX_VALUE).

(WebInspector.TimelineRuler.prototype.set allowsTimeRangeSelection):
Register double-click event listener.

(WebInspector.TimelineRuler.prototype.set zeroTime):
(WebInspector.TimelineRuler.prototype.get entireRangeSelected):
(WebInspector.TimelineRuler.prototype.selectEntireRange):
Let clients check and set the selection of the entire range without needing
to use the internal sentinel values 0 and Number.MAX_VALUE.

(WebInspector.TimelineRuler.prototype._updateSelection):
Update ruler styles and dispatch selection change event when entire
range is selected.

(WebInspector.TimelineRuler.prototype._handleDoubleClick):
If a user-defined selection exists, select the entire range.

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

5 years ago[ES6] Arrow function syntax. Emit loading&putting this/super only if they are used...
commit-queue@webkit.org [Wed, 24 Feb 2016 17:36:12 +0000 (17:36 +0000)]
[ES6] Arrow function syntax. Emit loading&putting this/super only if they are used in arrow function
https://bugs.webkit.org/show_bug.cgi?id=153981

Patch by Skachkov Oleksandr <gskachkov@gmail.com> on 2016-02-24
Reviewed by Saam Barati.
Source/JavaScriptCore:

In first iteration of implemenation arrow function, we emit load and store variables 'this', 'arguments',
'super', 'new.target' in case if arrow function is exist even variables are not used in arrow function.
Current patch added logic that prevent from emiting those varibles if they are not used in arrow function.
During syntax analyze parser store information about using variables in arrow function inside of
the ordinary function scope and then put to BytecodeGenerator through UnlinkedCodeBlock

* bytecode/ExecutableInfo.h:
(JSC::ExecutableInfo::ExecutableInfo):
(JSC::ExecutableInfo::arrowFunctionCodeFeatures):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::UnlinkedCodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedCodeBlock::arrowFunctionCodeFeatures):
(JSC::UnlinkedCodeBlock::doAnyInnerArrowFunctionsUseArguments):
(JSC::UnlinkedCodeBlock::doAnyInnerArrowFunctionsUseSuperCall):
(JSC::UnlinkedCodeBlock::doAnyInnerArrowFunctionsUseSuperProperty):
(JSC::UnlinkedCodeBlock::doAnyInnerArrowFunctionsUseEval):
(JSC::UnlinkedCodeBlock::doAnyInnerArrowFunctionsUseThis):
(JSC::UnlinkedCodeBlock::doAnyInnerArrowFunctionsUseNewTarget):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::initializeArrowFunctionContextScopeIfNeeded):
(JSC::BytecodeGenerator::emitLoadArrowFunctionLexicalEnvironment):
(JSC::BytecodeGenerator::emitLoadThisFromArrowFunctionLexicalEnvironment):
(JSC::BytecodeGenerator::emitLoadNewTargetFromArrowFunctionLexicalEnvironment):
(JSC::BytecodeGenerator::emitLoadDerivedConstructorFromArrowFunctionLexicalEnvironment):
(JSC::BytecodeGenerator::isThisUsedInInnerArrowFunction):
(JSC::BytecodeGenerator::isArgumentsUsedInInnerArrowFunction):
(JSC::BytecodeGenerator::isNewTargetUsedInInnerArrowFunction):
(JSC::BytecodeGenerator::isSuperUsedInInnerArrowFunction):
(JSC::BytecodeGenerator::emitPutNewTargetToArrowFunctionContextScope):
(JSC::BytecodeGenerator::emitPutDerivedConstructorToArrowFunctionContextScope):
(JSC::BytecodeGenerator::emitPutThisToArrowFunctionContextScope):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ThisNode::emitBytecode):
(JSC::EvalFunctionCallNode::emitBytecode):
(JSC::FunctionCallValueNode::emitBytecode):
(JSC::FunctionNode::emitBytecode):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createFunctionMetadata):
* parser/Nodes.cpp:
(JSC::FunctionMetadataNode::FunctionMetadataNode):
* parser/Nodes.h:
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseGeneratorFunctionSourceElements):
(JSC::Parser<LexerType>::parseFunctionBody):
(JSC::Parser<LexerType>::parseFunctionInfo):
(JSC::Parser<LexerType>::parseProperty):
(JSC::Parser<LexerType>::parsePrimaryExpression):
(JSC::Parser<LexerType>::parseMemberExpression):
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::isArrowFunctionBoundary):
(JSC::Scope::innerArrowFunctionFeatures):
(JSC::Scope::setInnerArrowFunctionUseSuperCall):
(JSC::Scope::setInnerArrowFunctionUseSuperProperty):
(JSC::Scope::setInnerArrowFunctionUseEval):
(JSC::Scope::setInnerArrowFunctionUseThis):
(JSC::Scope::setInnerArrowFunctionUseNewTarget):
(JSC::Scope::setInnerArrowFunctionUseArguments):
(JSC::Scope::setInnerArrowFunctionUseEvalAndUseArgumentsIfNeeded):
(JSC::Scope::collectFreeVariables):
(JSC::Scope::mergeInnerArrowFunctionFeatures):
(JSC::Scope::fillParametersForSourceProviderCache):
(JSC::Scope::restoreFromSourceProviderCache):
(JSC::Scope::setIsFunction):
(JSC::Scope::setIsArrowFunction):
(JSC::Parser::closestParentNonArrowFunctionNonLexicalScope):
(JSC::Parser::pushScope):
(JSC::Parser::popScopeInternal):
* parser/ParserModes.h:
* parser/SourceProviderCacheItem.h:
(JSC::SourceProviderCacheItem::SourceProviderCacheItem):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::createFunctionMetadata):
* tests/stress/arrowfunction-lexical-bind-arguments-non-strict-1.js:
* tests/stress/arrowfunction-lexical-bind-arguments-strict.js:
* tests/stress/arrowfunction-lexical-bind-newtarget.js:
* tests/stress/arrowfunction-lexical-bind-superproperty.js:
* tests/stress/arrowfunction-lexical-bind-this-8.js: Added.

LayoutTests:

Added new benchmark tests for invoking arrow function within function, class's constructor and method

* js/regress/arrowfunction-call-in-class-constructor-expected.txt: Added.
* js/regress/arrowfunction-call-in-class-constructor.html: Added.
* js/regress/arrowfunction-call-in-class-method-expected.txt: Added.
* js/regress/arrowfunction-call-in-class-method.html: Added.
* js/regress/arrowfunction-call-in-function-expected.txt: Added.
* js/regress/arrowfunction-call-in-function.html: Added.
* js/regress/script-tests/arrowfunction-call-in-class-constructor.js: Added.
* js/regress/script-tests/arrowfunction-call-in-class-method.js: Added.
* js/regress/script-tests/arrowfunction-call-in-function.js: Added.
* js/regress/script-tests/arrowfunction-call.js:

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

5 years agoSpeculative fix for ios build.
ryanhaddad@apple.com [Wed, 24 Feb 2016 17:26:52 +0000 (17:26 +0000)]
Speculative fix for ios build.

Unreviewed build fix.

* bindings/objc/DOM.mm:
(-[DOMNode nextFocusNode]):
(-[DOMNode previousFocusNode]):

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

5 years ago[WinCairo] Mark layer as non composited.
peavo@outlook.com [Wed, 24 Feb 2016 17:19:23 +0000 (17:19 +0000)]
[WinCairo] Mark layer as non composited.
https://bugs.webkit.org/show_bug.cgi?id=154640

Reviewed by Alex Christensen.

We need to mark the non composited layer as being non composited.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::initialize):
(AcceleratedCompositingContext::flushPendingLayerChanges):

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

5 years agoBackground of an absolutely positioned inline element inside text-indented parent...
zalan@apple.com [Wed, 24 Feb 2016 17:13:33 +0000 (17:13 +0000)]
Background of an absolutely positioned inline element inside text-indented parent is positioned statically.
https://bugs.webkit.org/show_bug.cgi?id=154019

Reviewed by Simon Fraser.

This patch ensures that statically positioned out-of-flow renderers are also text-aligned
even when none of the renderers on the first line generate a linebox (so we end up with no bidi runs at all).
The fix is to pass IndentTextOrNot information to startAlignedOffsetForLine through updateStaticInlinePositionForChild
so that we can compute the left position for this statically positioned out of flow renderer.

Source/WebCore:

Test: fast/css3-text/css3-text-indent/text-indent-with-absolute-pos-child.html

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustPositionedBlock):
(WebCore::RenderBlockFlow::updateStaticInlinePositionForChild):
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::startAlignedOffsetForLine):
* rendering/line/LineBreaker.cpp:
(WebCore::LineBreaker::skipTrailingWhitespace):
(WebCore::LineBreaker::skipLeadingWhitespace):
* rendering/line/LineInlineHeaders.h: webkit.org/b/154628 fixes the bool vs IndentTextOrNot issue.
(WebCore::setStaticPositions):

LayoutTests:

* fast/css3-text/css3-text-indent/text-indent-with-absolute-pos-child-expected.html: Added.
* fast/css3-text/css3-text-indent/text-indent-with-absolute-pos-child.html: Added.

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

5 years agoWeb Inspector: Dim selected items when docked Inspector window is inactive
nvasilyev@apple.com [Wed, 24 Feb 2016 17:06:50 +0000 (17:06 +0000)]
Web Inspector: Dim selected items when docked Inspector window is inactive
https://bugs.webkit.org/show_bug.cgi?id=154526
<rdar://problem/24764365>

Abstract selected item and SVG glyph colors into CSS variables.

Reviewed by Timothy Hatcher.

* UserInterface/Views/BezierEditor.css:
(.bezier-editor > .bezier-preview > div):
* UserInterface/Views/ButtonNavigationItem.css:
(.navigation-bar .item.button > .glyph):
(.navigation-bar .item.button:not(.disabled):active > .glyph):
(.navigation-bar .item.button:not(.disabled):matches(:focus, .activate.activated, .radio.selected) > .glyph):
(.navigation-bar .item.button:not(.disabled):active:matches(:focus, .activate.activated, .radio.selected) > .glyph):
(.navigation-bar .item.button.disabled > .glyph):
* UserInterface/Views/ButtonToolbarItem.css:
(.toolbar .item.button:not(.disabled):matches(:focus, .activate.activated) > .glyph):
(.toolbar .item.button:not(.disabled):active:matches(:focus, .activate.activated) > .glyph):
* UserInterface/Views/CSSStyleDetailsSidebarPanel.css:
(.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle.selected):
(.sidebar > .panel.details.css-style > .content ~ .options-container > .toggle-class-toggle:not(.selected):hover):
* UserInterface/Views/ConsoleMessageView.css:
(.console-user-command.special-user-log > .console-message-text):
* UserInterface/Views/DOMTreeOutline.css:
(.tree-outline.dom li.pseudo-class-enabled > .selection::before):
* UserInterface/Views/Main.css:
(input[type=range]::-webkit-slider-runnable-track::before):
* UserInterface/Views/RadioButtonNavigationItem.css:
(.navigation-bar .item.radio.button.text-only:hover):
(.navigation-bar .item.radio.button.text-only.selected):
(.navigation-bar .item.radio.button.text-only:active):
(.navigation-bar .item.radio.button.text-only.selected:active):
* UserInterface/Views/ScopeBar.css:
(.scope-bar > li.multiple:matches(.selected, :hover, :active) > .arrows):
(.scope-bar > li:hover):
(.scope-bar > li.selected):
(.scope-bar > li:active):
(.scope-bar > li.selected:active):
* UserInterface/Views/Variables.css:
(:root):
(body.window-inactive):
* UserInterface/Views/VisualStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style .visual > .details-section .details-section.has-set-property > .header > span::after):
* UserInterface/Views/VisualStyleKeywordIconList.css:
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon:matches(.computed, .selected)):
(.visual-style-property-container.keyword-icon-list > .visual-style-property-value-container > .keyword-icon-list-container > .keyword-icon.selected):

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

5 years agoRemove IteratorKey and IteratorValue declarations from JSXX class declarations.
youenn.fablet@crf.canon.fr [Wed, 24 Feb 2016 14:17:48 +0000 (14:17 +0000)]
Remove IteratorKey and IteratorValue declarations from JSXX class declarations.
https://bugs.webkit.org/show_bug.cgi?id=154577

Reviewed by Myles C. Maxfield.

No change of behavior.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader): Deleted declaration of IteratorKey and IteratorValue.
* bindings/scripts/test/JS/JSTestObj.h:
(WebCore::JSTestObj::createStructure): Rebasing of binding test expectation.

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

5 years agoW3C importer should generate all web-platform-tests submodules descriptions
youenn.fablet@crf.canon.fr [Wed, 24 Feb 2016 12:14:30 +0000 (12:14 +0000)]
W3C importer should generate all web-platform-tests submodules descriptions
https://bugs.webkit.org/show_bug.cgi?id=154587

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* resources/TestRepositories: Reactivated submodules description generation.
* resources/web-platform-tests-modules.json: Updated according modified scripts.

Tools:

Updated submodules description format (removing submodule name as it is the last string of the path really).
Added git subroutines.

* Scripts/webkitpy/common/checkout/scm/git.py:
(Git.origin_url):
(Git):
(Git.init_submodules):
(Git.submodules_status):
(Git.deinit_submodules):
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(WebPlatformTestServer._install_modules): Updated to submodule name removal.
* Scripts/webkitpy/w3c/test_downloader.py:
(TestDownloader._git_submodules_description): Updated to cope with recursive submodules (use of submodule init/deinit).
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(TestImporterTest.test_submodules_generation): Reactivated partially this test.

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

5 years ago[Fetch API] Refactor FetchHeaders initialization with iterators
youenn.fablet@crf.canon.fr [Wed, 24 Feb 2016 12:11:15 +0000 (12:11 +0000)]
[Fetch API] Refactor FetchHeaders initialization with iterators
https://bugs.webkit.org/show_bug.cgi?id=154537

Reviewed by Darin Adler.

Covered by existing tests.

* Modules/fetch/FetchHeaders.cpp:
(WebCore::initializeWith): Deleted.
* Modules/fetch/FetchHeaders.h: Removed FetchHeaders::initializeWith.
* Modules/fetch/FetchHeaders.idl: Ditto.
* Modules/fetch/FetchHeaders.js:
(initializeFetchHeaders): Making use of iterators to fill headers.

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

5 years agoUnreviewed. Fix GObject DOM bindings API break after r196998.
carlosgc@webkit.org [Wed, 24 Feb 2016 11:13:58 +0000 (11:13 +0000)]
Unreviewed. Fix GObject DOM bindings API break after r196998.

webkit_dom_node_clone_node can now raise exceptions, so rename it
as webkit_dom_node_clone_node_with_error and deprecate the old one
that calls the new one ignoring the error.

* bindings/gobject/WebKitDOMDeprecated.cpp:
(webkit_dom_node_clone_node):
* bindings/gobject/WebKitDOMDeprecated.h:
* bindings/gobject/WebKitDOMDeprecated.symbols:
* bindings/gobject/webkitdom.symbols:
* bindings/scripts/CodeGeneratorGObject.pm:
(FunctionUsedToNotRaiseException):
(GenerateFunction):

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

5 years agoREGRESSION(r195949): [GTK] Test /webkit2/WebKitWebView/insert/link is failing since...
carlosgc@webkit.org [Wed, 24 Feb 2016 10:41:11 +0000 (10:41 +0000)]
REGRESSION(r195949): [GTK] Test /webkit2/WebKitWebView/insert/link is failing since r195949
https://bugs.webkit.org/show_bug.cgi?id=153747

Reviewed by Michael Catanzaro.

Source/WebCore:

Do not return early when reaching a boundary if there's a range
selection. In that case, the selection will be cleared and
accessibility will be notified.

Test: editing/selection/move-to-line-boundary-clear-selection.html

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::modify):

LayoutTests:

Add test to check that moving to line boundary clears the
selection even if the cursor is already at the boundary.

* editing/selection/move-to-line-boundary-clear-selection-expected.txt: Added.
* editing/selection/move-to-line-boundary-clear-selection.html: Added.

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

5 years ago[Gstreamer] Mediaplayer should observe the tracks and not the source
commit-queue@webkit.org [Wed, 24 Feb 2016 10:12:54 +0000 (10:12 +0000)]
[Gstreamer] Mediaplayer should observe the tracks and not the source
https://bugs.webkit.org/show_bug.cgi?id=154582

Patch by Alejandro G. Castro <alex@igalia.com> on 2016-02-24
Reviewed by Philippe Normand.

We have to observe the track objects that define the
mediastream. Replace the source attributes with the new tracks and
use them properly in the class.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
Make sure we are not observing anymore the tracks after
destruction.
(WebCore::MediaPlayerPrivateGStreamerOwr::hasVideo): Used the track
instead of the source.
(WebCore::MediaPlayerPrivateGStreamerOwr::hasAudio): Ditto.
(WebCore::MediaPlayerPrivateGStreamerOwr::currentTime): Ditto.
(WebCore::MediaPlayerPrivateGStreamerOwr::internalLoad): Ditto.
(WebCore::MediaPlayerPrivateGStreamerOwr::stop): Ditto.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): Added, new
track observer API, make sure we disable the ended tracks.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackMutedChanged):
Added, new track observer API.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackSettingsChanged):
Added, new track observer API.
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
Added, new track observer API.
(WebCore::MediaPlayerPrivateGStreamerOwr::sourceStopped): Deleted,
source observer API.
(WebCore::MediaPlayerPrivateGStreamerOwr::sourceMutedChanged):
Deleted, source observer API.
(WebCore::MediaPlayerPrivateGStreamerOwr::sourceSettingsChanged):
Deleted, source observer API.
(WebCore::MediaPlayerPrivateGStreamerOwr::preventSourceFromStopping):
Deleted, source observer API.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
Replaced the attributes representing the source with the tracks
and added the new track observer functions.

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

5 years ago[css-grid] Swap the order of columns/rows in grid-gap shorthand
svillar@igalia.com [Wed, 24 Feb 2016 10:03:25 +0000 (10:03 +0000)]
[css-grid] Swap the order of columns/rows in grid-gap shorthand
https://bugs.webkit.org/show_bug.cgi?id=154584

Source/WebCore:

The latest editor's draft have just changed the order. Now it
should be <grid-row-gap> <grid-column-gap>?.

Reviewed by Darin Adler.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridGapShorthand):
* css/CSSPropertyNames.in:

LayoutTests:

Reviewed by Darin Adler.

* fast/css-grid-layout/grid-gutters-get-set-expected.txt:
* fast/css-grid-layout/grid-gutters-get-set.html:

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

5 years agoMove FocusNavigationScope into FocusController.cpp
rniwa@webkit.org [Wed, 24 Feb 2016 09:36:12 +0000 (09:36 +0000)]
Move FocusNavigationScope into FocusController.cpp
https://bugs.webkit.org/show_bug.cgi?id=154630

Reviewed by Darin Adler.

Source/WebCore:

Moved FocusNavigationScope from FocusController.h to FocusController.cpp.

* bindings/objc/DOM.mm:
(-[DOMNode nextFocusNode]):
(-[DOMNode previousFocusNode]):
* page/FocusController.cpp:
(WebCore::parentInScope):
(WebCore::FocusNavigationScope::firstChildInScope): Moved into FocusNavigationScope.
(WebCore::FocusNavigationScope::lastChildInScope): Ditto.
(WebCore::FocusNavigationScope::nextInScope): Ditto.
(WebCore::FocusNavigationScope::previousInScope): Ditto.
(WebCore::FocusController::findFocusableElementAcrossFocusScope):
(WebCore::FocusController::findFocusableElementRecursively):
(WebCore::FocusController::findFocusableElement):
(WebCore::nextElementWithGreaterTabIndex):
(WebCore::previousElementWithLowerTabIndex):
(WebCore::FocusController::nextFocusableElement): Added a variant for DOM.mm and WebPageIOS.mm.
(WebCore::FocusController::previousFocusableElement): Ditto.
(WebCore::FocusController::nextFocusableElement):
(WebCore::FocusController::previousFocusableElement): Use if instead of for loop for clarity.
* page/FocusController.h:

Source/WebKit2:

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::nextAssistableElement):

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

5 years agoWebRTC: RTCPeerConnection: Sort out responsibilities of close() and stop()
adam.bergkvist@ericsson.com [Wed, 24 Feb 2016 08:14:58 +0000 (08:14 +0000)]
WebRTC: RTCPeerConnection: Sort out responsibilities of close() and stop()
https://bugs.webkit.org/show_bug.cgi?id=154581

Reviewed by Eric Carlson.

Source/WebCore:

Let RTCPeerConnection::close() contain all teardown logic be called by stop().
close() is also responisble for stopping the PeerConnectionBackend and stopping
all RTCRtpSender objects.

Test coverage:
fast/mediastream/RTCRtpSender-replaceTrack.html (updated)
fast/mediastream/RTCPeerConnection-closed-state.html

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::close):
(WebCore::RTCPeerConnection::stop):
(WebCore::RTCPeerConnection::RTCPeerConnection): Deleted.
* Modules/mediastream/RTCPeerConnection.h:

LayoutTests:

Updated test with replaceTrack() call after the RTCPeerConnection object, that
created the RTCRtpSender, is closed.

* fast/mediastream/RTCRtpSender-replaceTrack-expected.txt:
* fast/mediastream/RTCRtpSender-replaceTrack.html:

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

5 years agoWebRTC: Add addReceiver() function to PeerConnectionBackendClient interface
adam.bergkvist@ericsson.com [Wed, 24 Feb 2016 08:12:14 +0000 (08:12 +0000)]
WebRTC: Add addReceiver() function to PeerConnectionBackendClient interface
https://bugs.webkit.org/show_bug.cgi?id=154583

Reviewed by Eric Carlson.

The addRecevier() notifies the PeerConnectionBackendClient that a new RTCRtpReceiver,
representing an MediaStreamTrack received from a remote peer, is added.

* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addReceiver):
* Modules/mediastream/RTCPeerConnection.h:

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

5 years agoSupport building LocaleICU with light ICU (UCONFIG_NO_FORMATTING)
commit-queue@webkit.org [Wed, 24 Feb 2016 07:20:30 +0000 (07:20 +0000)]
Support building LocaleICU with light ICU (UCONFIG_NO_FORMATTING)
https://bugs.webkit.org/show_bug.cgi?id=154484

Patch by Olivier Blin <olivier.blin@softathome.com> on 2016-02-23
Reviewed by Darin Adler.

In this mode, this makes LocaleICU with UCONFIG_NO_FORMATTING
essentially the same as LocaleNone, but allows to keep using ICU for
other features.

* platform/text/LocaleICU.cpp:
(WebCore::LocaleICU::LocaleICU):
(WebCore::LocaleICU::~LocaleICU):
(WebCore::LocaleICU::initializeLocaleData):
* platform/text/LocaleICU.h:

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

5 years agoWeb Inspector: don't run the protocol generator once per output file
bburg@apple.com [Wed, 24 Feb 2016 07:11:35 +0000 (07:11 +0000)]
Web Inspector: don't run the protocol generator once per output file
https://bugs.webkit.org/show_bug.cgi?id=154635

Reviewed by Myles C. Maxfield.

* DerivedSources.make: Use $(firstword, ...) to take just one file as
the target to be built so that the generator runs only once. Make isn't
really designed to coalesce multiple file outputs to one production rule.

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

5 years agoRemove dead FontLoader code
mmaxfield@apple.com [Wed, 24 Feb 2016 07:07:11 +0000 (07:07 +0000)]
Remove dead FontLoader code
https://bugs.webkit.org/show_bug.cgi?id=154625

Reviewed by Darin Adler.

This code has been replaced by FontFaceSet.

No new tests because there is no behavior change.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSAllInOne.cpp:
* css/FontLoader.cpp: Removed.
(WebCore::LoadFontCallback::create): Deleted.
(WebCore::LoadFontCallback::createFromParams): Deleted.
(WebCore::LoadFontCallback::~LoadFontCallback): Deleted.
(WebCore::LoadFontCallback::familyCount): Deleted.
(WebCore::LoadFontCallback::LoadFontCallback): Deleted.
(WebCore::LoadFontCallback::notifyLoaded): Deleted.
(WebCore::LoadFontCallback::notifyError): Deleted.
(WebCore::FontLoader::loadFontDone): Deleted.
(WebCore::FontLoader::FontLoader): Deleted.
(WebCore::FontLoader::~FontLoader): Deleted.
(WebCore::FontLoader::eventTargetData): Deleted.
(WebCore::FontLoader::ensureEventTargetData): Deleted.
(WebCore::FontLoader::eventTargetInterface): Deleted.
(WebCore::FontLoader::scriptExecutionContext): Deleted.
(WebCore::FontLoader::didLayout): Deleted.
(WebCore::FontLoader::activeDOMObjectName): Deleted.
(WebCore::FontLoader::canSuspendForDocumentSuspension): Deleted.
(WebCore::FontLoader::scheduleEvent): Deleted.
(WebCore::FontLoader::firePendingEvents): Deleted.
(WebCore::FontLoader::beginFontLoading): Deleted.
(WebCore::FontLoader::fontLoaded): Deleted.
(WebCore::FontLoader::loadError): Deleted.
(WebCore::FontLoader::notifyWhenFontsReady): Deleted.
(WebCore::FontLoader::loadingDone): Deleted.
(WebCore::FontLoader::loadFont): Deleted.
(WebCore::FontLoader::checkFont): Deleted.
(WebCore::applyPropertyToCurrentStyle): Deleted.
(WebCore::FontLoader::resolveFontStyle): Deleted.
* css/FontLoader.h: Removed.
* css/FontLoader.idl: Removed.
* page/FrameView.cpp:

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

5 years ago[WinCairo][MediaFoundation] Implement methods to set volume.
peavo@outlook.com [Wed, 24 Feb 2016 07:05:58 +0000 (07:05 +0000)]
[WinCairo][MediaFoundation] Implement methods to set volume.
https://bugs.webkit.org/show_bug.cgi?id=154580

Reviewed by Alex Christensen.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::paused):
(WebCore::MediaPlayerPrivateMediaFoundation::setVolume):
(WebCore::MediaPlayerPrivateMediaFoundation::supportsMuting):
(WebCore::MediaPlayerPrivateMediaFoundation::setMuted):
(WebCore::MediaPlayerPrivateMediaFoundation::networkState):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

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

5 years ago[Reflected] IDL attributes of integer types should use HTML rules for parsing integers
cdumez@apple.com [Wed, 24 Feb 2016 07:04:02 +0000 (07:04 +0000)]
[Reflected] IDL attributes of integer types should use HTML rules for parsing integers
https://bugs.webkit.org/show_bug.cgi?id=154573

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C HTML tests now that more checks are passing.

* web-platform-tests/html/dom/reflection-embedded-expected.txt:
* web-platform-tests/html/dom/reflection-forms-expected.txt:
* web-platform-tests/html/dom/reflection-grouping-expected.txt:
* web-platform-tests/html/dom/reflection-metadata-expected.txt:
* web-platform-tests/html/dom/reflection-misc-expected.txt:
* web-platform-tests/html/dom/reflection-obsolete-expected.txt:
* web-platform-tests/html/dom/reflection-sections-expected.txt:
* web-platform-tests/html/dom/reflection-tabular-expected.txt:
* web-platform-tests/html/dom/reflection-text-expected.txt:

Source/WebCore:

[Reflected] IDL attributes of integer types should use HTML rules for
parsing integers:
- https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes

Those rules are defined here:
- https://html.spec.whatwg.org/#rules-for-parsing-integers
- https://html.spec.whatwg.org/#rules-for-parsing-non-negative-integers

We already had an implementation for parsing HTML integers but our reflected
attributes currently use WTFString::toInt() / toUint() instead.

No new tests, already covered by existing tests.

* dom/Element.cpp:
(WebCore::Element::getIntegralAttribute):
This method used by the bindings only, for reflected IDL attributed of
type 'long'. Now call parseHTMLInteger() instead of String::toInt() to
parse the content attribute as per the HTML specification.

(WebCore::Element::getUnsignedIntegralAttribute):
This method used by the bindings only, for reflected IDL attributed of
type 'unsigned long'. Now call parseHTMLNonNegativeInteger() instead of
String::toUInt() to parse the content attribute as per the HTML
specification.

* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseHTMLIntegerInternal):
Fix a bug in our implementation of parseHTMLIntegerInternal() that
would cause the string "−2147483648" to be parsed as 0. It should
be parsed as −2147483648, which is in the valid range as per:
http://heycam.github.io/webidl/#idl-long

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

5 years agoWeb Inspector: teach the Objective-C protocol generators about --frontend and --backe...
bburg@apple.com [Wed, 24 Feb 2016 06:43:07 +0000 (06:43 +0000)]
Web Inspector: teach the Objective-C protocol generators about --frontend and --backend directives
https://bugs.webkit.org/show_bug.cgi?id=154615
<rdar://problem/24804330>

Reviewed by Timothy Hatcher.

Some of the generated Objective-C bindings are only relevant to code acting as the
protocol backend. Add a per-generator setting mechanism and propagate --frontend and
--backend to all generators. Use the setting in a few generators to omit code that's
not needed.

Also fix a few places where the code emits the wrong Objective-C class prefix.
There is some common non-generated code that must always have the RWIProtocol prefix.

Lastly, change includes to use RWIProtocolJSONObjectPrivate.h instead of *Internal.h. The
macros defined in the internal header now need to be used outside of the framework.

* inspector/scripts/codegen/generate_objc_conversion_helpers.py:
Use OBJC_STATIC_PREFIX along with the file name and use different include syntax
depending on the target framework.

* inspector/scripts/codegen/generate_objc_header.py:
(ObjCHeaderGenerator.generate_output):
For now, omit generating command protocol and event dispatchers when generating for --frontend.

(ObjCHeaderGenerator._generate_type_interface):
Use OBJC_STATIC_PREFIX along with the unprefixed file name.

* inspector/scripts/codegen/generate_objc_internal_header.py:
Use RWIProtocolJSONObjectPrivate.h instead.

* inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:
(ObjCProtocolTypesImplementationGenerator.generate_output):
Include the Internal header if it's being generated (only for --backend).

* inspector/scripts/codegen/generator.py:
(Generator.__init__):
(Generator.set_generator_setting):
(Generator):
(Generator.get_generator_setting):
Crib a simple setting system from the Framework class. Make the names more obnoxious.

(Generator.string_for_file_include):
Inspired by the replay input generator, this is a function that uses the proper syntax
for a file include depending on the file's framework and target framework.

* inspector/scripts/codegen/objc_generator.py:
(ObjCGenerator.and):
(ObjCGenerator.and.objc_prefix):
(ObjCGenerator):
(ObjCGenerator.objc_type_for_raw_name):
(ObjCGenerator.objc_class_for_raw_name):
Whitelist the 'Automation' domain for the ObjC generators. Revise use of OBJC_STATIC_PREFIX.

* inspector/scripts/generate-inspector-protocol-bindings.py:
(generate_from_specification):
Change the generators to use for the frontend. Propagate --frontend and --backend.

* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:
Rebaseline tests. They now correctly include RWIProtocolJSONObject.h and the like.

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

5 years agoAlign our implementation of Range.createContextualFragment with the specification
cdumez@apple.com [Wed, 24 Feb 2016 05:15:44 +0000 (05:15 +0000)]
Align our implementation of Range.createContextualFragment with the specification
https://bugs.webkit.org/show_bug.cgi?id=154627

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline as one more check is passing.

* web-platform-tests/dom/nodes/Node-contains-xhtml-expected.txt:

Source/WebCore:

Align our implementation of Range.createContextualFragment with the
specification:
- https://w3c.github.io/DOM-Parsing/#widl-Range-createContextualFragment-DocumentFragment-DOMString-fragment

In particular, if the Range's start node is a Document / DocumentFragment,
we now create a new HTMLBodyElement and use it as context element, instead
of throwing an exception.

This also aligns our behavior with Firefox and Chrome.

Tests: imported/blink/fast/dom/Range/create-contextual-fragment-from-bodyless-document-range.html
       imported/blink/fast/dom/Range/create-contextual-fragment-from-detached-text-node-range.html
       imported/blink/fast/dom/Range/create-contextual-fragment-from-document-fragment-range.html
       imported/blink/fast/dom/Range/create-contextual-fragment-from-document-range.html
       imported/blink/fast/dom/Range/create-contextual-fragment-from-xhtml-document-range.xhtml
       imported/blink/fast/dom/Range/create-contextual-fragment-script-not-ran.html
       imported/blink/fast/dom/Range/create-contextual-fragment-script-unmark-already-started.html

* dom/Range.cpp:
(WebCore::Range::createContextualFragment):

LayoutTests:

Import some more layout tests from blink to improve coverage for
Range.createContextualFragment().

* imported/blink/fast/dom/Range/create-contextual-fragment-from-bodyless-document-range-expected.txt: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-from-bodyless-document-range.html: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-from-detached-text-node-range-expected.txt: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-from-detached-text-node-range.html: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-from-document-fragment-range-expected.txt: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-from-document-fragment-range.html: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-from-document-range-expected.txt: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-from-document-range.html: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-from-xhtml-document-range-expected.txt: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-from-xhtml-document-range.xhtml: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-script-not-ran-expected.txt: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-script-not-ran.html: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-script-unmark-already-started-expected.txt: Added.
* imported/blink/fast/dom/Range/create-contextual-fragment-script-unmark-already-started.html: Added.

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

5 years agoarrayProtoFuncConcat doesn't check for an exception after allocating an array
sbarati@apple.com [Wed, 24 Feb 2016 04:39:29 +0000 (04:39 +0000)]
arrayProtoFuncConcat doesn't check for an exception after allocating an array
https://bugs.webkit.org/show_bug.cgi?id=154621

Reviewed by Michael Saboff.

* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncConcat):

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

5 years ago[Xcode] Linker errors display mangled names, but no longer should
mitz@apple.com [Wed, 24 Feb 2016 04:26:45 +0000 (04:26 +0000)]
[Xcode] Linker errors display mangled names, but no longer should
https://bugs.webkit.org/show_bug.cgi?id=154632

Reviewed by Sam Weinig.

Source/bmalloc:

* Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.

Source/JavaScriptCore:

* Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.

Source/WebCore:

* Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.

Source/WebInspectorUI:

* Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.

Source/WebKit/mac:

* Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.

Source/WebKit2:

* Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.

Source/WTF:

* Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.

Tools:

* ContentExtensionTester/Configurations/Base.xcconfig: Stop setting LINKER_DISPLAYS_MANGLED_NAMES to YES.
* DumpRenderTree/mac/Configurations/Base.xcconfig: Ditto.
* LayoutTestRelay/Configurations/Base.xcconfig: Ditto.
* MiniBrowser/Configurations/Base.xcconfig: Ditto.
* TestWebKitAPI/Configurations/Base.xcconfig: Ditto.
* WebEditingTester/Configurations/Base.xcconfig: Ditto.
* WebKitTestRunner/Configurations/Base.xcconfig: Ditto.

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

5 years agoSource/JavaScriptCore:
barraclough@apple.com [Wed, 24 Feb 2016 01:57:49 +0000 (01:57 +0000)]
Source/JavaScriptCore:
Remove HIDDEN_PAGE_DOM_TIMER_THROTTLING feature define
https://bugs.webkit.org/show_bug.cgi?id=112323

Reviewed by Chris Dumez.

This feature is controlled by a runtime switch, and defaults off.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:
[WebGL] iOS doesn't respect the alpha:false context creation attribute
https://bugs.webkit.org/show_bug.cgi?id=154617
<rdar://problem/13417023>

Patch by Dean Jackson <dino@apple.com> on 2016-02-23
Reviewed by Sam Weinig.

On iOS we were not respecting the alpha:false context creation
attribute, which meant you always got output that could
have an alpha channel.

The good news is that now we're setting the opaque flag on
the CALayer, there should be a performance improvement when
compositing WebGL into the page.

Test: fast/canvas/webgl/context-attributes-alpha.html

* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D): Don't tell the layer
to be transparent.
(WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable): Do it
here instead, but based on the value of the alpha attribute.

Source/WebKit/mac:
Remove HIDDEN_PAGE_DOM_TIMER_THROTTLING feature define
https://bugs.webkit.org/show_bug.cgi?id=112323

Reviewed by Chris Dumez.

This feature is controlled by a runtime switch, and defaults off.

* Configurations/FeatureDefines.xcconfig:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:
Remove HIDDEN_PAGE_DOM_TIMER_THROTTLING feature define
https://bugs.webkit.org/show_bug.cgi?id=112323

Reviewed by Chris Dumez.

This feature is controlled by a runtime switch, and defaults off.

* Configurations/FeatureDefines.xcconfig:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WTF:
Remove HIDDEN_PAGE_DOM_TIMER_THROTTLING feature define
https://bugs.webkit.org/show_bug.cgi?id=112323

Reviewed by Chris Dumez.

This feature is controlled by a runtime switch, and defaults off.

* wtf/FeatureDefines.h:

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

5 years ago[WebGL] iOS doesn't respect the alpha:false context creation attribute
dino@apple.com [Wed, 24 Feb 2016 01:21:55 +0000 (01:21 +0000)]
[WebGL] iOS doesn't respect the alpha:false context creation attribute
https://bugs.webkit.org/show_bug.cgi?id=154617
<rdar://problem/13417023>

Reviewed by Sam Weinig.

Source/WebCore:

On iOS we were not respecting the alpha:false context creation
attribute, which meant you always got output that could
have an alpha channel.

The good news is that now we're setting the opaque flag on
the CALayer, there should be a performance improvement when
compositing WebGL into the page.

Test: fast/canvas/webgl/context-attributes-alpha.html

* platform/graphics/mac/GraphicsContext3DMac.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D): Don't tell the layer
to be transparent.
(WebCore::GraphicsContext3D::setRenderbufferStorageFromDrawable): Do it
here instead, but based on the value of the alpha attribute.

LayoutTests:

Add a test that draws contexts with and without alpha, and then a reference
version that hard-codes the non-alpha colors.

* fast/canvas/webgl/context-attributes-alpha-expected.html: Added.
* fast/canvas/webgl/context-attributes-alpha.html: Added.

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

5 years agoCSP: Enable base-uri directive by default
dbates@webkit.org [Wed, 24 Feb 2016 00:53:29 +0000 (00:53 +0000)]
CSP: Enable base-uri directive by default
https://bugs.webkit.org/show_bug.cgi?id=154521
<rdar://problem/24762032>

Reviewed by Brent Fulgham.

Source/WebCore:

Tests: http/tests/security/contentSecurityPolicy/1.1/base-uri-default-ignored.html
       http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-base-uri-deny.html

* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::isExperimentalDirectiveName): Move base-uri from the directives considered
experimental to...
(WebCore::isCSPDirectiveName): ...the list of standard directives.
(WebCore::ContentSecurityPolicyDirectiveList::addDirective): Move logic to parse the base-uri
directive outside the ENABLE(CSP_NEXT) macro guarded section/experimental feature runtime flag.

LayoutTests:

Copy test http/tests/security/contentSecurityPolicy/1.1/base-uri-deny.html to
http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-base-uri-deny.html,
making some minor stylistic changes, and update TestExpectations to skip it because it depends
on the firing of event SecurityPolicyViolationEvent, which is disabled as of the time of writing.
We will enable the firing of this event in <https://bugs.webkit.org/show_bug.cgi?id=154522>.
Repurpose test name base-uri-deny.html to test that the base-uri directive prevents the use of
document base URL without depending on the firing of event SecurityPolicyViolationEvent.

Additionally, add test http/tests/security/contentSecurityPolicy/1.1/base-uri-default-ignored.html
to ensure that we do not fall back to enforcing the default-src directive in absence of
a base-uri directive as per section base-uri of the Content Security Policy 2.0 spec.,
<https://www.w3.org/TR/2015/CR-CSP2-20150721/>.

* TestExpectations:
* http/tests/security/contentSecurityPolicy/1.1/base-uri-default-ignored-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/base-uri-default-ignored.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/base-uri-deny-expected.txt:
* http/tests/security/contentSecurityPolicy/1.1/base-uri-deny.html: Repurpose test.
* http/tests/security/contentSecurityPolicy/1.1/resources/base-href/resources/safe-script.js: Added.
* http/tests/security/contentSecurityPolicy/1.1/resources/safe-script.js: Added.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-base-uri-deny-expected.txt: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/1.1/base-uri-deny-expected.txt.
* http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-base-uri-deny.html: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/1.1/base-uri-deny.html.
* http/tests/security/contentSecurityPolicy/source-list-parsing-no-semicolon-expected.txt: Update expected result based on change to test (below).
* http/tests/security/contentSecurityPolicy/source-list-parsing-no-semicolon.html: Modified to test that we emit
a console warning when base-uri is used as a source expression.

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

5 years agoAdd a mechanism to automatically ramp up timer alignment.
barraclough@apple.com [Wed, 24 Feb 2016 00:32:40 +0000 (00:32 +0000)]
Add a mechanism to automatically ramp up timer alignment.
https://bugs.webkit.org/show_bug.cgi?id=154578

Reviewed by Antti Koivisto & Chris Dumez.

Allow timer alignment duration to be proportional to the time the page
has been hidden. This implementation does so by scaling up the throttle
in exponential steps, spaced exponentially far apart.

* page/Page.cpp:
(WebCore::Page::Page):
    - initialize timer.
(WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged):
    - if setting are changed fully disable/reenable to ensure new setting are read.
(WebCore::Page::setTimerThrottlingEnabled):
    - enebled bool flag converted to an Optional<double>, tracking time throttling
      is enabled.
(WebCore::Page::setDOMTimerAlignmentInterval):
    - when new mechanism is enabled schedule a timer to step up alignment.
(WebCore::Page::timerAlignmentIntervalIncreaseTimerFired):
    - when timer fires increase alignment.
* page/Page.h:
    - added new member.
* page/Settings.cpp:
(WebCore::Settings::Settings):
    - initialize new member.
(WebCore::Settings::setHiddenPageDOMTimerThrottlingAutoIncreaseLimit):
    - added, update new setting. Setting to zero disabled. A non-zero value is a
      duration in seconds for timer throttling to ramp up to.
* page/Settings.h:
(WebCore::Settings::hiddenPageDOMTimerThrottlingAutoIncreases):
    - read as boolean whether throttle increasing is enabled.
(WebCore::Settings::hiddenPageDOMTimerThrottlingAutoIncreaseLimit):
    - read throttle increasing limit.

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

5 years agoRefactor script that updates fullscreen buttons.
adachan@apple.com [Wed, 24 Feb 2016 00:30:48 +0000 (00:30 +0000)]
Refactor script that updates fullscreen buttons.
https://bugs.webkit.org/show_bug.cgi?id=154562

Reviewed by Dean Jackson.

Also expose extra property and element in getCurrentControlsStatus() for future testing.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller.prototype.updatePictureInPictureButton):
(Controller.prototype.updateFullscreenButtons):

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

5 years agoWKWebView should implement NSCoding
andersca@apple.com [Wed, 24 Feb 2016 00:20:01 +0000 (00:20 +0000)]
WKWebView should implement NSCoding
https://bugs.webkit.org/show_bug.cgi?id=137160
Source/WebKit2:

rdar://problem/17380562

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKUserContentController.mm:
(-[WKUserContentController initWithCoder:]):
We need to call [self init] here, so that the wrapper will be initialized.

* UIProcess/API/Cocoa/WKWebView.h:
-initWithCoder: shouldn't be unavailable, it should be a designated initializer.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
Move initialization out into a common method.

(-[WKWebView initWithFrame:configuration:]):
Call -initializeWithConfiguration: here.

(-[WKWebView initWithCoder:]):
Decode everything.

(-[WKWebView encodeWithCoder:]):
Encode everything.

Tools:

Reviewed by Dan Bernstein.

Add tests.

* TestWebKitAPI/Tests/WebKit2Cocoa/Coding.mm:
(TEST):

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

5 years agoFix an API test.
andersca@apple.com [Tue, 23 Feb 2016 23:41:53 +0000 (23:41 +0000)]
Fix an API test.

* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::defaultDataStore):
Make sure to initialize WebKit2.

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

5 years agoWKWebViewConfiguration should encode more of its properties
andersca@apple.com [Tue, 23 Feb 2016 23:05:20 +0000 (23:05 +0000)]
WKWebViewConfiguration should encode more of its properties
https://bugs.webkit.org/show_bug.cgi?id=154611

Reviewed by Sam Weinig.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):

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

5 years agoJSC stress tests' standalone-pre.js should exit on the first failure by default
keith_miller@apple.com [Tue, 23 Feb 2016 23:03:35 +0000 (23:03 +0000)]
JSC stress tests' standalone-pre.js should exit on the first failure by default
https://bugs.webkit.org/show_bug.cgi?id=154565

Reviewed by Mark Lam.

Currently, if a test writer does not call finishJSTest() at the end of
any test using stress/resources/standalone-pre.js then the test can fail
without actually reporting an error to the harness. By default, we
should throw on the first error so, in the event someone does not call
finishJSTest() the harness will still notice the error.

* tests/stress/regress-151324.js:
* tests/stress/resources/standalone-pre.js:
(testFailed):

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

5 years agoWKUserContentController should conform to NSCoding
andersca@apple.com [Tue, 23 Feb 2016 22:54:04 +0000 (22:54 +0000)]
WKUserContentController should conform to NSCoding
https://bugs.webkit.org/show_bug.cgi?id=154609

Reviewed by Sam Weinig.

Since we just want to be able to encode WKUserContentController from WKWebViewConfiguration,
we don't encode anything inside WKUserContentController.

* UIProcess/API/Cocoa/WKUserContentController.h:
* UIProcess/API/Cocoa/WKUserContentController.mm:
(-[WKUserContentController encodeWithCoder:]):
(-[WKUserContentController initWithCoder:]):

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

5 years agoMake JSObject::getMethod have fewer branches
sbarati@apple.com [Tue, 23 Feb 2016 22:41:26 +0000 (22:41 +0000)]
Make JSObject::getMethod have fewer branches
https://bugs.webkit.org/show_bug.cgi?id=154603

Reviewed by Mark Lam.

Writing code with fewer branches is almost always better.

* runtime/JSObject.cpp:
(JSC::JSObject::getMethod):

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

5 years agoCalling importNode on shadow root causes a crash
rniwa@webkit.org [Tue, 23 Feb 2016 22:35:44 +0000 (22:35 +0000)]
Calling importNode on shadow root causes a crash
https://bugs.webkit.org/show_bug.cgi?id=154570

Reviewed by Anders Carlsson.

Source/WebCore:

The bug was caused by a missing check in cloneNode. Added cloneNodeForBindings to explicitly throw
an NotSupportedError when it's called on a shadow root. We don't clone shadow root when deep-cloning
the tree so we don't have to check that condition.

The behavior of cloneNode is specified at:
http://w3c.github.io/webcomponents/spec/shadow/#the-shadowroot-interface
(it current says we should throw DATA_CLONE_ERR but I have an spec bug filed at
https://github.com/w3c/webcomponents/issues/393)

The behavior of importNode and adoptNode are specified in DOM4 specification:
https://dom.spec.whatwg.org/#dom-document-importnode
https://dom.spec.whatwg.org/#dom-document-adoptnode

Tests: fast/shadow-dom/Document-prototype-adoptNode.html
       fast/shadow-dom/Document-prototype-importNode.html
       fast/shadow-dom/Node-prototype-cloneNode.html

* dom/Document.cpp:
(WebCore::Document::importNode): Throw NotSupportedError when importing a shadow root.
* dom/Node.cpp:
(WebCore::Node::cloneNodeForBindings): Added.
* dom/Node.h:
* dom/Node.idl: Use cloneNodeForBindings here.

LayoutTests:

Added W3C-style testharness tests for calling cloneNode on a shadow root.

Also added tests for adoptNode and importNode.

* fast/shadow-dom/Document-prototype-adoptNode-expected.txt: Added.
* fast/shadow-dom/Document-prototype-adoptNode.html: Added.
* fast/shadow-dom/Document-prototype-importNode-expected.txt: Added.
* fast/shadow-dom/Document-prototype-importNode.html: Added.
* fast/shadow-dom/Node-prototype-cloneNode-expected.txt: Added.
* fast/shadow-dom/Node-prototype-cloneNode.html: Added.

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

5 years agoWKProcessPool should conform to NSCoding
andersca@apple.com [Tue, 23 Feb 2016 22:29:01 +0000 (22:29 +0000)]
WKProcessPool should conform to NSCoding
https://bugs.webkit.org/show_bug.cgi?id=154608

Reviewed by Sam Weinig.

Source/WebKit2:

Add +[WKProcessPool _sharedProcessPool] and encode/decode whether the process pool is shared.

* UIProcess/API/Cocoa/WKProcessPool.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool encodeWithCoder:]):
(-[WKProcessPool initWithCoder:]):
(+[WKProcessPool _sharedProcessPool]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

Tools:

Add tests.

* TestWebKitAPI/Tests/WebKit2Cocoa/Coding.mm:
(TEST):

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

5 years agoB3::Value doesn't self-destruct virtually enough (Causes many leaks in LowerDFGToB3...
fpizlo@apple.com [Tue, 23 Feb 2016 22:17:24 +0000 (22:17 +0000)]
B3::Value doesn't self-destruct virtually enough (Causes many leaks in LowerDFGToB3::appendOSRExit)
https://bugs.webkit.org/show_bug.cgi?id=154592

Reviewed by Saam Barati.

If Foo has a virtual destructor, then:

foo->Foo::~Foo() does a non-virtual call to Foo's destructor. Even if foo points to a
subclass of Foo that overrides the destructor, this syntax will not call that override.

foo->~Foo() does a virtual call to the destructor, and so if foo points to a subclass, you
get the subclass's override.

In B3, we used this->Value::~Value() thinking that it would call the subclass's override.
This caused leaks because this didn't actually call the subclass's override. This fixes the
problem by using this->~Value() instead.

* b3/B3ControlValue.cpp:
(JSC::B3::ControlValue::convertToJump):
(JSC::B3::ControlValue::convertToOops):
* b3/B3Value.cpp:
(JSC::B3::Value::replaceWithIdentity):
(JSC::B3::Value::replaceWithNop):
(JSC::B3::Value::replaceWithPhi):

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

5 years agoWKWebsiteDataStore should conform to NSCoding
andersca@apple.com [Tue, 23 Feb 2016 22:08:09 +0000 (22:08 +0000)]
WKWebsiteDataStore should conform to NSCoding
https://bugs.webkit.org/show_bug.cgi?id=154605

Reviewed by Dan Bernstein.

Source/WebKit2:

* UIProcess/API/Cocoa/WKWebsiteDataStore.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore initWithCoder:]):
(-[WKWebsiteDataStore encodeWithCoder:]):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/Coding.mm:
(TEST):

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

5 years agoFix iOS build.
andersca@apple.com [Tue, 23 Feb 2016 21:49:47 +0000 (21:49 +0000)]
Fix iOS build.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration initWithCoder:]):

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

5 years agoWeb Inspector: the protocol generator's Objective-C name prefix should be configurable
bburg@apple.com [Tue, 23 Feb 2016 21:49:43 +0000 (21:49 +0000)]
Web Inspector: the protocol generator's Objective-C name prefix should be configurable
https://bugs.webkit.org/show_bug.cgi?id=154596
<rdar://problem/24794962>

Reviewed by Timothy Hatcher.

In order to support different generated protocol sets that don't have conflicting
file and type names, allow the Objective-C prefix to be configurable based on the
target framework. Each name also has the implicit prefix 'Protocol' appended to the
per-target framework prefix.

For example, the existing protocol for remote inspection has the prefix 'RWI'
and is generated as 'RWIProtocol'. The WebKit framework has the 'Automation' prefix
and is generated as 'AutomationProtocol'.

To make this change, convert ObjCGenerator to be a subclass of Generator and use
the instance method model() to find the target framework and its setting for
'objc_prefix'. Make all ObjC generators subclass ObjCGenerator so they can use
these instance methods that used to be static methods. This is a large but
mechanical change to use self instead of ObjCGenerator.

* inspector/scripts/codegen/generate_objc_backend_dispatcher_header.py:
(ObjCBackendDispatcherHeaderGenerator):
(ObjCBackendDispatcherHeaderGenerator.__init__):
(ObjCBackendDispatcherHeaderGenerator.output_filename):
(ObjCBackendDispatcherHeaderGenerator._generate_objc_forward_declarations):
(ObjCBackendDispatcherHeaderGenerator._generate_objc_handler_declarations_for_domain):
* inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py:
(ObjCConfigurationImplementationGenerator):
(ObjCConfigurationImplementationGenerator.__init__):
(ObjCConfigurationImplementationGenerator.output_filename):
(ObjCConfigurationImplementationGenerator.generate_output):
(ObjCConfigurationImplementationGenerator._generate_success_block_for_command):
(ObjCConfigurationImplementationGenerator._generate_success_block_for_command.and):
(ObjCConfigurationImplementationGenerator._generate_conversions_for_command):
* inspector/scripts/codegen/generate_objc_configuration_header.py:
(ObjCConfigurationHeaderGenerator):
(ObjCConfigurationHeaderGenerator.__init__):
(ObjCConfigurationHeaderGenerator.output_filename):
(ObjCConfigurationHeaderGenerator.generate_output):
(ObjCConfigurationHeaderGenerator._generate_configuration_interface_for_domains):
(ObjCConfigurationHeaderGenerator._generate_properties_for_domain):
* inspector/scripts/codegen/generate_objc_configuration_implementation.py:
(ObjCBackendDispatcherImplementationGenerator):
(ObjCBackendDispatcherImplementationGenerator.__init__):
(ObjCBackendDispatcherImplementationGenerator.output_filename):
(ObjCBackendDispatcherImplementationGenerator.generate_output):
(ObjCBackendDispatcherImplementationGenerator._generate_configuration_implementation_for_domains):
(ObjCBackendDispatcherImplementationGenerator._generate_ivars):
(ObjCBackendDispatcherImplementationGenerator._generate_handler_setter_for_domain):
(ObjCBackendDispatcherImplementationGenerator._generate_event_dispatcher_getter_for_domain):
* inspector/scripts/codegen/generate_objc_conversion_helpers.py:
(ObjCConversionHelpersGenerator):
(ObjCConversionHelpersGenerator.__init__):
(ObjCConversionHelpersGenerator.output_filename):
(ObjCConversionHelpersGenerator.generate_output):
(ObjCConversionHelpersGenerator._generate_anonymous_enum_conversion_for_declaration):
(ObjCConversionHelpersGenerator._generate_anonymous_enum_conversion_for_member):
(ObjCConversionHelpersGenerator._generate_anonymous_enum_conversion_for_parameter):
* inspector/scripts/codegen/generate_objc_frontend_dispatcher_implementation.py:
(ObjCFrontendDispatcherImplementationGenerator):
(ObjCFrontendDispatcherImplementationGenerator.__init__):
(ObjCFrontendDispatcherImplementationGenerator.output_filename):
(ObjCFrontendDispatcherImplementationGenerator.generate_output):
(ObjCFrontendDispatcherImplementationGenerator._generate_event_dispatcher_implementations):
(ObjCFrontendDispatcherImplementationGenerator._generate_event):
(ObjCFrontendDispatcherImplementationGenerator._generate_event.and):
(ObjCFrontendDispatcherImplementationGenerator._generate_event_signature):
(ObjCFrontendDispatcherImplementationGenerator._generate_event_out_parameters):
* inspector/scripts/codegen/generate_objc_header.py:
(ObjCHeaderGenerator):
(ObjCHeaderGenerator.__init__):
(ObjCHeaderGenerator.output_filename):
(ObjCHeaderGenerator.generate_output):
(ObjCHeaderGenerator._generate_forward_declarations):
(ObjCHeaderGenerator._generate_anonymous_enum_for_declaration):
(ObjCHeaderGenerator._generate_anonymous_enum_for_member):
(ObjCHeaderGenerator._generate_anonymous_enum_for_parameter):
(ObjCHeaderGenerator._generate_type_interface):
(ObjCHeaderGenerator._generate_init_method_for_required_members):
(ObjCHeaderGenerator._generate_member_property):
(ObjCHeaderGenerator._generate_command_protocols):
(ObjCHeaderGenerator._generate_single_command_protocol):
(ObjCHeaderGenerator._callback_block_for_command):
(ObjCHeaderGenerator._generate_event_interfaces):
(ObjCHeaderGenerator._generate_single_event_interface):
* inspector/scripts/codegen/generate_objc_internal_header.py:
(ObjCInternalHeaderGenerator):
(ObjCInternalHeaderGenerator.__init__):
(ObjCInternalHeaderGenerator.output_filename):
(ObjCInternalHeaderGenerator.generate_output):
(ObjCInternalHeaderGenerator._generate_event_dispatcher_private_interfaces):
* inspector/scripts/codegen/generate_objc_protocol_types_implementation.py:
(ObjCProtocolTypesImplementationGenerator):
(ObjCProtocolTypesImplementationGenerator.__init__):
(ObjCProtocolTypesImplementationGenerator.output_filename):
(ObjCProtocolTypesImplementationGenerator.generate_output):
(ObjCProtocolTypesImplementationGenerator.generate_type_implementation):
(ObjCProtocolTypesImplementationGenerator._generate_init_method_for_required_members):
(ObjCProtocolTypesImplementationGenerator._generate_init_method_for_required_members.and):
(ObjCProtocolTypesImplementationGenerator._generate_setter_for_member):
(ObjCProtocolTypesImplementationGenerator._generate_setter_for_member.and):
(ObjCProtocolTypesImplementationGenerator._generate_getter_for_member):
* inspector/scripts/codegen/models.py:
* inspector/scripts/codegen/objc_generator.py:
(ObjCTypeCategory.category_for_type):
(ObjCGenerator):
(ObjCGenerator.__init__):
(ObjCGenerator.objc_prefix):
(ObjCGenerator.objc_name_for_type):
(ObjCGenerator.objc_enum_name_for_anonymous_enum_declaration):
(ObjCGenerator.objc_enum_name_for_anonymous_enum_member):
(ObjCGenerator.objc_enum_name_for_anonymous_enum_parameter):
(ObjCGenerator.objc_enum_name_for_non_anonymous_enum):
(ObjCGenerator.objc_class_for_type):
(ObjCGenerator.objc_class_for_array_type):
(ObjCGenerator.objc_accessor_type_for_member):
(ObjCGenerator.objc_accessor_type_for_member_internal):
(ObjCGenerator.objc_type_for_member):
(ObjCGenerator.objc_type_for_member_internal):
(ObjCGenerator.objc_type_for_param):
(ObjCGenerator.objc_type_for_param_internal):
(ObjCGenerator.objc_protocol_export_expression_for_variable):
(ObjCGenerator.objc_protocol_import_expression_for_member):
(ObjCGenerator.objc_protocol_import_expression_for_parameter):
(ObjCGenerator.objc_protocol_import_expression_for_variable):
(ObjCGenerator.objc_to_protocol_expression_for_member):
(ObjCGenerator.protocol_to_objc_expression_for_member):

Change the prefix for the 'Test' target framework to be 'Test.' Rebaseline results.

* inspector/scripts/tests/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/expected/domains-with-varying-command-sizes.json-result:
* inspector/scripts/tests/expected/enum-values.json-result:
* inspector/scripts/tests/expected/events-with-optional-parameters.json-result:
* inspector/scripts/tests/expected/generate-domains-with-feature-guards.json-result:
* inspector/scripts/tests/expected/same-type-id-different-domain.json-result:
* inspector/scripts/tests/expected/shadowed-optional-type-setters.json-result:
* inspector/scripts/tests/expected/type-declaration-aliased-primitive-type.json-result:
* inspector/scripts/tests/expected/type-declaration-array-type.json-result:
* inspector/scripts/tests/expected/type-declaration-enum-type.json-result:
* inspector/scripts/tests/expected/type-declaration-object-type.json-result:
* inspector/scripts/tests/expected/type-requiring-runtime-casts.json-result:

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

5 years agoREGRESSION (r196892): No longer emit error message when CSP form-action directive...
dbates@webkit.org [Tue, 23 Feb 2016 21:32:52 +0000 (21:32 +0000)]
REGRESSION (r196892): No longer emit error message when CSP form-action directive is used as a source expression
https://bugs.webkit.org/show_bug.cgi?id=154555
<rdar://problem/24776777>

Reviewed by Andy Estes.

Source/WebCore:

Fixes an issue where an error message is not emitted when directive form-action is used as a
source expression. Prior to <http://trac.webkit.org/changeset/196892>, when directive form-action
was used as a source expression a console error message would be emitted with the form:

    The Content Security Policy directive 'script-src' contains 'form-action' as a source expression.
    Did you mean 'script-src ...; form-action...' (note the semicolon)?

* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::isCSPDirectiveName): Return true if the specified directive name is "form-action".

LayoutTests:

Test that we emit a console error message when form-action is used as a source expression.

* http/tests/security/contentSecurityPolicy/source-list-parsing-no-semicolon-expected.txt:
* http/tests/security/contentSecurityPolicy/source-list-parsing-no-semicolon.html: Use form-action as a
source expression. Also, use a double quoted (") string literal instead of a single quoted (') string
literal to represent the CSP policy so as to avoid the need to escape embedded single quote characters.

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

5 years agoLay the groundwork for more constness in StyleResolver-related code
simon.fraser@apple.com [Tue, 23 Feb 2016 21:18:05 +0000 (21:18 +0000)]
Lay the groundwork for more constness in StyleResolver-related code
https://bugs.webkit.org/show_bug.cgi?id=154598

Reviewed by Antti Koivisto.

Make some of the leaf functions that are used by the style resolver take
const CSSValues, and use 'auto' more to automatically get const stack variables
when appropriate.

* css/CSSBorderImageSliceValue.h:
(WebCore::CSSBorderImageSliceValue::slices):
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isQuirkValue):
* css/FontVariantBuilder.cpp:
(WebCore::extractFontVariantLigatures):
(WebCore::extractFontVariantNumeric):
(WebCore::extractFontVariantEastAsian):
* css/FontVariantBuilder.h:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertReflection):
(WebCore::StyleBuilderConverter::convertGridAutoFlow):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueSize):
(WebCore::StyleBuilderCustom::applyValueStroke):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValueIsDerivedFromElement):
(WebCore::StyleResolver::colorFromPrimitiveValue):
(WebCore::StyleResolver::createFilterOperations):
* css/StyleResolver.h:
* css/TransformFunctions.cpp:
(WebCore::transformsForValue):
* css/TransformFunctions.h:
* rendering/style/StylePendingImage.h:
* svg/SVGLength.cpp:
(WebCore::SVGLength::fromCSSPrimitiveValue):
* svg/SVGLength.h:

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

5 years agoWKWebViewConfiguration should conform to NSCoding
andersca@apple.com [Tue, 23 Feb 2016 21:17:18 +0000 (21:17 +0000)]
WKWebViewConfiguration should conform to NSCoding
https://bugs.webkit.org/show_bug.cgi?id=154602

Reviewed by Beth Dakin.

Source/WebKit2:

* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/Coding.mm:
(TEST):

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

5 years agoAdd tests for fast click change in r196679
dino@apple.com [Tue, 23 Feb 2016 20:38:37 +0000 (20:38 +0000)]
Add tests for fast click change in r196679
https://bugs.webkit.org/show_bug.cgi?id=154568
<rdar://problem/24782479>

Reviewed by Myles Maxfield.

Bug http://webkit.org/b/154318 made some changes to the fast
click behaviour, but didn't include any tests. Here they are!

* fast/events/ios/fast-click-double-tap-sends-click-expected.txt: Added.
* fast/events/ios/fast-click-double-tap-sends-click.html: Checks that a double tap on a clickable element sends a click.
* fast/events/ios/fast-click-double-tap-zooms-on-image-expected.txt: Added.
* fast/events/ios/fast-click-double-tap-zooms-on-image.html: Checks that a double tap on an image can trigger a zoom if there
isn't anything else listening.
* fast/events/ios/fast-click-double-tap-zooms-on-text-expected.txt: Added.
* fast/events/ios/fast-click-double-tap-zooms-on-text.html: Checks that a double tap on a block of text can trigger a zoom
if there isn't anything else listening.
* fast/events/ios/no-fast-click-double-tap-causes-zoom-expected.txt: Added.
* fast/events/ios/no-fast-click-double-tap-causes-zoom.html: When we are not in fast click mode, a double tap should
trigger a zoom. This is checking the inverse behaviour to fast-click-double-tap-sends-click.
* fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html: Removed some code that could never be called.
* fast/events/ios/viewport-zooms-from-element-to-initial-scale.html: Ditto.
* platform/ios-simulator/TestExpectations: Add the new tests.

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

5 years agoREGRESSION (r192251): http/tests/navigation/page-cache-xhr.html is flaky
ap@apple.com [Tue, 23 Feb 2016 20:09:07 +0000 (20:09 +0000)]
REGRESSION (r192251): http/tests/navigation/page-cache-xhr.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=154589

Reviewed by Youenn Fablet.

* http/tests/navigation/page-cache-xhr.html: Load a file that exists. The content
doesn't matter, as we expect to navigate away before the load occurs.

* http/tests/resources/load-and-stall.cgi: Added cache control, just for a good measure.

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

5 years agoWKPreferences should conform to NSCoding
andersca@apple.com [Tue, 23 Feb 2016 20:04:36 +0000 (20:04 +0000)]
WKPreferences should conform to NSCoding
https://bugs.webkit.org/show_bug.cgi?id=154597

Reviewed by Sam Weinig.

Source/WebKit2:

Add NSCoding implementation.

* UIProcess/API/Cocoa/WKPreferences.h:
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences encodeWithCoder:]):
(-[WKPreferences initWithCoder:]):

Tools:

Test encoding and decoding WKPreferences.

* TestWebKitAPI/Tests/WebKit2Cocoa/Coding.mm:
(encodeAndDecode):
(TEST):

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

5 years agoDebug assertion failure while loading http://kangax.github.io/compat-table/es6/.
mark.lam@apple.com [Tue, 23 Feb 2016 19:41:56 +0000 (19:41 +0000)]
Debug assertion failure while loading kangax.github.io/compat-table/es6/.
https://bugs.webkit.org/show_bug.cgi?id=154542

Reviewed by Saam Barati.

Source/JavaScriptCore:

According to the spec, the constructors of the following types "are not intended
to be called as a function and will throw an exception".  These types are:
    TypedArrays - https://tc39.github.io/ecma262/#sec-typedarray-constructors
    Map - https://tc39.github.io/ecma262/#sec-map-constructor
    Set - https://tc39.github.io/ecma262/#sec-set-constructor
    WeakMap - https://tc39.github.io/ecma262/#sec-weakmap-constructor
    WeakSet - https://tc39.github.io/ecma262/#sec-weakset-constructor
    ArrayBuffer - https://tc39.github.io/ecma262/#sec-arraybuffer-constructor
    DataView - https://tc39.github.io/ecma262/#sec-dataview-constructor
    Promise - https://tc39.github.io/ecma262/#sec-promise-constructor
    Proxy - https://tc39.github.io/ecma262/#sec-proxy-constructor

This patch does the foillowing:
1. Ensures that these constructors can be called but will throw a TypeError
   when called.
2. Makes all these objects use throwConstructorCannotBeCalledAsFunctionTypeError()
   in their implementation to be consistent.
3. Change the error message to "calling XXX constructor without new is invalid".
   This is clearer because the error is likely due to the user forgetting to use
   the new operator on these constructors.

* runtime/Error.h:
* runtime/Error.cpp:
(JSC::throwConstructorCannotBeCalledAsFunctionTypeError):
- Added a convenience function to throw the TypeError.

* runtime/JSArrayBufferConstructor.cpp:
(JSC::constructArrayBuffer):
(JSC::callArrayBuffer):
(JSC::JSArrayBufferConstructor::getCallData):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::callGenericTypedArrayView):
(JSC::JSGenericTypedArrayViewConstructor<ViewClass>::getCallData):
* runtime/JSPromiseConstructor.cpp:
(JSC::callPromise):
* runtime/MapConstructor.cpp:
(JSC::callMap):
* runtime/ProxyConstructor.cpp:
(JSC::callProxy):
(JSC::ProxyConstructor::getCallData):
* runtime/SetConstructor.cpp:
(JSC::callSet):
* runtime/WeakMapConstructor.cpp:
(JSC::callWeakMap):
* runtime/WeakSetConstructor.cpp:
(JSC::callWeakSet):

* tests/es6.yaml:
- The typed_arrays_%TypedArray%[Symbol.species].js test now passes.

* tests/stress/call-non-calleable-constructors-as-function.js: Added.
(test):

* tests/stress/map-constructor.js:
(testCallTypeError):
* tests/stress/promise-cannot-be-called.js:
(shouldThrow):
* tests/stress/proxy-basic.js:
* tests/stress/set-constructor.js:
* tests/stress/throw-from-ftl-call-ic-slow-path-cells.js:
(i.catch):
* tests/stress/throw-from-ftl-call-ic-slow-path-undefined.js:
(i.catch):
* tests/stress/throw-from-ftl-call-ic-slow-path.js:
(i.catch):
* tests/stress/weak-map-constructor.js:
(testCallTypeError):
* tests/stress/weak-set-constructor.js:
- Updated error message string.

LayoutTests:

* js/Promise-types-expected.txt:
* js/basic-map-expected.txt:
* js/basic-set-expected.txt:
* js/dom/basic-weakmap-expected.txt:
* js/dom/basic-weakset-expected.txt:
* js/script-tests/Promise-types.js:
* js/typedarray-constructors-expected.txt:
- Updated error message string.

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

5 years agoASan build fix.
ap@apple.com [Tue, 23 Feb 2016 19:38:33 +0000 (19:38 +0000)]
ASan build fix.

Let's not export a template function that is only used in InspectorBackendDispatcher.cpp.

* inspector/InspectorBackendDispatcher.h:

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

5 years agoImplement downloads with NetworkSession
achristensen@apple.com [Tue, 23 Feb 2016 19:13:18 +0000 (19:13 +0000)]
Implement downloads with NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=154473

Reviewed by Brady Eidson.

* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::~Download):
(WebKit::Download::didStart):
(WebKit::Download::shouldDecodeSourceDataOfMIMEType):
(WebKit::Download::decideDestinationWithSuggestedFilename):
(WebKit::Download::didCreateDestination):
* NetworkProcess/Downloads/Download.h:
(WebKit::Download::downloadID):
(WebKit::Download::setSandboxExtension):
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload):
(WebKit::DownloadManager::dataTaskBecameDownloadTask):
(WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
(WebKit::DownloadManager::continueWillSendRequest):
(WebKit::DownloadManager::willDecidePendingDownloadDestination):
(WebKit::DownloadManager::continueDecidePendingDownloadDestination):
(WebKit::DownloadManager::convertHandleToDownload):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::clearClient):

NetworkDataTasks can now outlive their client, so we need to make client a pointer
with the ability to be nulled from the client's destructor.

(WebKit::NetworkDataTask::pendingDownloadID):
(WebKit::NetworkDataTask::pendingDownload):
(WebKit::NetworkDataTask::setPendingDownload):
(WebKit::NetworkDataTask::pendingDownloadLocation):
(WebKit::NetworkDataTask::client): Deleted.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::~NetworkLoad):
(WebKit::NetworkLoad::convertTaskToDownload):
(WebKit::NetworkLoad::setPendingDownloadID):
(WebKit::NetworkLoad::didReceiveResponseNetworkSession):

Don't call the didReceiveResponse completion handler immediately when we know we are
going to turn the load into a download.  Instead, save the completion handler until
after we have determined the download destination and set it in the NetworkDataTask.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::continueWillSendRequest):
(WebKit::NetworkProcess::findPendingDownloadLocation):
(WebKit::NetworkProcess::continueDecidePendingDownloadDestination):
(WebKit::NetworkProcess::setCacheModel):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTask::NetworkDataTask):
(WebKit::NetworkDataTask::~NetworkDataTask):
(WebKit::NetworkDataTask::didSendData):
(WebKit::NetworkDataTask::didReceiveChallenge):
(WebKit::NetworkDataTask::didCompleteWithError):
(WebKit::NetworkDataTask::didReceiveResponse):
(WebKit::NetworkDataTask::didReceiveData):
(WebKit::NetworkDataTask::didBecomeDownload):
(WebKit::NetworkDataTask::willPerformHTTPRedirection):
(WebKit::NetworkDataTask::scheduleFailure):
(WebKit::NetworkDataTask::failureTimerFired):
(WebKit::NetworkDataTask::findPendingDownloadLocation):
(WebKit::NetworkDataTask::setPendingDownloadLocation):
(WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
(WebKit::NetworkDataTask::transferSandboxExtensionToDownload):
(WebKit::NetworkDataTask::currentRequest):
(WebKit::NetworkDataTask::cancel):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):

This delegate callback is used for downloads, too.

(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
(-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):

Call didCreateDestination now, which is after the file has been opened on the disk.
A DownloadProxy::DidStart message is now sent from NetworkProcess::findPendingDownloadLocation before
we ask the UIProcess where the download should end up on disk.
Null check the NetworkDataTask's client before using it because it is now a pointer that could be null.

* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::shouldDecodeSourceDataOfMIMEType):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
(WebKit::DownloadProxy::didCreateDestination):
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxy.messages.in:

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

5 years ago[css-grid] Avoid duplicated calls to resolution code
rego@igalia.com [Tue, 23 Feb 2016 18:17:17 +0000 (18:17 +0000)]
[css-grid] Avoid duplicated calls to resolution code
https://bugs.webkit.org/show_bug.cgi?id=154336

Reviewed by Sergio Villar Senin.

We were calling GridResolvedPosition::resolveGridPositionsFromStyle()
several times per item.

We can store the GridCoordinates in
RenderGrid::populateExplicitGridAndOrderIterator()
and reuse them in the placement code.
Once RenderGrid::placeItemsOnGrid() is over,
all the items will have a definite position in both axis.

No new tests, no change of behavior.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::insertItemIntoGrid):
(WebCore::RenderGrid::placeItemsOnGrid):
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
(WebCore::RenderGrid::cachedGridCoordinate):
(WebCore::RenderGrid::cachedGridSpan):
* rendering/RenderGrid.h:

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

5 years agoFix build.
andersca@apple.com [Tue, 23 Feb 2016 17:57:46 +0000 (17:57 +0000)]
Fix build.

* TestWebKitAPI/mac/SyntheticBackingScaleFactorWindow.m:
(-[SyntheticBackingScaleFactorWindow initWithContentRect:styleMask:backing:defer:]):

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

5 years agoUnreviewed change to revert extraneous changes made part of change set 196955.
msaboff@apple.com [Tue, 23 Feb 2016 17:42:12 +0000 (17:42 +0000)]
Unreviewed change to revert extraneous changes made part of change set 196955.

* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::doMallocOp):
(Interpreter::Thread::switchTo):
(writeData): Deleted.

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

5 years agoConnect WebAutomationSession to its backend dispatcher as if it were an agent and...
bburg@apple.com [Tue, 23 Feb 2016 17:40:20 +0000 (17:40 +0000)]
Connect WebAutomationSession to its backend dispatcher as if it were an agent and add stub implementations
https://bugs.webkit.org/show_bug.cgi?id=154518
<rdar://problem/24761096>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/InspectorBackendDispatcher.h:
Export all the classes since they are used by WebKit::WebAutomationSession.

Source/WebKit2:

Add a domain dispatcher for the 'Automation' domain, and register the
WebAutomationSession itself as the handler for Automation commands.
Stub out these command implementations so the code will compile.

* UIProcess/Automation/Automation.json:
Fix the createWindow command's parameters and description.
Add an ErrorMessage string enumeration and document how it can be used
to signal well-known errors to the frontend.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::WebAutomationSession):
Add the domain backend dispatcher. It further parses commands that were deemed
valid by the generic dispatcher and match the 'Automation' domain prefix.

(WebKit::WebAutomationSession::getWindows):
(WebKit::WebAutomationSession::openWindow):
(WebKit::WebAutomationSession::closeWindow):
Stub these out with our new ErrorMessage enumeration and a macro to
make this code pattern more readable.

* UIProcess/Automation/WebAutomationSession.h:
Add new declarations and members.

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

5 years ago[GTK] Allow to run the WebKitGTK+ MiniBrowser with the run-benchmark script.
clopez@igalia.com [Tue, 23 Feb 2016 17:38:38 +0000 (17:38 +0000)]
[GTK] Allow to run the WebKitGTK+ MiniBrowser with the run-benchmark script.
https://bugs.webkit.org/show_bug.cgi?id=153993

Reviewed by Carlos Garcia Campos.

* MiniBrowser/gtk/main.c:
(createBrowserWindow): Support --geometry argument for MiniBrowser.
We use this on the gtk_minibrowser_driver script to start the MiniBrowser maximized.
* Scripts/webkitpy/benchmark_runner/browser_driver/__init__.py: Fix loading of subclasses:
The base class has to be loaded first, otherwise any subclase referencing it will give import error.
In OSX the ordering of os.listdir() causes the base class (browser_driver.py) to be first on the list, but not on Linux.
By specifiying the name of the base class file, we ensure it is always loaded first on any system despite the ordering of listdir.
* Scripts/webkitpy/benchmark_runner/browser_driver/browser_driver_factory.py:
(BrowserDriverFactory.create):
* Scripts/webkitpy/benchmark_runner/browser_driver/gtk_browser_driver.py: Added.
(GTKBrowserDriver):
(GTKBrowserDriver.prepare_env):
(GTKBrowserDriver.restore_env):
(GTKBrowserDriver.close_browsers):
(GTKBrowserDriver._launch_process):
(GTKBrowserDriver._terminate_processes):
(GTKBrowserDriver._screen_size):
* Scripts/webkitpy/benchmark_runner/browser_driver/gtk_minibrowser_driver.py: Added.
(GTKMiniBrowserDriver):
(GTKMiniBrowserDriver.prepare_env):
(GTKMiniBrowserDriver.launch_url):
(GTKMiniBrowserDriver.close_browsers):
* Scripts/webkitpy/benchmark_runner/http_server_driver/__init__.py: Fix loading of subclasses. See description above.
* Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:
(SimpleHTTPServerDriver):
(SimpleHTTPServerDriver.kill_server): Check if the server is still running before trying to terminate it.
Usually the server ends gracefully (no need to terminate it), so this was causing ugly errors on the log.
* Scripts/webkitpy/benchmark_runner/utils.py: Fix loading of subclasses. See description above.
(load_subclasses):

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

5 years ago[css-grid] Rows track sizes are optional in grid-template shorthand
rego@igalia.com [Tue, 23 Feb 2016 16:49:54 +0000 (16:49 +0000)]
[css-grid] Rows track sizes are optional in grid-template shorthand
https://bugs.webkit.org/show_bug.cgi?id=154586

Reviewed by Sergio Villar Senin.

You can omit the size of the rows in grid-template shorthand,
even if you specify a named grid line for the end of the row,
due to a change in the spec back in 2014:
https://github.com/w3c/csswg-drafts/commit/9f660c4183c73c1f5279c46904dc6cb314f76194

Before if you want to specify a named grid line,
you need to set the row size.

Update parsing, so it nows accepts things like:
    grid-template: 100px / "a" [bottom];
Source/WebCore:

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
(WebCore::CSSParser::parseGridTemplateShorthand):

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

5 years ago[SVG] Update SVG source to return string literals as ASCIILiteral and add test cases...
commit-queue@webkit.org [Tue, 23 Feb 2016 16:30:50 +0000 (16:30 +0000)]
[SVG] Update SVG source to return string literals as ASCIILiteral and add test cases for case sensitivity
https://bugs.webkit.org/show_bug.cgi?id=154373

Patch by Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> on 2016-02-23
Reviewed by Youenn Fablet.

Source/WebCore:

Update SVGAnimatedEnumeration toString method to return ASCIILiteral for string literals and add test cases for
case-sensitivity for these elements.

Test: svg/dom/SVGAnimatedEnumeration-case-sensitive.html

* svg/SVGComponentTransferFunctionElement.h:
(WebCore::SVGPropertyTraits<ComponentTransferType>::toString):
* svg/SVGFEBlendElement.h:
(WebCore::SVGPropertyTraits<BlendMode>::toString):
* svg/SVGFEColorMatrixElement.h:
(WebCore::SVGPropertyTraits<ColorMatrixType>::toString):
* svg/SVGFECompositeElement.h:
(WebCore::SVGPropertyTraits<CompositeOperationType>::toString):
* svg/SVGFEConvolveMatrixElement.h:
(WebCore::SVGPropertyTraits<EdgeModeType>::toString):
* svg/SVGFEDisplacementMapElement.h:
(WebCore::SVGPropertyTraits<ChannelSelectorType>::toString):
* svg/SVGFEMorphologyElement.h:
(WebCore::SVGPropertyTraits<MorphologyOperatorType>::toString):
* svg/SVGFETurbulenceElement.h:
(WebCore::SVGPropertyTraits<SVGStitchOptions>::toString):
(WebCore::SVGPropertyTraits<TurbulenceType>::toString):
* svg/SVGGradientElement.h:
(WebCore::SVGPropertyTraits<SVGSpreadMethodType>::toString):
* svg/SVGMarkerElement.h:
(WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString):
* svg/SVGTextContentElement.h:
(WebCore::SVGPropertyTraits<SVGLengthAdjustType>::toString):
* svg/SVGTextPathElement.h:
(WebCore::SVGPropertyTraits<SVGTextPathMethodType>::toString):
(WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::toString):
* svg/SVGUnitTypes.h:
(WebCore::SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::toString):

LayoutTests:

Add test cases for case-sensitivity for SVGAnimatedEnumeration elements.

* svg/dom/SVGAnimatedEnumeration-case-sensitive-expected.txt: Added.
* svg/dom/SVGAnimatedEnumeration-case-sensitive.html: Added.
* svg/dom/script-tests/SVGAnimatedEnumeration-case-sensitive.js: Added.
(testCaseSensitivity):

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

5 years ago[Mac][cmake] Unreviewed speculative buildfix after r196779. Just for fun.
ossy@webkit.org [Tue, 23 Feb 2016 15:51:19 +0000 (15:51 +0000)]
[Mac][cmake] Unreviewed speculative buildfix after r196779. Just for fun.

* PlatformMac.cmake:

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

5 years agoRemove tab suspension code
antti@apple.com [Tue, 23 Feb 2016 14:36:32 +0000 (14:36 +0000)]
Remove tab suspension code
https://bugs.webkit.org/show_bug.cgi?id=154585

Reviewed by Andreas Kling.

Source/WebCore:

It causes too many problems.

* page/Page.cpp:
(WebCore::networkStateChanged):
(WebCore::Page::Page):
(WebCore::Page::setPageActivityState):
(WebCore::Page::setIsVisible):
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::setIsPrerender):
(WebCore::Page::setResourceUsageOverlayVisible):
(WebCore::Page::canTabSuspend): Deleted.
(WebCore::Page::setIsTabSuspended): Deleted.
(WebCore::Page::setTabSuspensionEnabled): Deleted.
(WebCore::Page::updateTabSuspensionState): Deleted.
(WebCore::Page::tabSuspensionTimerFired): Deleted.
* page/Page.h:
(WebCore::Page::setEditable):
(WebCore::Page::isEditable):
(WebCore::Page::setShowAllPlugins):

Source/WebKit2:

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::registerUserDefaultsIfNeeded):
(WebKit::WebProcessPool::platformInitializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

5 years ago[GTK] Missing configuration patch for openh264 compilation
commit-queue@webkit.org [Tue, 23 Feb 2016 12:22:39 +0000 (12:22 +0000)]
[GTK] Missing configuration patch for openh264 compilation
https://bugs.webkit.org/show_bug.cgi?id=154455

This patch is required for the openh264 compilation with the
jhbuild-webrtc.modules. The code was implemented by Alessandro
Decina.

Patch by Alejandro G. Castro <alex@igalia.com> on 2016-02-23
Reviewed by Philippe Normand.

* gtk/patches/openh264-configure.patch: Added.

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

5 years agoRefactor DOM Iterator next signature
youenn.fablet@crf.canon.fr [Tue, 23 Feb 2016 09:39:30 +0000 (09:39 +0000)]
Refactor DOM Iterator next signature
https://bugs.webkit.org/show_bug.cgi?id=154531

Reviewed by Myles C. Maxfield.

Covered by existing tests.

* Modules/fetch/FetchHeaders.cpp:
(WebCore::FetchHeaders::Iterator::next): Using Optional<KeyValuePair> to return iterator value.
* Modules/fetch/FetchHeaders.h:
* bindings/js/JSKeyValueIterator.h: Using Optional<KeyValuePair> as returned iterator value.
(WebCore::keyValueIteratorForEach):
(WebCore::JSKeyValueIterator<JSWrapper>::next):
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::Iterator::next): Using Optional<KeyValuePair> to return iterator value.
* css/FontFaceSet.h:

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

5 years ago[EFL] Merge WebView and WebViewEfl
ryuan.choi@navercorp.com [Tue, 23 Feb 2016 07:59:02 +0000 (07:59 +0000)]
[EFL] Merge WebView and WebViewEfl
https://bugs.webkit.org/show_bug.cgi?id=154445

Reviewed by Gyuyoung Kim.

* PlatformEfl.cmake: Removed WebViewEfl.cpp from source list.
* UIProcess/API/C/efl/WKViewEfl.cpp: Removed type cast for WebViewEfl.
* UIProcess/API/efl/EwkView.cpp: Ditto.
* UIProcess/API/efl/EwkView.h:
* UIProcess/API/efl/GestureRecognizer.cpp: Removed type cast for WebViewEfl.
* UIProcess/API/efl/WebAccessibility.cpp: Removed unnecessary includes.
* UIProcess/API/efl/ewk_view.cpp: Ditto.
* UIProcess/efl/ViewClientEfl.cpp: Ditto.
* UIProcess/efl/WebColorPickerClient.cpp: Ditto.
* UIProcess/efl/WebColorPickerClient.h:
* UIProcess/efl/WebColorPickerEfl.cpp:
(WebKit::WebColorPickerEfl::WebColorPickerEfl):
* UIProcess/efl/WebColorPickerEfl.h:
(WebKit::WebColorPickerEfl::create):
* UIProcess/efl/WebView.cpp:
* UIProcess/efl/WebView.h:
* UIProcess/efl/WebViewEfl.cpp: Removed.
* UIProcess/efl/WebViewEfl.h: Ditto.

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

5 years agoSome timer alignment cleanup.
barraclough@apple.com [Tue, 23 Feb 2016 07:37:26 +0000 (07:37 +0000)]
Some timer alignment cleanup.
https://bugs.webkit.org/show_bug.cgi?id=154559

Reviewed by Chris Dumez.

Document shouldn't override Page's timer alignment policy with a lower alignment,
and m_domTimerAlignmentInterval isn't really a Settings, it's just the current state
for the page.

* dom/Document.cpp:
(WebCore::Document::timerAlignmentInterval):
    - take the max of the possible intervals.
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setTimerThrottlingEnabled):
(WebCore::Page::setDOMTimerAlignmentInterval):
    - moved here from Settings.
* page/Page.h:
(WebCore::Page::domTimerAlignmentInterval):
    - moved here from Settings.
* page/Settings.cpp:
(WebCore::Settings::setDOMTimerAlignmentInterval): Deleted.
    - moved to Page.
* page/Settings.h:
(WebCore::Settings::domTimerAlignmentInterval): Deleted.
    - moved to Page.

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

5 years agoWeb Inspector: add 'Automation' protocol domain and generate its backend classes...
bburg@apple.com [Tue, 23 Feb 2016 07:18:41 +0000 (07:18 +0000)]
Web Inspector: add 'Automation' protocol domain and generate its backend classes separately in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=154509
<rdar://problem/24759098>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Add a new 'WebKit' framework, which is used to generate protocol code
in WebKit2.

Add --backend and --frontend flags to the main generator script.
These allow a framework to trigger two different sets of generators
so they can be separately generated and compiled.

* inspector/scripts/codegen/models.py:
(Framework.fromString):
(Frameworks): Add new framework.

* inspector/scripts/generate-inspector-protocol-bindings.py:
If neither --backend or --frontend is specified, assume both are wanted.
This matches the behavior for JavaScriptCore and WebInspector frameworks.

(generate_from_specification):
Generate C++ files for the backend and Objective-C files for the frontend.

Source/WebKit2:

Add a new 'Automation' domain which presents an RPC interface
for sending automation commands to an active WebAutomationSession
in the UIProcess via RemoteInspector. This is similar to how the
Inspector backend communicates bidirectionally with a remote
Inspector frontend.

Add build system logic to generate JSON-RPC protocol bindings
for the 'Automation' domain using the inspector code generators.

Move automation-related files that are not API or SPI into their
own directory.

* Configurations/BaseTarget.xcconfig: Tell where JavaScriptCore's
private headers are, since that's where the code generators live.

* CMakeLists.txt: Look in UIProcess/Automation directory.
* PlatformMac.cmake:
* DerivedSources.make: Generate protocol bindings for a single domain.
The names of the generated files will be improved in a follow-up patch
so that they do not clash with generated files in JavaScriptCore.

* UIProcess/Automation/Automation.json: Added.
* UIProcess/Automation/WebAutomationSession.cpp: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.cpp.
(WebKit::WebAutomationSession::WebAutomationSession):
(WebKit::WebAutomationSession::~WebAutomationSession):
Set up a backend dispatcher and frontend router. They will be used later.

(WebKit::WebAutomationSession::dispatchMessageFromRemote):
Forward messages from the remote to the backend dispatcher. When
an agent / command handler is registered, it will receive the message.

(WebKit::WebAutomationSession::connect):
(WebKit::WebAutomationSession::disconnect):
Connenct and disconnect the frontend router to the remote channel.

* UIProcess/Automation/WebAutomationSession.h: Renamed from Source/WebKit2/UIProcess/WebAutomationSession.h.
* WebKit2.xcodeproj/project.pbxproj: Add and move files.

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

5 years agoFont features specified in @font-face blocks don't apply to local() families
mmaxfield@apple.com [Tue, 23 Feb 2016 07:17:29 +0000 (07:17 +0000)]
Font features specified in @font-face blocks don't apply to local() families
https://bugs.webkit.org/show_bug.cgi?id=154554

Reviewed by Dean Jackson.

Source/WebCore:

The correct variables just need to be wired up. In addition, our caches need to be sensitive
to the new data.

Test: css3/font-feature-font-face-local.html

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
* platform/graphics/FontCache.cpp:
(WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
(WebCore::FontPlatformDataCacheKey::operator==):
(WebCore::FontPlatformDataCacheKeyHash::hash):
(WebCore::FontCache::getCachedFontPlatformData):
(WebCore::FontCache::fontForFamily):
* platform/graphics/FontCache.h:
* platform/graphics/FontFeatureSettings.h:
(WebCore::FontFeature::operator!=):
(WebCore::FontFeatureSettings::operator!=):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::lastResortFallbackFont):
* platform/text/TextFlags.h:
(WebCore::FontVariantSettings::operator==):
(WebCore::FontVariantSettings::operator!=):
(WebCore::FontVariantSettings::uniqueValue):

LayoutTests:

* css3/font-feature-font-face-local-expected.html: Added.
* css3/font-feature-font-face-local.html: Added.

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

5 years agoWeb Inspector: Timelines sidebar and overview attempt to access undefined properties...
mattbaker@apple.com [Tue, 23 Feb 2016 02:31:02 +0000 (02:31 +0000)]
Web Inspector: Timelines sidebar and overview attempt to access undefined properties when FPS instrument is absent
https://bugs.webkit.org/show_bug.cgi?id=154567
<rdar://problem/24781536>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview):
The viewMode property should be in a valid state before attempting
to access the current view mode settings.

* UserInterface/Views/TimelineSidebarPanel.js:
(WebInspector.TimelineSidebarPanel.prototype.get minimumWidth):
(WebInspector.TimelineSidebarPanel.prototype._updateViewModeIfNeeded):
(WebInspector.TimelineSidebarPanel):
Added missing checks for FPSInstrument support.

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

5 years agoJSGlobalObject doesn't visit ProxyObjectStructure during GC
sbarati@apple.com [Tue, 23 Feb 2016 01:01:46 +0000 (01:01 +0000)]
JSGlobalObject doesn't visit ProxyObjectStructure during GC
https://bugs.webkit.org/show_bug.cgi?id=154564

Rubber stamped by Mark Lam.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::visitChildren):

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

5 years agoInternalFunction::createSubclassStructure doesn't take into account that get() might...
sbarati@apple.com [Tue, 23 Feb 2016 00:51:02 +0000 (00:51 +0000)]
InternalFunction::createSubclassStructure doesn't take into account that get() might throw
https://bugs.webkit.org/show_bug.cgi?id=154548

Reviewed by Mark Lam and Geoffrey Garen and Andreas Kling.

InternalFunction::createSubclassStructure calls newTarget.get(...) which can throw
an exception. Neither the function nor the call sites of the function took this into
account. This patch audits the call sites of the function to make it work in
the event that an exception is thrown.

* runtime/BooleanConstructor.cpp:
(JSC::constructWithBooleanConstructor):
* runtime/DateConstructor.cpp:
(JSC::constructDate):
* runtime/ErrorConstructor.cpp:
(JSC::Interpreter::constructWithErrorConstructor):
* runtime/FunctionConstructor.cpp:
(JSC::constructFunctionSkippingEvalEnabledCheck):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::createSubclassStructure):
* runtime/JSArrayBufferConstructor.cpp:
(JSC::constructArrayBuffer):
* runtime/JSGenericTypedArrayViewConstructorInlines.h:
(JSC::constructGenericTypedArrayView):
* runtime/JSGlobalObject.h:
(JSC::constructEmptyArray):
(JSC::constructArray):
(JSC::constructArrayNegativeIndexed):
* runtime/JSPromiseConstructor.cpp:
(JSC::constructPromise):
* runtime/MapConstructor.cpp:
(JSC::constructMap):
* runtime/NativeErrorConstructor.cpp:
(JSC::Interpreter::constructWithNativeErrorConstructor):
* runtime/NumberConstructor.cpp:
(JSC::constructWithNumberConstructor):
* runtime/RegExpConstructor.cpp:
(JSC::getRegExpStructure):
(JSC::constructRegExp):
(JSC::constructWithRegExpConstructor):
* runtime/SetConstructor.cpp:
(JSC::constructSet):
* runtime/StringConstructor.cpp:
(JSC::constructWithStringConstructor):
(JSC::StringConstructor::getConstructData):
* runtime/WeakMapConstructor.cpp:
(JSC::constructWeakMap):
* runtime/WeakSetConstructor.cpp:
(JSC::constructWeakSet):
* tests/stress/create-subclass-structure-might-throw.js: Added.
(assert):

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

5 years agoREGRESSION (r196892): Crash in DocumentLoader::startLoadingMainResource()
dbates@webkit.org [Tue, 23 Feb 2016 00:48:48 +0000 (00:48 +0000)]
REGRESSION (r196892): Crash in DocumentLoader::startLoadingMainResource()
https://bugs.webkit.org/show_bug.cgi?id=154563
<rdar://problem/24780678>

Reviewed by Alexey Proskuryakov.

Fixes an issue where the provisional loader may be deallocated when starting
a load. One example where this can occur is when cancelling the provisional load
as part of a form submission because the Content Security Policy of the page
blocks the submission (it violates the directive form-action).

This crash is covered by the test http/tests/security/contentSecurityPolicy/1.1/form-action-src-blocked.html.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource): Take a ref before calling
DocumentLoader::willSendRequest().

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

5 years agoImplement basic functionality in WebVideoFullscreenInterfaceMac.
adachan@apple.com [Tue, 23 Feb 2016 00:40:16 +0000 (00:40 +0000)]
Implement basic functionality in WebVideoFullscreenInterfaceMac.
https://bugs.webkit.org/show_bug.cgi?id=153241

Reviewed by Beth Dakin.

Source/WebCore:

* platform/cocoa/WebVideoFullscreenInterface.h:
* platform/mac/WebVideoFullscreenInterfaceMac.h:
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::invalidate):
(WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline):

Source/WebKit2:

* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
(WebKit::WebVideoFullscreenManagerProxy::exitFullscreen):
(WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline):
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::rootViewToWindow):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::rootViewToWindow):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::supportsVideoFullscreen):
* WebProcess/cocoa/WebVideoFullscreenManager.h:
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::supportsVideoFullscreen):

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

5 years agoUnreviewed build fix.
msaboff@apple.com [Tue, 23 Feb 2016 00:03:54 +0000 (00:03 +0000)]
Unreviewed build fix.

Eliminated the include of simple.h as that benchmark wasn't meant to be checked in.

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

5 years agoFix build and implement functions to retrieve registers on FreeBSD
commit-queue@webkit.org [Mon, 22 Feb 2016 23:03:26 +0000 (23:03 +0000)]
Fix build and implement functions to retrieve registers on FreeBSD
https://bugs.webkit.org/show_bug.cgi?id=152258

Patch by Ting-Wei Lan <lantw44@gmail.com> on 2016-02-22
Reviewed by Michael Catanzaro.

* heap/MachineStackMarker.cpp:
(pthreadSignalHandlerSuspendResume):
struct ucontext is not specified in POSIX and it is not available on
FreeBSD. Replacing it with ucontext_t fixes the build problem.
(JSC::MachineThreads::Thread::Registers::stackPointer):
(JSC::MachineThreads::Thread::Registers::framePointer):
(JSC::MachineThreads::Thread::Registers::instructionPointer):
(JSC::MachineThreads::Thread::Registers::llintPC):
* heap/MachineStackMarker.h:

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

5 years agoREGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-desig...
cdumez@apple.com [Mon, 22 Feb 2016 22:27:30 +0000 (22:27 +0000)]
REGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-design-information/
https://bugs.webkit.org/show_bug.cgi?id=154547
<rdar://problem/24772167>

Reviewed by Gavin Barraclough.

Source/WebCore:

The Website was doing the following:
$ var e = window.addEventListener;
$ e("eventname", handler)

In such case, the jsEventTargetPrototypeFunctionDispatchEvent() bindings
implementation was caused with a thisValue which is a JSLexicalEnvironment
and the implementation did not know how to convert it into a global object.
The previous implementation on JSDOMWindow used to handle tis correctly
because it was always calling JSValue::toThis() on the thisValue before
trying to cast it to a JSDOMWindow, and JSLexicalEnvironment::toThis()
gets the globalThisValue. This patch updates the EventTarget bindings
code to call always call toThis() on the thisValue before trying to
cast it. This should correctly deal with JSLexicalEnvironment and be a
no-op in usual cases.

No new tests, extended existing test.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateFunctionCastedThis):

LayoutTests:

Add regression test for <rdar://problem/24772167>.

* fast/dom/Window/addEventListener-implicit-this-expected.txt:
* fast/dom/Window/addEventListener-implicit-this.html:

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

5 years agoRepeated background images have the wrong position when using bottom/right-relative...
simon.fraser@apple.com [Mon, 22 Feb 2016 22:26:23 +0000 (22:26 +0000)]
Repeated background images have the wrong position when using bottom/right-relative background-position
https://bugs.webkit.org/show_bug.cgi?id=154478

Reviewed by Dave Hyatt.
Source/WebCore:

Fix RenderBoxModelObject::calculateBackgroundImageGeometry() to use the right position when
painting repeated background images when right/bottom edges are used.

Also rename BackgroundEdgeOrigin to Edge

Test: fast/images/background-position.html

* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Edge):
(WebCore::CSSPrimitiveValue::operator BackgroundEdgeOrigin): Deleted.
* rendering/RenderBoxModelObject.cpp:
(WebCore::resolveEdgeRelativeLength):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
* rendering/style/FillLayer.cpp:
(WebCore::FillLayer::FillLayer):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::backgroundXOrigin):
(WebCore::FillLayer::backgroundYOrigin):
(WebCore::FillLayer::setBackgroundXOrigin):
(WebCore::FillLayer::setBackgroundYOrigin):
* rendering/style/RenderStyleConstants.cpp:
(WebCore::operator<<):
* rendering/style/RenderStyleConstants.h:

LayoutTests:

Enhanced background-position-serialize.html to test values that use right/bottom edge specifiers.

Ref test for background-position.

* fast/css/background-position-serialize-expected.txt:
* fast/css/background-position-serialize.html:
* fast/images/background-position-expected.html: Added.
* fast/images/background-position.html: Added.
* fast/images/resources/checker.png: Added.

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

5 years agoJSValue::isConstructor and JSValue::isFunction should check getConstructData and...
sbarati@apple.com [Mon, 22 Feb 2016 22:24:51 +0000 (22:24 +0000)]
JSValue::isConstructor and JSValue::isFunction should check getConstructData and getCallData
https://bugs.webkit.org/show_bug.cgi?id=154552

Reviewed by Mark Lam.

ES6 Proxy breaks our isFunction() and isConstructor() JSValue methods.
They return false on a Proxy with internal [[Call]] and [[Construct]]
properties. It seems safest, most forward looking, and most adherent
to the specification to check getCallData() and getConstructData() to
implement these functions.

* runtime/InternalFunction.cpp:
(JSC::InternalFunction::createSubclassStructure):
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::isFunction):
(JSC::JSValue::isConstructor):

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

5 years agoUnreviewed, rolling out r196935.
ryanhaddad@apple.com [Mon, 22 Feb 2016 22:23:39 +0000 (22:23 +0000)]
Unreviewed, rolling out r196935.
https://bugs.webkit.org/show_bug.cgi?id=154557

This change causes timeouts and crashes in LayoutTests
(Requested by ryanhaddad on #webkit).

Reverted changeset:

"Enable AVFoundationNSURLSessionEnabled by default"
https://bugs.webkit.org/show_bug.cgi?id=154469
http://trac.webkit.org/changeset/196935

Patch by Commit Queue <commit-queue@webkit.org> on 2016-02-22

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

5 years ago[l10n] Updated Polish translation of WebKitGTK+ for 2.12
mcatanzaro@igalia.com [Mon, 22 Feb 2016 22:18:36 +0000 (22:18 +0000)]
[l10n] Updated Polish translation of WebKitGTK+ for 2.12
https://bugs.webkit.org/show_bug.cgi?id=154549

Patch by Piotr Drąg <piotrdrag@gmail.com> on 2016-02-22
Rubber-stamped by Michael Catanzaro.

* pl.po:

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

5 years agoBound functions should use the prototype of the function being bound
keith_miller@apple.com [Mon, 22 Feb 2016 22:07:16 +0000 (22:07 +0000)]
Bound functions should use the prototype of the function being bound
https://bugs.webkit.org/show_bug.cgi?id=154195

Reviewed by Geoffrey Garen.

Per ES6, the result of Function.prototype.bind should have the same
prototype as the the function being bound. In order to avoid creating
a new structure each time a function is bound we store the new
structure in our structure map. However, we cannot currently store
structures that have a different GlobalObject than their prototype.
In the rare case that the GlobalObject differs or the prototype of
the bindee is null we create a new structure each time. To further
minimize new structures, as well as making structure lookup faster,
we also store the structure in the RareData of the function we
are binding.

* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::visitChildren):
* runtime/FunctionRareData.h:
(JSC::FunctionRareData::getBoundFunctionStructure):
(JSC::FunctionRareData::setBoundFunctionStructure):
* runtime/JSBoundFunction.cpp:
(JSC::getBoundFunctionStructure):
(JSC::JSBoundFunction::create):
* tests/es6.yaml:
* tests/stress/bound-function-uses-prototype.js: Added.
(testChangeProto.foo):
(testChangeProto):
(testBuiltins):
* tests/stress/class-subclassing-function.js:

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

5 years agoMallocBench: Added recording for nimlang website, new recording details and added...
msaboff@apple.com [Mon, 22 Feb 2016 22:02:24 +0000 (22:02 +0000)]
MallocBench: Added recording for nimlang website, new recording details and added new options
https://bugs.webkit.org/show_bug.cgi?id=154485

Reviewed by Geoff Garen.

Added new capabilities to MallocBench.  These include:
    Added a recording of http://nim-lang.org/docs/lib.html.
    Added thread id to the recording and the ability to playback switching threads in MallocBench
    Added aligned allocations to recordings and the ability to playback
    Added --use-thread-id option to honor recorded thread ids
    Added --detailed-report to output remaining allocations by size after playback
    Added --no-warmup to not run the warm up iteration

Changed the way that options are passed down to the benchmarks.  Instead of passing individual
boolean or numeric option values, just pass a reference the CommandLine itself.  Each benchmark
can access the options that are appropriate.  The Benchmark class also uses the options for
is parallel, run counts and warm up.

Added thread id and aligned malloc to the Op by noticing that structure padding and Opcode allowed
for another 32 bits of data.  Breaking that unused 32 bits into a 16 bit thread id value and a
16 bit log base 2 of the alignment for aligned malloc allowed for existing recordings to playback
without any incompatibilities.

Threaded operation is simulated by creating threads as needed.  As long as the next Op's thread id
is the same as the last, operation continues as normal.  When the next Op has a different thread id,
we switch to that thread using the shared Op stream to continue playing back.  There is a mutex to
assure that only one thread is really running at a time and a condition variable used to wait
that the current thread id matches each block thread's thread id.  This doesn't simulate true
concurrent threading, but is instead plays back Ops recorded for multiple thread faithfully.

* MallocBench/MallocBench.xcodeproj/project.pbxproj:
* MallocBench/MallocBench/Benchmark.cpp:
(deallocateHeap):
(Benchmark::Benchmark):
(Benchmark::runOnce):
(Benchmark::run):
* MallocBench/MallocBench/Benchmark.h:
(Benchmark::isValid):
* MallocBench/MallocBench/CommandLine.cpp:
(CommandLine::printUsage):
* MallocBench/MallocBench/CommandLine.h:
(CommandLine::isValid):
(CommandLine::benchmarkName):
(CommandLine::isParallel):
(CommandLine::useThreadID):
(CommandLine::detailedReport):
(CommandLine::warmUp):
(CommandLine::heapSize):
(CommandLine::runs):
* MallocBench/MallocBench/Interpreter.cpp:
(Interpreter::Interpreter):
(Interpreter::run):
(Interpreter::readOps):
(Interpreter::doOnSameThread):
(Interpreter::switchToThread):
(Interpreter::detailedReport):
(compute2toPower):
(writeData):
(Interpreter::doMallocOp):
(Interpreter::Thread::Thread):
(Interpreter::Thread::stop):
(Interpreter::Thread::~Thread):
(Interpreter::Thread::runThread):
(Interpreter::Thread::waitToRun):
(Interpreter::Thread::switchTo):
* MallocBench/MallocBench/Interpreter.h:
(Interpreter::Thread::isMainThread):
* MallocBench/MallocBench/alloc_free.cpp: Added.
(benchmark_alloc_free):
* MallocBench/MallocBench/alloc_free.h: Added.
* MallocBench/MallocBench/balloon.cpp:
(benchmark_balloon):
* MallocBench/MallocBench/balloon.h:
* MallocBench/MallocBench/big.cpp:
(benchmark_big):
* MallocBench/MallocBench/big.h:
* MallocBench/MallocBench/churn.cpp:
(benchmark_churn):
* MallocBench/MallocBench/churn.h:
* MallocBench/MallocBench/facebook.cpp:
(benchmark_facebook):
* MallocBench/MallocBench/facebook.h:
* MallocBench/MallocBench/flickr.cpp:
(benchmark_flickr):
(benchmark_flickr_memory_warning):
* MallocBench/MallocBench/flickr.h:
* MallocBench/MallocBench/fragment.cpp:
(validate):
(benchmark_fragment):
(benchmark_fragment_iterate):
* MallocBench/MallocBench/fragment.h:
* MallocBench/MallocBench/list.cpp:
(benchmark_list_allocate):
(benchmark_list_traverse):
* MallocBench/MallocBench/list.h:
* MallocBench/MallocBench/main.cpp:
(main):
* MallocBench/MallocBench/medium.cpp:
(benchmark_medium):
* MallocBench/MallocBench/medium.h:
* MallocBench/MallocBench/memalign.cpp:
(test):
(benchmark_memalign):
* MallocBench/MallocBench/memalign.h:
* MallocBench/MallocBench/message.cpp:
(benchmark_message_one):
(benchmark_message_many):
* MallocBench/MallocBench/message.h:
* MallocBench/MallocBench/nimlang.cpp: Added.
(benchmark_nimlang):
* MallocBench/MallocBench/nimlang.h: Added.
* MallocBench/MallocBench/nimlang.ops: Added.
* MallocBench/MallocBench/realloc.cpp:
(benchmark_realloc):
* MallocBench/MallocBench/realloc.h:
* MallocBench/MallocBench/reddit.cpp:
(benchmark_reddit):
(benchmark_reddit_memory_warning):
* MallocBench/MallocBench/reddit.h:
* MallocBench/MallocBench/stress.cpp:
(deallocate):
(benchmark_stress):
* MallocBench/MallocBench/stress.h:
* MallocBench/MallocBench/stress_aligned.cpp:
(benchmark_stress_aligned):
* MallocBench/MallocBench/stress_aligned.h:
* MallocBench/MallocBench/theverge.cpp:
(benchmark_theverge):
(benchmark_theverge_memory_warning):
* MallocBench/MallocBench/theverge.h:
* MallocBench/MallocBench/tree.cpp:
(benchmark_tree_allocate):
(benchmark_tree_traverse):
(benchmark_tree_churn):
* MallocBench/MallocBench/tree.h:
* MallocBench/run-malloc-benchmarks:

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

5 years ago[Font Loading] Split CSSFontSelector into a FontFaceSet implementation and the rest...
mmaxfield@apple.com [Mon, 22 Feb 2016 21:40:02 +0000 (21:40 +0000)]
[Font Loading] Split CSSFontSelector into a FontFaceSet implementation and the rest of the class
https://bugs.webkit.org/show_bug.cgi?id=153347

Reviewed by Antti Koivisto.

Source/WebCore:

This patch implements the document.fonts Javascript object. It does so by briding the
already-existing FontFaceSet Javascript object with the CSSFontSelector WebCore object.
CSSFontSelector used to hold internal objects for each @font-face object in the
Document. These objects have been moved into CSSFontFaceSet, so CSSFontSelector simply
just owns an instance of a CSSFontFaceSet.

The lifetime of the FontFace and FontFaceSet objects is a little interesting: because
all the ownership references are inside the WebCore CSSFontFace{,Set} objects, the
higher-level Javascript FontFace{,Set} objects are held through a WeakPtr. This means
that if all the references to these higher-level objects go away, and you re-query the
document for its FontFace objects, you may get a new object (albeit with the same
state as a previous object). However, this won't occur if there are any references to
the old object, which means it is almost not observable.

This patch doesn't implement the relationship between the CSSOM and the FontFace
objects. Changing one should result in a change in the other, but that will be
implemented in a forthcoming patch.

This patch also doesn't alter the lifetime of the CSSFontSelector, which means that all
the Document's fonts may be destroyed and recreated from CSS. There are a few things
which can trigger this. A subsequent patch will make the CSSFontSelector outlive the
Document.

This patch does implement (and test) the ability to add a new FontFace to the Document
to cause a relayout, as well as changing properties of existing FontFace objects already
in the Document to cause a relayout.

Test: fast/text/font-face-set-document.html

* Modules/fetch/FetchHeaders.cpp:
(WebCore::FetchHeaders::Iterator::next): Pass an extra argument.
* Modules/fetch/FetchHeaders.h:
* bindings/js/JSKeyValueIterator.h: The ExecState is necessary to build an external
wrapper from an existing CSSFontFace object.
(WebCore::JSKeyValueIterator<JSWrapper>::next):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::appendSources): Moved from CSSFontSelector.
(WebCore::CSSFontFace::CSSFontFace):
(WebCore::CSSFontFace::notifyClientsOfFontPropertyChange):
(WebCore::CSSFontFace::setFamilies):
(WebCore::CSSFontFace::calculateStyle): Shared code between CSSFontFaceSet and
CSSFontFace.
(WebCore::CSSFontFace::setStyle): Update to use calculateStyle().
(WebCore::CSSFontFace::calculateWeight): Ditto.
(WebCore::CSSFontFace::setWeight): Update to use caculateWeight().
(WebCore::CSSFontFace::setUnicodeRange): Notify clients.
(WebCore::CSSFontFace::setVariantLigatures): Ditto.
(WebCore::CSSFontFace::setVariantPosition): Ditto.
(WebCore::CSSFontFace::setVariantCaps): Ditto.
(WebCore::CSSFontFace::setVariantNumeric): Ditto.
(WebCore::CSSFontFace::setVariantAlternates): Ditto.
(WebCore::CSSFontFace::setVariantEastAsian): Ditto.
(WebCore::CSSFontFace::setFeatureSettings): Ditto.
(WebCore::CSSFontFace::removeClient):
(WebCore::CSSFontFace::wrapper): Build a new wrapper if one doesn't already
exist. Note that this requires an ExecState to create a promise.
(WebCore::CSSFontFace::setStatus):
(WebCore::CSSFontFace::fontLoaded):
(WebCore::CSSFontFace::pump):
(WebCore::CSSFontFace::font):
* css/CSSFontFace.h:
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::CSSFontFaceSet): Moved code from CSSFontSelector.
(WebCore::CSSFontFaceSet::~CSSFontFaceSet):
(WebCore::CSSFontFaceSet::addClient): This object can now have multiple
clients.
(WebCore::CSSFontFaceSet::removeClient):
(WebCore::CSSFontFaceSet::incrementActiveCount): Update for multiple clients.
(WebCore::CSSFontFaceSet::decrementActiveCount): Ditto.
(WebCore::CSSFontFaceSet::hasFace):
(WebCore::CSSFontFaceSet::registerLocalFontFacesForFamily): Moved from
CSSFontSelector.
(WebCore::CSSFontFaceSet::familyNameFromPrimitive): Ditto.
(WebCore::CSSFontFaceSet::addToFacesLookupTable): This helper function can
be used when a property of a FontFace is changed.
(WebCore::CSSFontFaceSet::add): Update to use addToFacesLookupTable().
(WebCore::CSSFontFaceSet::removeFromFacesLookupTable): Same as
addToFacesLookupTable().
(WebCore::CSSFontFaceSet::remove): Update to use removeFromFacesLookupTable().
(WebCore::CSSFontFaceSet::clear):
(WebCore::CSSFontFaceSet::operator[]):
(WebCore::computeFontTraitsMask): Moved from CSSFontSelector.
(WebCore::CSSFontFaceSet::matchingFaces): Update to use new data structures.
(WebCore::FontFaceComparator::FontFaceComparator): Moved from
CSSFontSelector.
(WebCore::FontFaceComparator::operator()):
(WebCore::CSSFontFaceSet::getFontFace): Update to use new data structures.
(WebCore::CSSFontFaceSet::fontStateChanged): Update to use multiple clients.
(WebCore::CSSFontFaceSet::fontPropertyChanged): We must update our internal
data structure if the family name changed.
(WebCore::extractFamilies): Deleted.
(WebCore::familiesIntersect): Deleted.
(WebCore::CSSFontFaceSet::load): Deleted.
(WebCore::CSSFontFaceSet::stateChanged): Deleted.
* css/CSSFontFaceSet.h: Now needs to be RefCounted. New data structures are
taken from CSSFontSelector.
(WebCore::CSSFontFaceSetClient::faceFinished):
(WebCore::CSSFontFaceSetClient::fontModified):
(WebCore::CSSFontFaceSetClient::startedLoading):
(WebCore::CSSFontFaceSetClient::completedLoading):
* css/CSSFontFaceSource.h:
* css/CSSFontSelector.cpp: Move code into CSSFontFaceSet.
(WebCore::CSSFontSelector::CSSFontSelector):
(WebCore::CSSFontSelector::~CSSFontSelector):
(WebCore::CSSFontSelector::fontFaceSet):
(WebCore::CSSFontSelector::isEmpty):
(WebCore::CSSFontSelector::addFontFaceRule):
(WebCore::CSSFontSelector::fontModified):
(WebCore::CSSFontSelector::fontRangesForFamily):
(WebCore::CSSFontSelector::clearDocument):
(WebCore::CSSFontSelector::appendSources): Deleted.
(WebCore::CSSFontSelector::familyNameFromPrimitive): Deleted.
(WebCore::CSSFontSelector::registerLocalFontFacesForFamily): Deleted.
(WebCore::FontFaceComparator::FontFaceComparator): Deleted.
(WebCore::FontFaceComparator::operator()): Deleted.
(WebCore::CSSFontSelector::getFontFace): Deleted.
* css/CSSFontSelector.h:
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::CSSSegmentedFontFace):
* css/CSSSegmentedFontFace.h:
* css/FontFace.cpp:
(WebCore::FontFace::create):
(WebCore::FontFace::FontFace):
(WebCore::FontFace::createWeakPtr):
(WebCore::FontFace::fontStateChanged):
(WebCore::FontFace::stateChanged): Deleted.
* css/FontFace.h:
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::create):
(WebCore::FontFaceSet::FontFaceSet):
(WebCore::FontFaceSet::~FontFaceSet):
(WebCore::FontFaceSet::Iterator::next):
(WebCore::FontFaceSet::has):
(WebCore::FontFaceSet::size):
(WebCore::FontFaceSet::add):
(WebCore::FontFaceSet::remove):
(WebCore::FontFaceSet::clear):
(WebCore::FontFaceSet::load):
(WebCore::FontFaceSet::check):
(WebCore::FontFaceSet::status):
(WebCore::FontFaceSet::canSuspendForDocumentSuspension):
(WebCore::FontFaceSet::faceFinished):
* css/FontFaceSet.h:
* css/FontFaceSet.idl:
* dom/Document.cpp:
(WebCore::Document::fonts):
* dom/Document.h:
* dom/Document.idl:
* svg/SVGFontFaceElement.h:

LayoutTests:

* fast/text/font-face-javascript.html:
* fast/text/font-face-set-document-expected.txt: Added.
* fast/text/font-face-set-document.html: Added.

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

5 years agoUnreviewed, fix stress test to not print on success.
keith_miller@apple.com [Mon, 22 Feb 2016 21:36:24 +0000 (21:36 +0000)]
Unreviewed, fix stress test to not print on success.

* tests/stress/call-apply-builtin-functions-dont-use-iterators.js:
(catch): Deleted.

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

5 years agoRemove _mockCaptureDevicesEnabled getter and setter
andersca@apple.com [Mon, 22 Feb 2016 21:10:18 +0000 (21:10 +0000)]
Remove _mockCaptureDevicesEnabled getter and setter
https://bugs.webkit.org/show_bug.cgi?id=154550

Reviewed by Beth Dakin.

The _mockCaptureDevicesEnabled property isn't declared anywhere, and this
should be a WKWebViewConfiguration parameter if we ever want to expose it in the modern API.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _mockCaptureDevicesEnabled]): Deleted.
(-[WKPreferences _setMockCaptureDevicesEnabled:]): Deleted.

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

5 years ago[WinCairo] Compile fix.
peavo@outlook.com [Mon, 22 Feb 2016 20:15:30 +0000 (20:15 +0000)]
[WinCairo] Compile fix.
https://bugs.webkit.org/show_bug.cgi?id=154545

Reviewed by Alex Christensen.

Add missing parameter to GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers().

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::flushPendingLayerChanges):

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

5 years agoUse Symbol.species in the builtin TypedArray.prototype functions
keith_miller@apple.com [Mon, 22 Feb 2016 20:07:50 +0000 (20:07 +0000)]
Use Symbol.species in the builtin TypedArray.prototype functions
https://bugs.webkit.org/show_bug.cgi?id=153384

Reviewed by Geoffrey Garen.

This patch adds the use of species constructors to the TypedArray.prototype map and filter
functions. It also adds a new private function typedArrayGetOriginalConstructor that
returns the TypedArray constructor used to originally create a TypedArray instance.

There are no ES6 tests to update for this patch as species creation for these functions is
not tested in the compatibility table.

* builtins/TypedArrayPrototype.js:
(map):
(filter):
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* bytecode/BytecodeIntrinsicRegistry.h:
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::typedArrayConstructor):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::typedArrayViewPrivateFuncGetOriginalConstructor):
* runtime/JSTypedArrayViewPrototype.h:
* tests/stress/typedarray-filter.js:
(subclasses.typedArrays.map):
(prototype.accept):
(testSpecies):
(accept):
(forEach):
(subclasses.forEach):
(testSpeciesRemoveConstructor):
* tests/stress/typedarray-map.js:
(subclasses.typedArrays.map):
(prototype.id):
(testSpecies):
(id):
(forEach):
(subclasses.forEach):
(testSpeciesRemoveConstructor):

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

5 years agoBuiltins that should not rely on iteration do.
keith_miller@apple.com [Mon, 22 Feb 2016 19:43:01 +0000 (19:43 +0000)]
Builtins that should not rely on iteration do.
https://bugs.webkit.org/show_bug.cgi?id=154475

Reviewed by Geoffrey Garen.

When changing the behavior of varargs calls to use ES6 iterators the
call builtin function's use of a varargs call was overlooked. The use
of iterators is observable outside the scope of the the call function,
thus it must be reimplemented.

* builtins/FunctionPrototype.js:
(call):
* tests/stress/call-apply-builtin-functions-dont-use-iterators.js: Added.
(test):
(addAll):
(catch):

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

5 years ago[JSC shell] Don't put empty arguments array to VM.
commit-queue@webkit.org [Mon, 22 Feb 2016 19:41:00 +0000 (19:41 +0000)]
[JSC shell] Don't put empty arguments array to VM.
https://bugs.webkit.org/show_bug.cgi?id=154516

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-02-22
Reviewed by Geoffrey Garen.

This allows arrowfunction-lexical-bind-arguments-top-level test to pass
in jsc as well as in browser.

Source/JavaScriptCore:

* jsc.cpp:
(GlobalObject::finishCreation):

LayoutTests:

* js/script-tests/arrowfunction-lexical-bind-arguments-top-level.js:
Removed @ skip annotation.

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

5 years ago[cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
commit-queue@webkit.org [Mon, 22 Feb 2016 19:32:47 +0000 (19:32 +0000)]
[cmake] Moved library setup code to WEBKIT_FRAMEWORK macro.
https://bugs.webkit.org/show_bug.cgi?id=154450

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-02-22
Reviewed by Alex Christensen.

.:

* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

* CMakeLists.txt:

Source/WebCore:

No new tests needed.

* CMakeLists.txt:

Source/WebKit:

* CMakeLists.txt:

Source/WebKit2:

* CMakeLists.txt: Used WebKit2_SOURCES variable instead of separate
WebKit2_DERIVED_SOURCES for compatibility with WEBKIT_FRAMEWORK macro.
There is no real need to separate derived sources from others.
* PlatformGTK.cmake: Ditto.

Source/WTF:

* wtf/CMakeLists.txt:

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

5 years agoWorkaround for ICE in GCC 4.8 appeared in r196846.
commit-queue@webkit.org [Mon, 22 Feb 2016 19:26:48 +0000 (19:26 +0000)]
Workaround for ICE in GCC 4.8 appeared in r196846.
https://bugs.webkit.org/show_bug.cgi?id=154535

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-02-22
Reviewed by Chris Dumez.

No new tests needed.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::autocomplete):

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

5 years ago[CMake] Unreviewed build fix after r196942.
clopez@igalia.com [Mon, 22 Feb 2016 19:24:16 +0000 (19:24 +0000)]
[CMake] Unreviewed build fix after r196942.

* CMakeLists.txt: WKPluginSiteDataManager.cpp is gone.

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

5 years agoAdd mechanism to disable memory pressure handling
commit-queue@webkit.org [Mon, 22 Feb 2016 18:31:03 +0000 (18:31 +0000)]
Add mechanism to disable memory pressure handling
https://bugs.webkit.org/show_bug.cgi?id=154254
<rdar://problem/24662616>

Patch by Keith Rollin <krollin@apple.com> on 2016-02-22
Reviewed by Chris Dumez.

Add a mechanism to disable WebKit's response to memory pressure
triggers. This was asked for by another group for testing purposes.

In order to disable WebKit's memory pressure handling, execute the
following from the command line:

    defaults write com.apple.Safari WebKitSuppressMemoryPressureHandler -bool true

To revert to standard behavior, delete the key or set it to False.

This flag is used when a new sub-process is being spawned. The value
is read and stored in an initialization parameter block, which is then
sent to the new sub-process.

In actuality, only the UI, WebContent, and Network processes heed the
flag. The Plugin process isn't instrumented to heed this flag for
three reasons. First, the Plugin process installs its memory pressure
handler in initializeProcess, not initializePluginProcess. This is
contrary to when the other processes install their handlers, which is
in initialize<PluginType>Process, not initializeProcess. So in order
to accomodate the Plugin process, we'd need to modify
ChildProcessInitializationParameters. Doing this is awkward at best,
but also seems to be opposed to what's supposed to be done in
initializeProcess and conveyed in
ChildProcessInitializationParameters. And even if we did add a boolean
to this structure and added support for conveying it through the XPC
port, it would end up being a Plugin process-only boolean in a general
parameter block, which seems asymmetric with the other processes.
Second, there's no convenient Cocoa function called in the flow that
spawns the Plugin process, meaning that there's no convenient place to
call NSUserDefaults to get the flag's value. And third, the Plugin
process doesn't elegantly respond to the memory pressure trigger
anyway. It might terminate itself, but that's it. As for the Database
process, it doesn't seem to support responding to memory pressure at
all, so we don't send it a flag telling it to ignore it.

Internally, the memory pressure handler is suppressed by not calling
MemoryPressureHandler::install() if the flag is set. In the case of
the Network process, the flag is saved so that it can be checked later
in other places that manually kick off the memory pressure handling
procedure.

Source/WebKit/mac:

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(WebInstallMemoryPressureHandler):

Source/WebKit2:

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::lowMemoryHandler):
(WebKit::NetworkProcess::initializeNetworkProcess):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode):
(WebKit::NetworkProcessCreationParameters::decode):
* NetworkProcess/NetworkProcessCreationParameters.h:
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

5 years agoGet rid of WKPluginSiteDataManager
andersca@apple.com [Mon, 22 Feb 2016 18:22:27 +0000 (18:22 +0000)]
Get rid of WKPluginSiteDataManager
https://bugs.webkit.org/show_bug.cgi?id=154470

Reviewed by Tim Horton.

* Shared/API/c/WKBase.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextGetPluginSiteDataManager): Deleted.
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKPluginSiteDataManager.cpp: Removed.
(WKPluginSiteDataManagerGetTypeID): Deleted.
(WKPluginSiteDataManagerGetSitesWithData): Deleted.
(WKPluginSiteDataManagerClearSiteData): Deleted.
(WKPluginSiteDataManagerClearAllSiteData): Deleted.
* UIProcess/API/C/WKPluginSiteDataManager.h: Removed.
* WebKit2.xcodeproj/project.pbxproj:

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

5 years agoRebaseline tests for ios-simulator after W3C HTML/DOM re-sync in r196883
ryanhaddad@apple.com [Mon, 22 Feb 2016 18:03:22 +0000 (18:03 +0000)]
Rebaseline tests for ios-simulator after W3C HTML/DOM re-sync in r196883

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt:
* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-embedded-expected.txt:

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

5 years agoRebaseline imported/w3c/web-platform-tests/html/dom/reflection-forms.html for ios...
ryanhaddad@apple.com [Mon, 22 Feb 2016 18:01:38 +0000 (18:01 +0000)]
Rebaseline imported/w3c/web-platform-tests/html/dom/reflection-forms.html for ios-simulator after r196893

Unreviewed test gardening.

* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/reflection-forms-expected.txt:

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

5 years ago[WK2][Mac] Allow processes to set "fast-dev-casheable" bit
bfulgham@apple.com [Mon, 22 Feb 2016 17:50:35 +0000 (17:50 +0000)]
[WK2][Mac] Allow processes to set "fast-dev-casheable" bit
https://bugs.webkit.org/show_bug.cgi?id=154503
<rdar://problem/22920815>

Reviewed by Alexey Proskuryakov.

Update the various sandbox profiles with a declaration that using the
system-fctl to touch the "hot file" flag (to support caching operations)
is allowed.

* DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in: Add sandbox permission.
* Resources/PlugInSandboxProfiles/com.apple.WebKit.plugin-common.sb: Ditto.
* WebProcess/com.apple.WebProcess.sb.in: Ditto.

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

5 years agoFixed compilation of bmalloc with GCC 4.8 after r196873.
commit-queue@webkit.org [Mon, 22 Feb 2016 17:34:37 +0000 (17:34 +0000)]
Fixed compilation of bmalloc with GCC 4.8 after r196873.
https://bugs.webkit.org/show_bug.cgi?id=154534

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-02-22
Reviewed by Mark Lam.

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55382.

* bmalloc/LargeChunk.h:
* bmalloc/SmallChunk.h:

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

5 years agoUnreviewed, rolling out r196891.
commit-queue@webkit.org [Mon, 22 Feb 2016 17:03:59 +0000 (17:03 +0000)]
Unreviewed, rolling out r196891.
https://bugs.webkit.org/show_bug.cgi?id=154539

it broke Production builds (Requested by brrian on #webkit).

Reverted changeset:

"Web Inspector: add 'Automation' protocol domain and generate
its backend classes separately in WebKit2"
https://bugs.webkit.org/show_bug.cgi?id=154509
http://trac.webkit.org/changeset/196891

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