WebKit-https.git
3 years agoAdd version number for default stylesheet
antti@apple.com [Sat, 13 Feb 2016 22:45:34 +0000 (22:45 +0000)]
Add version number for default stylesheet
https://bugs.webkit.org/show_bug.cgi?id=154220

Reviewed by Ryosuke Niwa.

We currently fail to update RuleFeatureSets for shadow trees when the default stylesheet grows
(for example when media controls stylesheet is initialized).

No test since this is not causing known bugs. It is blocking optimizations in shadow trees that
rely on rule features being up-to-date.

* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::loadSimpleDefaultStyle):
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):

    Increment version number when the default stylesheet changes.

* css/CSSDefaultStyleSheets.h:
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::appendAuthorStyleSheets):
(WebCore::DocumentRuleSets::collectFeatures):

    Store the current default stylesheet version number.

* css/DocumentRuleSets.h:
(WebCore::DocumentRuleSets::features):

    Collect features again if the default stylesheet has changed.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForElement):

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

3 years agoEliminate the need for WTFCrashImpl().
mark.lam@apple.com [Sat, 13 Feb 2016 22:39:52 +0000 (22:39 +0000)]
Eliminate the need for WTFCrashImpl().
https://bugs.webkit.org/show_bug.cgi?id=154202

Reviewed by Alexey Proskuryakov.

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

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

3 years agov3 UI should show status and associated bugs on analysis task pages
rniwa@webkit.org [Sat, 13 Feb 2016 21:30:10 +0000 (21:30 +0000)]
v3 UI should show status and associated bugs on analysis task pages
https://bugs.webkit.org/show_bug.cgi?id=154212

Reviewed by Chris Dumez.

Added the capability to see and modify the status and the list of associated of bugs on analysis task pages.

Also added the list of related tasks, which are analysis tasks associated with the same bug or have
overlapping time ranges with the same test metric but on a potentially different platform.

In addition, categorize analysis tasks with the status of "no change" or "inconclusive" as "closed" as no
further action can be taken (users can bring them back to non-closed state without any restrictions).

* public/api/analysis-tasks.php:
(format_task): Categorize 'unchanged' and 'inconclusive' analysis tasks as closed.

* public/privileged-api/associate-bug.php:
(main): Added shouldDelete as a new mechanism to disassociate a bug since v3 UI shares a single Bug object
between multiple analysis tasks (as it should have been in the first place).

* public/v3/components/chart-pane-base.js:
(ChartPaneBase):
(ChartPaneBase.prototype._fetchAnalysisTasks): Since each analysis task's change type (status/result) could
change, we need to create annotation objects during each render() call.
(ChartPaneBase.prototype.render):
(ChartPaneBase.prototype._renderAnnotations): Extracted from ChartPaneBase.prototype._fetchAnalysisTasks to
do that. I was afraid of the perf impact of this but it doesn't seem to be an issue in my testing.
(ChartPaneBase.cssTemplate): Removed superfluous margins (moved to ChartPane.cssTemplate) around the charts
since they are only useful in the charts page.

* public/v3/models/analysis-task.js:
(AnalysisTask):
(AnalysisTask.prototype.updateSingleton): Added a comment as to why object.result cannot be renamed to
object.changeType in the JSON API.
(AnalysisTask.prototype.updateName): Added.
(AnalysisTask.prototype.updateChangeType): Added.
(AnalysisTask.prototype._updateRemoteState): Added.
(AnalysisTask.prototype.associateBug): Added.
(AnalysisTask.prototype.disassociateBug): Added.
(AnalysisTask.fetchRelatedTasks): Added. See above for the criteria of related-ness.

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskPage):
(AnalysisTaskPage.prototype.updateFromSerializedState):
(AnalysisTaskPage.prototype._fetchRelatedInfoForTaskId): Extracted from updateFromSerializedState.
(AnalysisTaskPage.prototype._didFetchRelatedAnalysisTasks): Added.
(AnalysisTaskPage.prototype.render): Render the list of associated bugs, the list of bug trackers (so that
users can use it to associate with a new bug), and the list of related analysis tasks.
(AnalysisTaskPage.prototype._renderTestGroupList): Extracted from render since it was getting too long.
(AnalysisTaskPage.prototype._renderTestGroupDetails): Ditto.
(AnalysisTaskPage.prototype._updateChangeType): Added.
(AnalysisTaskPage.prototype._associateBug): Added.
(AnalysisTaskPage.prototype._disassociateBug): Added.
(AnalysisTaskPage.htmlTemplate): Added various elements to show and modify the status, associate bugs,
and a list of related analysis tasks.
(AnalysisTaskPage.cssTemplate): Added various styles for those form controls.

* public/v3/pages/chart-pane.js:
(ChartPane.cssTemplate): Moved the margins from ChartPaneBase.cssTemplate.

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

3 years ago[cmake] Consolidate building of GStreamer and OpenWebRTC code.
commit-queue@webkit.org [Sat, 13 Feb 2016 19:12:28 +0000 (19:12 +0000)]
[cmake] Consolidate building of GStreamer and OpenWebRTC code.
https://bugs.webkit.org/show_bug.cgi?id=154116

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-02-13
Reviewed by Michael Catanzaro.

No new tests needed.

* PlatformEfl.cmake: Migrated shared code to GStreamer.cmake.
* PlatformGTK.cmake: Ditto.
* platform/GStreamer.cmake: Added.

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

3 years agoAdd thread violation checks to WebView public APIs.
mark.lam@apple.com [Sat, 13 Feb 2016 17:41:12 +0000 (17:41 +0000)]
Add thread violation checks to WebView public APIs.
https://bugs.webkit.org/show_bug.cgi?id=154183

Reviewed by Timothy Hatcher.

Source/WebCore:

No new tests.  Just adding a new thread violation round.

* platform/ThreadCheck.h:
* platform/mac/ThreadCheck.mm:
- Adding WebCoreThreadViolationCheckRoundThree().

Source/WebKit/mac:

Re-landing r196527 with a newly added WebCoreThreadViolationCheckRoundThree().
Previously was using WebCoreThreadViolationCheckRoundTwo().

* Misc/WebKitVersionChecks.h:
* WebView/WebFrameView.mm:
(-[WebFrameView initWithFrame:]):
* WebView/WebView.mm:
(-[WebView setCustomTextEncodingName:]):
(-[WebView stringByEvaluatingJavaScriptFromString:]):
(-[WebView windowScriptObject]):
(-[WebView setGroupName:]):
(-[WebView setMainFrameURL:]):
(-[WebView mainFrameTitle]):
(-[WebView mainFrameIcon]):
(-[WebView setDrawsBackground:]):
(-[WebView setShouldUpdateWhileOffscreen:]):

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

3 years agoFix WebAssembly bug URL in the feature list.
timothy@apple.com [Sat, 13 Feb 2016 13:38:48 +0000 (13:38 +0000)]
Fix WebAssembly bug URL in the feature list.

* features.json:

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

3 years agoWeb Inspector: DataGrid Header Cells should have Context Menu for Sorting
commit-queue@webkit.org [Sat, 13 Feb 2016 09:23:40 +0000 (09:23 +0000)]
Web Inspector: DataGrid Header Cells should have Context Menu for Sorting
https://bugs.webkit.org/show_bug.cgi?id=154050

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-02-13
Reviewed by Joseph Pecoraro.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid.prototype.set sortOrder):
(WebInspector.DataGrid.prototype._toggledSortOrder):
Returns the opposite sort order from the current order.

(WebInspector.DataGrid.prototype._selectSortColumnAndSetOrder):
Changes the selected column to the one with the specified identifier and
then switches the sort order to the given order.

(WebInspector.DataGrid.prototype._headerCellClicked):
Moved logic for switching cells/sort-order to a separate function for
better reusability.

(WebInspector.DataGrid.prototype._contextMenuInHeader):
Adds context menu items on DataGrid header items to change the current
sort order to the specified order. If the context menu is on the selected
header item, only show the sort order that is not currently applied.

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

3 years agoUnreviewed. Fix GTK+ and hopefully EFL build after r196499.
carlosgc@webkit.org [Sat, 13 Feb 2016 08:49:22 +0000 (08:49 +0000)]
Unreviewed. Fix GTK+ and hopefully EFL build after r196499.

* UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
(WebKit::ProcessLauncher::launchProcess):
* UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
(WebKit::PluginProcessProxy::platformGetLaunchOptions):

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

3 years agoChange the last RefPtr::get() to release() in String.prototype.normalize
sukolsak@gmail.com [Sat, 13 Feb 2016 07:21:59 +0000 (07:21 +0000)]
Change the last RefPtr::get() to release() in String.prototype.normalize
https://bugs.webkit.org/show_bug.cgi?id=154211

Reviewed by Ryosuke Niwa.

Change the last RefPtr::get() to release() in String.prototype.normalize.

* runtime/StringPrototype.cpp:
(JSC::normalize):

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

3 years agoAX: Implement paragraph related text marker functions using TextIterator
n_wang@apple.com [Sat, 13 Feb 2016 05:24:24 +0000 (05:24 +0000)]
AX: Implement paragraph related text marker functions using TextIterator
https://bugs.webkit.org/show_bug.cgi?id=154098
<rdar://problem/24269675>

Reviewed by Chris Fleizach.

Source/WebCore:

Using CharacterOffset to implement paragraph related text marker calls. Reused
logic from VisibleUnits class. And refactored textMarkerForCharacterOffset method
to get better performance. Also fixed an issue where we can't navigate through a text
node with line breaks in it using next/previousCharacterOffset call.

Test: accessibility/mac/text-marker-paragraph-nav.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::traverseToOffsetInRange):
(WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
(WebCore::AXObjectCache::characterOffsetForNodeAndOffset):
(WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
(WebCore::AXObjectCache::textMarkerDataForNextCharacterOffset):
(WebCore::AXObjectCache::textMarkerDataForPreviousCharacterOffset):
(WebCore::AXObjectCache::nextNode):
(WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
(WebCore::AXObjectCache::nextCharacterOffset):
(WebCore::AXObjectCache::previousCharacterOffset):
(WebCore::startWordBoundary):
(WebCore::AXObjectCache::startCharacterOffsetOfWord):
(WebCore::AXObjectCache::endCharacterOffsetOfWord):
(WebCore::AXObjectCache::previousWordStartCharacterOffset):
(WebCore::AXObjectCache::previousWordBoundary):
(WebCore::AXObjectCache::startCharacterOffsetOfParagraph):
(WebCore::AXObjectCache::endCharacterOffsetOfParagraph):
(WebCore::AXObjectCache::paragraphForCharacterOffset):
(WebCore::AXObjectCache::nextParagraphEndCharacterOffset):
(WebCore::AXObjectCache::previousParagraphStartCharacterOffset):
(WebCore::AXObjectCache::rootAXEditableElement):
* accessibility/AXObjectCache.h:
(WebCore::CharacterOffset::remaining):
(WebCore::CharacterOffset::isNull):
(WebCore::CharacterOffset::isEqual):
(WebCore::AXObjectCache::isNodeInUse):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(+[WebAccessibilityTextMarker textMarkerWithCharacterOffset:cache:]):
(-[WebAccessibilityObjectWrapper nextMarkerForCharacterOffset:]):
(-[WebAccessibilityObjectWrapper previousMarkerForCharacterOffset:]):
(-[WebAccessibilityObjectWrapper rangeForTextMarkers:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(startOrEndTextmarkerForRange):
(nextTextMarkerForCharacterOffset):
(previousTextMarkerForCharacterOffset):
(-[WebAccessibilityObjectWrapper nextTextMarkerForCharacterOffset:]):
(-[WebAccessibilityObjectWrapper previousTextMarkerForCharacterOffset:]):
(-[WebAccessibilityObjectWrapper textMarkerForCharacterOffset:]):
(textMarkerForCharacterOffset):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(-[WebAccessibilityObjectWrapper nextTextMarkerForNode:offset:]): Deleted.
(-[WebAccessibilityObjectWrapper previousTextMarkerForNode:offset:]): Deleted.
(-[WebAccessibilityObjectWrapper textMarkerForNode:offset:ignoreStart:]): Deleted.
(-[WebAccessibilityObjectWrapper textMarkerForNode:offset:]): Deleted.
* editing/VisibleUnits.cpp:
(WebCore::nextSentencePosition):
(WebCore::findStartOfParagraph):
(WebCore::findEndOfParagraph):
(WebCore::startOfParagraph):
(WebCore::endOfParagraph):
* editing/VisibleUnits.h:

Tools:

* DumpRenderTree/AccessibilityUIElement.cpp:
(nextWordEndTextMarkerForTextMarkerCallback):
(paragraphTextMarkerRangeForTextMarkerCallback):
(previousParagraphStartTextMarkerForTextMarkerCallback):
(nextParagraphEndTextMarkerForTextMarkerCallback):
(setSelectedVisibleTextRangeCallback):
(AccessibilityUIElement::nextWordEndTextMarkerForTextMarker):
(AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker):
(AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker):
(AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::nextWordEndTextMarkerForTextMarker):
(AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker):
(AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker):
(AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::nextWordEndTextMarkerForTextMarker):
(AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker):
(AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker):
(AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker):
(AccessibilityUIElement::supportedActions):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::rightWordTextMarkerRangeForTextMarker):
(WTR::AccessibilityUIElement::previousWordStartTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::nextWordEndTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker):
(WTR::AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::nextWordEndTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker):
(WTR::AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::mathPostscriptsDescription):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::nextWordEndTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::paragraphTextMarkerRangeForTextMarker):
(WTR::AccessibilityUIElement::previousParagraphStartTextMarkerForTextMarker):
(WTR::AccessibilityUIElement::nextParagraphEndTextMarkerForTextMarker):
(WTR::_convertMathMultiscriptPairsToString):

LayoutTests:

* accessibility/mac/text-marker-paragraph-nav-expected.txt: Added.
* accessibility/mac/text-marker-paragraph-nav.html: Added.
* accessibility/text-marker/text-marker-previous-next-expected.txt:
* accessibility/text-marker/text-marker-previous-next.html:

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

3 years ago[ES6] we have an incorrect syntax error when a callee of a function expression has...
sbarati@apple.com [Sat, 13 Feb 2016 04:52:01 +0000 (04:52 +0000)]
[ES6] we have an incorrect syntax error when a callee of a function expression has the same name as a top-level lexical declaration
https://bugs.webkit.org/show_bug.cgi?id=154143

Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

We were raising syntax errors on the following type of programs when
we shouldn't have been.
```
(function foo() { const foo = 20; });
```

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseFunctionInfo):
* parser/Parser.h:
(JSC::Scope::computeLexicallyCapturedVariablesAndPurgeCandidates):
(JSC::Scope::declareCallee):
(JSC::Scope::declareVariable):
(JSC::Scope::hasDeclaredVariable):
(JSC::Scope::hasLexicallyDeclaredVariable):
(JSC::Scope::hasDeclaredParameter):
(JSC::Scope::declareWrite):
(JSC::Scope::getCapturedVars):

LayoutTests:

* js/basic-strict-mode-expected.txt:
* js/let-syntax-expected.txt:
* js/script-tests/let-syntax.js:

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

3 years ago[JSC] ZeroExtend and SignExtend use incorrect addressing on ARM64
commit-queue@webkit.org [Sat, 13 Feb 2016 04:48:40 +0000 (04:48 +0000)]
[JSC] ZeroExtend and SignExtend use incorrect addressing on ARM64
https://bugs.webkit.org/show_bug.cgi?id=154208

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-02-12
Reviewed by Filip Pizlo.

When lowering:
    @1 = Load32(@x)
    @2 = SExt8(@1)

LowerToAir would see there is a form of SignExtend8To32 (an alias for Load8S)
and use that.

There are two problems with that:
1) If we have an Addr, it went through legalizeMemoryOffsets() for a 32bits
   load. If used on an other kind of load, there is no guarantee the addressing
   is still valid.
2) If we have an Index, it is computed for the 32bits MemoryValue.
   The computed index is not valid for the 8bits load.

(2) could be fixed by changing LowerToAir to use the current instruction width
instead of the B3ValueWidth but that's a bit tricky. We should just embrace
that one of our target is a Load-Store architecture.

In this patch, I just disabled the faulty forms on ARM64. We still need those operations
to be fast, this will be addressed in: https://bugs.webkit.org/show_bug.cgi?id=154207

I also strengthened the m_allowScratchRegister assertion. The instructions that do not
invalidate the temporary did not run the assertion, making this harder to debug.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::load8):
(JSC::MacroAssemblerARM64::store64):
(JSC::MacroAssemblerARM64::store32):
(JSC::MacroAssemblerARM64::loadDouble):
(JSC::MacroAssemblerARM64::storeDouble):
(JSC::MacroAssemblerARM64::branch32):
(JSC::MacroAssemblerARM64::branch64):
(JSC::MacroAssemblerARM64::getCachedDataTempRegisterIDAndInvalidate):
(JSC::MacroAssemblerARM64::getCachedMemoryTempRegisterIDAndInvalidate):
(JSC::MacroAssemblerARM64::dataMemoryTempRegister):
(JSC::MacroAssemblerARM64::cachedMemoryTempRegister):
(JSC::MacroAssemblerARM64::load):
(JSC::MacroAssemblerARM64::store):
* b3/air/AirOpcode.opcodes:

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

3 years agoAdd a CSS class to remove padding when using mattewhite class for figures
jond@apple.com [Sat, 13 Feb 2016 03:13:49 +0000 (03:13 +0000)]
Add a CSS class to remove padding when using mattewhite class for figures
https://bugs.webkit.org/show_bug.cgi?id=154206

Reviewed by Filip Pizlo.

* wp-content/themes/webkit/style.css:
(article .two-columns):
(article .two-columns h6):
(article .two-columns p):
(article .mattewhite):
(article .mattewhite.tightwad):
(article figure):

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

3 years agoofflineasm: Emit Dwarf2 file and location directives to allow for debugging .asm...
msaboff@apple.com [Sat, 13 Feb 2016 02:37:19 +0000 (02:37 +0000)]
offlineasm: Emit Dwarf2 file and location directives to allow for debugging .asm files
https://bugs.webkit.org/show_bug.cgi?id=152703

Reviewed by Mark Lam.

Added support to output Dwarf2 .file and .loc assembler directives to provide the debugging
information needed to correlate the offline assembler generated code with the source lines
in the .asm files.

Changed the tracking of file data to include a file index that was provided to the .file
directive.  That index is used when emitting the .loc directives.

* offlineasm/arm.rb:
* offlineasm/arm64.rb:
* offlineasm/asm.rb:
* offlineasm/backends.rb:
* offlineasm/config.rb:
* offlineasm/parser.rb:
* offlineasm/x86.rb:

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

3 years agoUnreviewed, upload some blog files.
fpizlo@apple.com [Sat, 13 Feb 2016 02:00:02 +0000 (02:00 +0000)]
Unreviewed, upload some blog files.

* blog-files/compile-times.png: Added.
* blog-files/fast-isel.png: Added.
* blog-files/jetstream-latency.png: Added.
* blog-files/jetstream-throughput.png: Added.
* blog-files/jetstream.png: Added.
* blog-files/kraken.png: Added.
* blog-files/low-compile-times.png: Added.
* blog-files/low-fast-isel.png: Added.
* blog-files/low-jetstream-latency.png: Added.
* blog-files/low-jetstream-throughput.png: Added.
* blog-files/low-jetstream.png: Added.
* blog-files/low-kraken.png: Added.
* blog-files/low-octane.png: Added.
* blog-files/octane.png: Added.

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

3 years agoUnreviewed, build fix after r196520
jiewen_tan@apple.com [Sat, 13 Feb 2016 01:49:52 +0000 (01:49 +0000)]
Unreviewed, build fix after r196520

* inspector/model/remote-object-get-properties-expected.txt:
* platform/mac/inspector/model/remote-object-expected.txt:

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

3 years agoBASSERTs added in r196421 are causing debug test failures
msaboff@apple.com [Sat, 13 Feb 2016 01:10:22 +0000 (01:10 +0000)]
BASSERTs added in r196421 are causing debug test failures
https://bugs.webkit.org/show_bug.cgi?id=154113

Reviewed by Geoffrey Garen.

In VMHeap::deallocateLargeObject(), we drop the lock to deallocate the physical pages.
If the scavenger thread is running at the same time a synchronous call to scavenge()
comes in, we could call VMHeap::deallocateLargeObject() for an adjacent object while the
lock in the other thread is dropped.  We fix this by checking for adjacent objects we
can merge with and loop if we have one.

* bmalloc/FreeList.h:
(bmalloc::FreeList::push): Added BASSERT to catch adding unmerged free objects
* bmalloc/Heap.cpp:
(bmalloc::Heap::allocateLarge): Changed to use nextCanMerge().
* bmalloc/LargeObject.h:
(bmalloc::LargeObject::prevCanMerge): Repurposed prevIsAllocated.
(bmalloc::LargeObject::nextCanMerge): Repurposed nextIsAllocated.
(bmalloc::LargeObject::prevIsAllocated): Deleted.
(bmalloc::LargeObject::nextIsAllocated): Deleted.
* bmalloc/VMHeap.h:
(bmalloc::VMHeap::allocateLargeObject): Moved adding the extra object back to the free list
to after we set the object we'll return as being allocated.
(bmalloc::VMHeap::deallocateLargeObject):

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

3 years agoMake BCRASH() use breakpoint traps too for non-debug OS(DARWIN).
mark.lam@apple.com [Sat, 13 Feb 2016 01:05:43 +0000 (01:05 +0000)]
Make BCRASH() use breakpoint traps too for non-debug OS(DARWIN).
https://bugs.webkit.org/show_bug.cgi?id=154184

Reviewed by Saam Barati.

This makes it behave consistently with WTFCrash().

* bmalloc/BAssert.h:
* bmalloc/BPlatform.h:

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

3 years agoRebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html for ios-simulator...
ryanhaddad@apple.com [Sat, 13 Feb 2016 00:42:03 +0000 (00:42 +0000)]
Rebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html for ios-simulator after r196520

Unreviewed test gardening.

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

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

3 years agoReset results for bindings tests after r196520
ryanhaddad@apple.com [Sat, 13 Feb 2016 00:36:23 +0000 (00:36 +0000)]
Reset results for bindings tests after r196520

Unreviewed test gardening.

No new tests needed.

* bindings/scripts/test/GObject/WebKitDOMTestEventTarget.cpp:
(webkit_dom_test_event_target_dispatch_event):
* bindings/scripts/test/GObject/WebKitDOMTestNode.cpp:
(webkit_dom_test_node_dispatch_event):

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

3 years agoUnreviewed, rolling out r196527.
commit-queue@webkit.org [Sat, 13 Feb 2016 00:36:19 +0000 (00:36 +0000)]
Unreviewed, rolling out r196527.
https://bugs.webkit.org/show_bug.cgi?id=154204

"Need to redo as WebCoreThreadViolationCheckRoundThree"
(Requested by mlam on #webkit).

Reverted changeset:

"Add thread violation checks to WebView public APIs."
https://bugs.webkit.org/show_bug.cgi?id=154183
http://trac.webkit.org/changeset/196527

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

3 years agoAttempting build fix from https://bugs.webkit.org/show_bug.cgi?id=154144.
sbarati@apple.com [Sat, 13 Feb 2016 00:32:50 +0000 (00:32 +0000)]
Attempting build fix from https://bugs.webkit.org/show_bug.cgi?id=154144.

* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):

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

3 years agoCSP: 'blob:' URLs should not match 'self' in CSP source expression lists.
dbates@webkit.org [Sat, 13 Feb 2016 00:24:28 +0000 (00:24 +0000)]
CSP: 'blob:' URLs should not match 'self' in CSP source expression lists.
https://bugs.webkit.org/show_bug.cgi?id=153158
<rdar://problem/24383264>

Reviewed by Brent Fulgham.

Source/WebCore:

A blob URL should not match source 'self' by section Security Considerations for GUID URL schemes
of the Content Security Policy 2.0 spec., <https://www.w3.org/TR/CSP2/> (21 July 2015).

Tests: http/tests/security/contentSecurityPolicy/blob-url-does-not-match-source-self.html
       http/tests/security/contentSecurityPolicy/blob-url-matches-source-blob.html

* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::matches): Do not make a distinction between URLs that
contain a nested URL (e.g. blob://http://www.example.com/...) and URLs that do not contain a nested
URL. The URL of the requested resource should be matched against the source list source expressions.

LayoutTests:

Add test http/tests/security/contentSecurityPolicy/blob-url-matches-source-blob.html to ensure that a
blob URL matches source "blob:".

Replaced text-only test http/tests/security/contentSecurityPolicy/blob-urls-match-self.html with an
analogous reference test http/tests/security/contentSecurityPolicy/blob-url-does-not-match-source-self.html
so as ensure that we do not regress the behavior that source 'self' should not match a blob URL
without considering the Content Security Policy violation message as part of the expected result.
The Content Security Policy violation message will differ between test runs because it references
the blob URL that triggered the violation, which is cryptographically random.

* TestExpectations: Remove entry for test http/tests/security/contentSecurityPolicy/blob-urls-match-self.html as the analogous test
blob-url-does-not-match-source-self.htm now passes.
* http/tests/security/contentSecurityPolicy/blob-url-does-not-match-source-self-expected.html: Added.
* http/tests/security/contentSecurityPolicy/blob-url-does-not-match-source-self.html: Added.
* http/tests/security/contentSecurityPolicy/blob-url-matches-source-blob-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/blob-url-matches-source-blob.html: Added.
* http/tests/security/contentSecurityPolicy/blob-urls-match-self-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/blob-urls-match-self.html: Removed. See the analogous test blob-url-does-not-match-source-self.html.

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

3 years agoAdd thread violation checks to WebView public APIs.
mark.lam@apple.com [Sat, 13 Feb 2016 00:22:53 +0000 (00:22 +0000)]
Add thread violation checks to WebView public APIs.
https://bugs.webkit.org/show_bug.cgi?id=154183

Reviewed by Geoffrey Garen.

This will help clients of the API detect the violations sooner rather than
having to debug mysterious crashes / failures later.

To that end, I've added thread violation checks to the following functions
because ...

* WebView/WebView.mm:
(-[WebView setCustomTextEncodingName:]):
- Uses the FrameLoader (which is for the main thread only).

(-[WebView stringByEvaluatingJavaScriptFromString:]):
- Invokes JavaScript (which is for the main thread only).

(-[WebView windowScriptObject]):
- Invokes ScriptController::windowScriptObject() which requires the JSLock.

(-[WebView setGroupName:]):
- Manipulates the PageGroup and Page (which is for the main thread only).

(-[WebView setMainFrameURL:]):
- Uses the FrameLoader (which is for the main thread only).

(-[WebView mainFrameTitle]):
- Uses the FrameLoader::documentLoader() (via [WebFrame _dataSource]) which
  is RefPtr, and therefore not safe for other threads to access.

(-[WebView mainFrameIcon]):
- Uses the FrameLoader::documentLoader() (via [WebFrame _dataSource]) which
  is RefPtr, and therefore not safe for other threads to access.
- Uses [WebIconDatabase sharedIconDatabase] which does a singleton
  instantiation but is not protected by a lock.

(-[WebView setDrawsBackground:]):
- Potentially manipulates a RenderView (via FrameView::setBaseBackgroundColor,
  via [WebFrame _updateBackgroundAndUpdatesWhileOffscreen]), and RenderView
  is for main thread only use.

(-[WebView setShouldUpdateWhileOffscreen:]):
- Uses [WebFrame _updateBackgroundAndUpdatesWhileOffscreen].  Hence, for the
  main thread only.

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

3 years agoCSP: Implement child-src directive
dbates@webkit.org [Sat, 13 Feb 2016 00:18:40 +0000 (00:18 +0000)]
CSP: Implement child-src directive
https://bugs.webkit.org/show_bug.cgi?id=153562
<rdar://problem/24610087>

Reviewed by Brent Fulgham.

Source/WebCore:

Add support for the child-src directive, <https://w3c.github.io/webappsec-csp/2/#child_src> (29 August 2015),
which formally replaces the deprecated frame-src directive as of the Content Security Policy 2.0 spec. The
child-src directive was first introduced in the Content Security Policy 1.1 spec, <https://www.w3.org/TR/2014/WD-CSP11-20140211/>.

As a side effect of this change, the script URL for a Web Worker is checked against the child-src directive
as opposed to the script-src directive. This is a backward incompatible change from the CSP 1.0 spec.

Tests: http/tests/security/contentSecurityPolicy/1.1/child-src/frame-fires-load-event-when-blocked.html
       http/tests/security/contentSecurityPolicy/1.1/child-src/frame-fires-load-event-when-redirect-blocked.html
       http/tests/security/contentSecurityPolicy/1.1/child-src/frame-src-takes-precedence-over-child-src.html
       http/tests/security/contentSecurityPolicy/1.1/child-src/worker-redirect-blocked.html
       http/tests/security/isolatedWorld/bypass-main-world-csp-worker-redirect.html

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): Check child-src directive (if applicable).
* loader/ThreadableLoader.h: Add enum value EnforceChildSrcDirective to enum class ContentSecurityPolicyEnforcement to
enforce the child-src directive on redirect.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowChildContextFromSource): Added.
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::checkSourceAndReportViolation): Add message prefix for a child-src violation.
We use the same message prefix as used by Blink.
(WebCore::ContentSecurityPolicyDirectiveList::allowChildContextFromSource): Added.
(WebCore::ContentSecurityPolicyDirectiveList::allowChildFrameFromSource): Modified to check the frame-src
directive (if specified) before checking the child-src directive by <https://w3c.github.io/webappsec-csp/2/#directive-child-src-nested>.
(WebCore::ContentSecurityPolicyDirectiveList::addDirective): Parse the child-src directive.
* page/csp/ContentSecurityPolicyDirectiveList.h:
* workers/AbstractWorker.cpp:
(WebCore::AbstractWorker::resolveURL): Check if the script URL for the worker is allowed by the child-src directive
as opposed to the script-src directive. This is a backwards incompatible change from the CSP 1.0 spec.
* workers/Worker.cpp:
(WebCore::Worker::create): Enforce the child-src directive on redirects (if applicable).

LayoutTests:

Add new tests, un-skip now passing tests and update incorrect expected result for test http/tests/security/contentSecurityPolicy/1.1/child-src/worker-blocked.html.

* TestExpectations: Remove entry for test http/tests/security/contentSecurityPolicy/worker-script-src.html as it now passes.
Mark all tests in http/tests/security/contentSecurityPolicy/1.1/child-src as PASS so that we run them except for tests
frame-fires-load-event-when-blocked.html and frame-fires-load-event-when-redirect-blocked.html (formerly named frame-blocked.html
and frame-redirect-blocked.html, respectively) as they depend on the fix for <https://bugs.webkit.org/show_bug.cgi?id=153150>.
Skip all other CSP 1.1 tests until we fix <https://bugs.webkit.org/show_bug.cgi?id=85558>. Group some CSP 1.1 entries together.
* fast/workers/worker-inherits-csp-blocks-eval-expected.txt: Update expected result based on change to worker-inherits-csp-blocks-eval.html.
* fast/workers/worker-inherits-csp-blocks-eval.html: Remove source 'self' from script-src directive. This was needed as
a workaround for <https://bugs.webkit.org/show_bug.cgi?id=153158> when the script URL for a worker was checked against the
script-src directive. Now that the script URL is checked against the child-src directive we do not need this workaround.
* fast/workers/worker-inherits-csp-blocks-xhr.html: Ditto.
* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-about-blank-allowed.html: Use js-test-{pre, post}.js as opposed to
js-test.js to avoid duplicate "TEST COMPLETE" output.
* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-allowed.html: Ditto.
* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-blocked-expected.txt: Update expected result based on changes to frame-blocked.html.
* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-blocked.html: Update test to work without the fix for <https://bugs.webkit.org/show_bug.cgi?id=153150>.

* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-fires-load-event-when-blocked-expected.txt: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/frame-blocked-expected.txt.
* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-fires-load-event-when-blocked.html: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/frame-blocked.html.
Keep a copy of the original test for when we fix <https://bugs.webkit.org/show_bug.cgi?id=153150>.

* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-fires-load-event-when-redirect-blocked-expected.txt: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/frame-redirect-blocked-expected.txt.
* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-fires-load-event-when-redirect-blocked.html: Copied from LayoutTests/http/tests/security/contentSecurityPolicy/1.1/child-src/frame-redirect-blocked.html.
Keep a copy of the original test for when we fix <https://bugs.webkit.org/show_bug.cgi?id=153150>.

* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-redirect-blocked-expected.txt: Update expected result based on changes to frame-redirect-blocked.html.
* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-redirect-blocked.html: Update test to work without the fix for <https://bugs.webkit.org/show_bug.cgi?id=153150>.
* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-src-takes-precedence-over-child-src-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/child-src/frame-src-takes-precedence-over-child-src.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/child-src/worker-allowed.html: Use js-test-{pre, post}.js as opposed to
js-test.js to avoid duplicate "TEST COMPLETE" output.
* http/tests/security/contentSecurityPolicy/1.1/child-src/worker-blocked-expected.txt: Update incorrect expected result to
reflect WebKit error message. The current result reflects the error message used by Blink.
* http/tests/security/contentSecurityPolicy/1.1/child-src/worker-blocked.html: Use js-test-{pre, post}.js as opposed to
js-test.js to avoid duplicate "TEST COMPLETE" output.
* http/tests/security/contentSecurityPolicy/1.1/child-src/worker-redirect-blocked-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/child-src/worker-redirect-blocked.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/child-src/worker-shared-allowed-expected.txt: Removed; WebKit does not support shared Web Workers.
* http/tests/security/contentSecurityPolicy/1.1/child-src/worker-shared-allowed.html: Removed; WebKit does not support shared Web Workers.
* http/tests/security/contentSecurityPolicy/1.1/child-src/worker-shared-blocked-expected.txt: Removed; WebKit does not support shared Web Workers.
* http/tests/security/contentSecurityPolicy/1.1/child-src/worker-shared-blocked.html: Removed; WebKit does not support shared Web Workers.
* http/tests/security/contentSecurityPolicy/resources/child-src-test.js: Remove logic for testing shared Web Workers as WebKit does not support such workers.
(window.onload): Deleted.
(injectSharedWorker): Deleted.
* http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-blocks-eval-expected.txt: Update expected result based on change to worker-blob-inherits-csp-blocks-eval.html.
* http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-blocks-eval.html: Remove source 'self' from script-src directive.
This was needed as a workaround for <https://bugs.webkit.org/show_bug.cgi?id=153158> when the script URL for a worker was checked
against the script-src directive. Now that the script URL is checked against the child-src directive we do not need this workaround.
* http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-importScripts-block-aborts-all-subsequent-imports-expected.txt: Update
expected result based on change to worker-blob-inherits-csp-importScripts-block-aborts-all-subsequent-imports.html.
* http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-importScripts-block-aborts-all-subsequent-imports.html:
Remove source 'self' from script-src directive. This was needed as a workaround for <https://bugs.webkit.org/show_bug.cgi?id=153158> when
the script URL for a worker was checked against the script-src directive. Now that the script URL is checked against the child-src directive
we do not need this workaround.
* http/tests/security/contentSecurityPolicy/worker-blob-inherits-csp-importScripts-redirect-cross-origin-blocked.html: Ditto.
* http/tests/security/isolatedWorld/bypass-main-world-csp-worker.html: Add child-src 'none' and remove FIXME comment.
* http/tests/security/isolatedWorld/bypass-main-world-csp-worker-redirect-expected.txt: Added.
* http/tests/security/isolatedWorld/bypass-main-world-csp-worker-redirect.html: Added.
* platform/ios-simulator/TestExpectations: Remove skip entry for tests in http/tests/security/contentSecurityPolicy/1.1 from this file.
Instead we will skip these tests from LayoutTests/TestExpectations since they fail for all ports.
* platform/mac/TestExpectations: Ditto.
* platform/win/TestExpectations: Ditto.
* platform/wk2/TestExpectations: Ditto.

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

3 years agoThe parser doesn't properly protect against global variable references in builtins
sbarati@apple.com [Sat, 13 Feb 2016 00:12:54 +0000 (00:12 +0000)]
The parser doesn't properly protect against global variable references in builtins
https://bugs.webkit.org/show_bug.cgi?id=154144

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch fixes our global variable reference detection
algorithm that was broken. After fixing the algorithm, I
detected many places where we were incorrectly using global
variables. I've fixed all those.

* builtins/BuiltinExecutables.cpp:
(JSC::createExecutableInternal):
* builtins/NumberPrototype.js:
(toLocaleString):
* builtins/PromiseConstructor.js:
(race):
(reject):
(resolve):
* parser/Nodes.cpp:
(JSC::ProgramNode::ProgramNode):
(JSC::ModuleProgramNode::ModuleProgramNode):
(JSC::ProgramNode::setClosedVariables): Deleted.
* parser/Nodes.h:
(JSC::ScopeNode::setClosedVariables): Deleted.
(JSC::ProgramNode::closedVariables): Deleted.
* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseInner):
(JSC::Parser<LexerType>::didFinishParsing):
* parser/Parser.h:
(JSC::Scope::setIsLexicalScope):
(JSC::Scope::isLexicalScope):
(JSC::Scope::closedVariableCandidates):
(JSC::Scope::declaredVariables):
(JSC::Scope::lexicalVariables):
(JSC::Scope::finalizeLexicalEnvironment):
(JSC::Parser::positionBeforeLastNewline):
(JSC::Parser::locationBeforeLastToken):
(JSC::Parser::isFunctionMetadataNode):
(JSC::parse):
(JSC::Parser::closedVariables): Deleted.

Source/WebCore:

Change JS builtins to no longer reference global variables.

No new tests because old tests cover the issues here.

* Modules/mediastream/NavigatorUserMedia.js:
(webkitGetUserMedia):
* Modules/mediastream/RTCPeerConnection.js:
(addIceCandidate):
(getStats):
* Modules/mediastream/RTCPeerConnectionInternals.js:
(setLocalOrRemoteDescription):
* Modules/plugins/QuickTimePluginReplacement.js:
(Replacement.prototype.handleEvent):
* Modules/streams/ByteLengthQueuingStrategy.js:
(initializeByteLengthQueuingStrategy):
* Modules/streams/CountQueuingStrategy.js:
(initializeCountQueuingStrategy):
* Modules/streams/ReadableStreamInternals.js:
(teeReadableStream):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/WebCoreBuiltinNames.h:

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

3 years agoJSObject::putByIndexBeyondVectorLengthWithoutAttributes needs to go to the sparse...
fpizlo@apple.com [Sat, 13 Feb 2016 00:07:04 +0000 (00:07 +0000)]
JSObject::putByIndexBeyondVectorLengthWithoutAttributes needs to go to the sparse map based on MAX_STORAGE_VECTOR_INDEX
https://bugs.webkit.org/show_bug.cgi?id=154201
rdar://problem/24291387

Reviewed by Saam Barati.

I decided against adding a test for this, because it runs for a very long time.

* runtime/JSObject.cpp:
(JSC::JSObject::putByIndexBeyondVectorLengthWithoutAttributes): Fix the bug.
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncSplit): Fix a related bug: if this code creates an array that would have
    hit the above bug, then it would probably manifest as a spin or as swapping.

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

3 years agoRe-enable skipped animations tests on ios-simulator.
ryanhaddad@apple.com [Sat, 13 Feb 2016 00:06:42 +0000 (00:06 +0000)]
Re-enable skipped animations tests on ios-simulator.
https://bugs.webkit.org/show_bug.cgi?id=152131

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-simulator/TestExpectations:

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

3 years agoAdd WebAssembly to the status page
jond@apple.com [Fri, 12 Feb 2016 23:34:58 +0000 (23:34 +0000)]
Add WebAssembly to the status page
https://bugs.webkit.org/show_bug.cgi?id=154199

Reviewed by Timothy Hatcher.

* features.json:

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

3 years agoPerf dashboard should allow renaming analysis tasks and test groups
rniwa@webkit.org [Fri, 12 Feb 2016 23:33:18 +0000 (23:33 +0000)]
Perf dashboard should allow renaming analysis tasks and test groups
https://bugs.webkit.org/show_bug.cgi?id=154200

Reviewed by Chris Dumez.

Allow editing names of analysis tasks and A/B testing groups in the v3 UI.

Added the support for updating the name to the privileged API at /privileged-api/update-analysis-task
and added a new prevailed API to update A/B testing groups at /privileged-api/update-test-group.

* public/privileged-api/update-analysis-task.php: Added the support for renaming the analysis task.
(main):

* public/privileged-api/update-test-group.php: Added. Supports updating the test group's name.
(main):

* public/v3/components/editable-text.js: Added.
(EditableText): Added. A new editable text label control. It looks like a text node with "(Edit)" link
at the end which allow users to go into the "editing mode", which reveals an input element.
The user can exit the editing mode by either moving the focus away from the control or clicking on
"(Save)" at the end. It calls _updateCallback in the latter case.
(EditableText.prototype.editedText): Returns the current value of the input element user.
(EditableText.prototype.setText): Sets the label. This does not live-update the input element until
the user exists the current editing mode and re-enters it.
(EditableText.prototype.setStartedEditingCallback): Sets a callback which gets called when the user
requested to enter the editing mode. Since EditableText relies on AnalysisTaskPage to render, this
callback only exits to call EditableText.render() in AnalysisTask._didStartEditingTaskName.
(EditableText.prototype.setUpdateCallback): Sets a callback which gets called when the user exits
the editing mode by activating the "(Save)" link. This callback MUST return a promise upon resolution
of which the control gets out of the editing mode. While the promise is in flight, the input element
becomes readonly.
(EditableText.prototype.render): Updates various states of the elements. When _updatingPromise is not
falsy, we make the input element readonly and show '(...)' on the link. Don't show the action link
if the label is empty (e.g. analysis task or test group is still being fetched).
(EditableText.prototype._didClick): Called when the user clicked on the action link. Enter the editing
mode or save the edited label via _updateCallback.
(EditableText.prototype._didBlur): Exit the editing mode without saving if the input element is not
focused, there is no inflight promise returned by _updateCallback, and the action link "(Save)" does
not have the focus.
(EditableText.prototype._didUpdate): Called when exiting the editing mode.
(EditableText.htmlTemplate):
(EditableText.cssTemplate):

* public/v3/index.html: Include newly added editable-text.js.

* public/v3/models/analysis-task.js:
(AnalysisTask.prototype.updateSingleton): Added.
(AnalysisTask.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
the analysis task from the sever.
(AnalysisTask._constructAnalysisTasksFromRawData): Use ensureSingleton instead of manually calling
findById since we need to update the name of the singleton object we found (via updateSingleton).

* public/v3/models/bug.js:
(Bug.ensureSingleton): Moved the code to compute the synthetic id from AnalysisTask's
_constructAnalysisTasksFromRawData.
(Bug.prototype.updateSingleton): Added. Just assert that nothing changes.

* public/v3/models/build-request.js:
(BuildRequest.prototype.updateSingleton): Added. Assert that the intrinsic values of a build request
doesn't change and update status text, status url, and build id as they could change.

* public/v3/models/commit-log.js:
(CommitLog): Made the constructor argument conform to the convention of id, object pair so that we can
use DataModelObject.ensureSingleton.
(CommitLog.ensureSingleton):
(CommitLog.prototype.updateSingleton): Extracted from CommitLog.ensureSingleton.

* public/v3/models/data-model.js:
(DataModelObject.ensureSingleton): Call newly added updateSingleton.
(DataModelObject.prototype.updateSingleton):
(LabeledObject): Removed the name map since it's never used (findByName is never called anywhere).
(LabeledObject.prototype.updateSingleton): Added. Updates _name.
(LabeledObject.findByName): Deleted.

* public/v3/models/test-group.js:
(TestGroup.prototype.updateName): Added. Uses PrivilegedAPI to update the name and re-fetches
the test group from the sever.
(TestGroup._createModelsFromFetchedTestGroups): Removed bogus code. A root set doesn't have a test
group associated with it since multiple test groups can share a single root set (this property doesn't
even exist).

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskPage): Removed useless _taskId and added this._testGroupLabelMap and this._taskNameLabel.
(AnalysisTaskPage.prototype.updateFromSerializedState): Cleanup.
(AnalysisTaskPage.prototype._didFetchTask): Assert that this function is called exactly once.
(AnalysisTaskPage.prototype.render): Use this._task.id() to show the v2 link. Use EditableText to show
the names of the analysis task and the associated test groups. Hide the overview chart and the list of
test groups (along with the retry/confirm button) when the analysis task failed to fetch. We always
update the names of the analysis task and the associated test groups since they could be updated by
the server.
(AnalysisTaskPage.prototype._didStartEditingTaskName): Added.
(AnalysisTaskPage.prototype._updateTaskName): Added.
(AnalysisTaskPage.prototype._updateTestGroupName): Added.
(AnalysisTaskPage.htmlTemplate): Updated the style.

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

3 years agoWebKit should expose the DOM 4 Event.isTrusted property
jiewen_tan@apple.com [Fri, 12 Feb 2016 23:25:02 +0000 (23:25 +0000)]
WebKit should expose the DOM 4 Event.isTrusted property
https://bugs.webkit.org/show_bug.cgi?id=76121
<rdar://problem/22558494>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/dom/events/Event-constructors-expected.txt:
* web-platform-tests/dom/events/Event-dispatch-redispatch-expected.txt:
* web-platform-tests/dom/events/Event-initEvent-expected.txt:
* web-platform-tests/dom/events/ProgressEvent-expected.txt:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/nodes/Document-createEvent-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:
* web-platform-tests/html/semantics/forms/the-button-element/button-events-expected.txt:

Source/WebCore:

Implements Event.isTrusted. The implementation here is slitely different from and better than
the DOM specification. Here Event.isTrusted will be initialized differently depending on the
callers of the constructors/create methods. If the caller is from user agent, the isTrusted
will be true. Otherwise, it will be false. Since a user agent dispatched event can be catched
and re-initialized/redispatched by the bindings, the flag will be unset at *Event::init*Event
and EventTarget::dispatchEventForBindings. As currently there is no way to let user agent to
dispatch a bindings created event, therefore we ensure that the Event.isTrusted is set for
events dispatched by user agent, and unset for those by bindings.

EventTarget::dispatchEvent(Event*, ExceptionCode&) is renamed to EventTarget::dispatchEventForBindings
in this patch as well. So that, together with the improved design of the API, developers in
the future will be less likely using a wrong dispatchEvent method and setting Event.isTrusted
incorrectly comparing to the DOM design.

After this patch, all events that are created by user agent should be dispatched by
EventTarget::dispatchEvent, and those are created by bindings should be dispatched by
EventTarget::dispatchEventForBindings.

Some of the changes in this patch referred Blink r198996:
https://codereview.chromium.org/1241613004

Test: imported/blink/fast/events/event-trusted.html

* bindings/scripts/CodeGeneratorGObject.pm:
(GenerateEventTargetIface):
* dom/Event.cpp:
(WebCore::Event::Event):
(WebCore::Event::initEvent):
* dom/Event.h:
(WebCore::Event::isTrusted):
(WebCore::Event::setUntrusted):
* dom/Event.idl:
* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEventForBindings):
(WebCore::EventTarget::dispatchEvent): Deleted.
* dom/EventTarget.h:
* dom/EventTarget.idl:
* page/DOMWindow.idl:
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchDragEvent):
* workers/WorkerGlobalScope.idl:

Source/WebKit/win:

* DOMCoreClasses.cpp:
(DOMNode::dispatchEvent):
(DOMWindow::dispatchEvent):

LayoutTests:

* fast/dom/unforgeable-attributes-expected.txt:
* fast/xmlhttprequest/xmlhttprequest-get-expected.txt:
* http/tests/workers/worker-importScriptsOnError-expected.txt:
* imported/blink/fast/events/event-trusted-expected.txt: Added.
* imported/blink/fast/events/event-trusted.html: Added.
* platform/ios-simulator/TestExpectations:

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

3 years agoModern IDB: IDBObjectStore and IDBIndex need to be ActiveDOMObjects.
beidson@apple.com [Fri, 12 Feb 2016 23:16:57 +0000 (23:16 +0000)]
Modern IDB: IDBObjectStore and IDBIndex need to be ActiveDOMObjects.
https://bugs.webkit.org/show_bug.cgi?id=154153

Reviewed by Alex Christensen.

No new tests (No testable change in behavior).

This is needed so that IDBObjectStore and IDBIndex JS wrappers are not garbage collected
while their IDBTransaction is still in progress.

* Modules/indexeddb/client/IDBIndexImpl.cpp:
(WebCore::IDBClient::IDBIndex::IDBIndex):
(WebCore::IDBClient::IDBIndex::activeDOMObjectName):
(WebCore::IDBClient::IDBIndex::canSuspendForDocumentSuspension):
(WebCore::IDBClient::IDBIndex::hasPendingActivity):
* Modules/indexeddb/client/IDBIndexImpl.h:

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::create):
(WebCore::IDBClient::IDBObjectStore::IDBObjectStore):
(WebCore::IDBClient::IDBObjectStore::activeDOMObjectName):
(WebCore::IDBClient::IDBObjectStore::canSuspendForDocumentSuspension):
(WebCore::IDBClient::IDBObjectStore::hasPendingActivity):
(WebCore::IDBClient::IDBObjectStore::index):
* Modules/indexeddb/client/IDBObjectStoreImpl.h:

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::objectStore):
(WebCore::IDBClient::IDBTransaction::createObjectStore):
(WebCore::IDBClient::IDBTransaction::createIndex):

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

3 years agoModern IDB: Simplify the relationship between IDBObjectStore and IDBIndex.
beidson@apple.com [Fri, 12 Feb 2016 23:01:20 +0000 (23:01 +0000)]
Modern IDB: Simplify the relationship between IDBObjectStore and IDBIndex.
https://bugs.webkit.org/show_bug.cgi?id=154187

Reviewed by Alex Christensen.

Source/WebCore:

Tests: storage/indexeddb/modern/deleteindex-3-private.html
       storage/indexeddb/modern/deleteindex-3.html

Instead of allowing IDBIndex to have two different lifecycle modes, it is now always
owned by an IDBObjectStore.

To support the case where an IDBIndex is deleted from its IDBObjectStore, the object
store simply hangs on to deleted indexes until it is destroyed itself.

* Modules/indexeddb/client/IDBIndexImpl.cpp:
(WebCore::IDBClient::IDBIndex::markAsDeleted):
(WebCore::IDBClient::IDBIndex::ref):
(WebCore::IDBClient::IDBIndex::deref):
* Modules/indexeddb/client/IDBIndexImpl.h:

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::deleteIndex):
* Modules/indexeddb/client/IDBObjectStoreImpl.h:

LayoutTests:

* storage/indexeddb/modern/deleteindex-3-expected.txt: Added.
* storage/indexeddb/modern/deleteindex-3-private-expected.txt: Added.
* storage/indexeddb/modern/deleteindex-3-private.html: Added.
* storage/indexeddb/modern/deleteindex-3.html: Added.
* storage/indexeddb/modern/resources/deleteindex-3.js: Added.

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

3 years agoWeb Inspector: Rename domAgent to domTreeManager in DOMNode
commit-queue@webkit.org [Fri, 12 Feb 2016 22:44:22 +0000 (22:44 +0000)]
Web Inspector: Rename domAgent to domTreeManager in DOMNode
https://bugs.webkit.org/show_bug.cgi?id=154194

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-02-12
Reviewed by Timothy Hatcher.

* UserInterface/Models/DOMNode.js:
(WebInspector.DOMNode):

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

3 years agoOpen source bot watcher's dashboard fails assertion in BuildbotQueue.prototype.compar...
jmarcell@apple.com [Fri, 12 Feb 2016 22:37:50 +0000 (22:37 +0000)]
Open source bot watcher's dashboard fails assertion in BuildbotQueue.prototype.compareIterationsByRevisions
https://bugs.webkit.org/show_bug.cgi?id=154180

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js: Remove reference to Internal
repository.

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

3 years agoWeb Inspector: disambiguate the various identifier and connection types in RemoteInsp...
bburg@apple.com [Fri, 12 Feb 2016 22:35:45 +0000 (22:35 +0000)]
Web Inspector: disambiguate the various identifier and connection types in RemoteInspector
https://bugs.webkit.org/show_bug.cgi?id=154130

Reviewed by Joseph Pecoraro.

There are multiple identifier types:
    - connection identifier, a string UUID for a remote debugger process.
    - session identifier, a string UUID for a remote driver/debugger instance.
    - page/target identifier, a number unique within a single process.

There are multiple connection types:
    - RemoteInspectorXPCConnection, a connection from RemoteInspectorXPCConnectionor to a relay.
    - RemoteConnectionToTarget, a class that bridges to targets' dispatch queues.

Use consistent variable and getter names so that these don't get confused and
so that the code is easier to read. This is especially an improvement when working
with multiple target types or connection types within the same function.

* inspector/remote/RemoteConnectionToTarget.h:
* inspector/remote/RemoteConnectionToTarget.mm:
Remove the member for m_identifier since we can ask the target for its target identifier
or use a default value via WTF::Optional. There's no reason to cache the value.

(Inspector::RemoteTargetHandleRunSourceWithInfo):
(Inspector::RemoteConnectionToTarget::targetIdentifier):
(Inspector::RemoteConnectionToTarget::destination):
(Inspector::RemoteConnectionToTarget::setup):
(Inspector::RemoteConnectionToTarget::sendMessageToFrontend):
Bail out if the target pointer was somehow cleared and we can't get a useful target identifier.

(Inspector::RemoteConnectionToTarget::RemoteConnectionToTarget): Deleted.
* inspector/remote/RemoteControllableTarget.h:
* inspector/remote/RemoteInspectionTarget.cpp:
(Inspector::RemoteInspectionTarget::pauseWaitingForAutomaticInspection):
(Inspector::RemoteInspectionTarget::unpauseForInitializedInspector):
* inspector/remote/RemoteInspector.h:
* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::nextAvailableTargetIdentifier):
(Inspector::RemoteInspector::registerTarget):
(Inspector::RemoteInspector::unregisterTarget):
(Inspector::RemoteInspector::updateTarget):
(Inspector::RemoteInspector::updateAutomaticInspectionCandidate):
(Inspector::RemoteInspector::sendAutomaticInspectionCandidateMessage):
(Inspector::RemoteInspector::sendMessageToRemote):
(Inspector::RemoteInspector::setupFailed):
(Inspector::RemoteInspector::setupCompleted):
(Inspector::RemoteInspector::stopInternal):
(Inspector::RemoteInspector::setupXPCConnectionIfNeeded):
(Inspector::RemoteInspector::xpcConnectionFailed):
(Inspector::RemoteInspector::listingForInspectionTarget):
(Inspector::RemoteInspector::listingForAutomationTarget):
(Inspector::RemoteInspector::pushListingsNow):
(Inspector::RemoteInspector::pushListingsSoon):
(Inspector::RemoteInspector::updateHasActiveDebugSession):
(Inspector::RemoteInspector::receivedSetupMessage):
(Inspector::RemoteInspector::receivedDataMessage):
(Inspector::RemoteInspector::receivedDidCloseMessage):
(Inspector::RemoteInspector::receivedIndicateMessage):
(Inspector::RemoteInspector::receivedProxyApplicationSetupMessage):
(Inspector::RemoteInspector::receivedConnectionDiedMessage):
(Inspector::RemoteInspector::receivedAutomaticInspectionRejectMessage):
(Inspector::RemoteInspector::nextAvailableIdentifier): Deleted.
* inspector/remote/RemoteInspectorConstants.h:

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

3 years agoREGRESSION: Link preview is slow and unreliable
bdakin@apple.com [Fri, 12 Feb 2016 22:34:42 +0000 (22:34 +0000)]
REGRESSION: Link preview is slow and unreliable
https://bugs.webkit.org/show_bug.cgi?id=154197
-and corresponding-
rdar://problem/24428064

Reviewed by Tim Horton.

This patch rolls http://trac.webkit.org/changeset/187471 back in. That was
how we fixed this problem ages ago. We rolled it out because it very
mysteriously seemed to cause a memory regression, but we want to track that
separately and not leave this performance regression in its place in the
meantime.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateViewState):
(WebKit::WebPageProxy::dispatchViewStateChange):
(WebKit::WebPageProxy::updateActivityToken):

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

3 years ago[JSC] On x86, improve the selection of which value are selected for the UseDef part...
benjamin@webkit.org [Fri, 12 Feb 2016 22:32:44 +0000 (22:32 +0000)]
[JSC] On x86, improve the selection of which value are selected for the UseDef part of commutative operations
https://bugs.webkit.org/show_bug.cgi?id=154151

Reviewed by Filip Pizlo.

Previously, when an instruction destroy an argument with
a UseDef use, we would try to pick a good target for the UseDef
while doing instruction selection.

For example:
    @x = Add(@1, @2)

can be lowered to:
    Move @1 Tmp3
    Add @2 Tmp3
or
    Move @2 Tmp3
    Add @1 Tmp3

The choice of which value ends up copied is done by preferRightForResult()
at lowering time.

There are two common problems with the code we generate:
1) It is based on UseCount. If a value is at its last use,
   it is a good target for coalescing even with a use-count > 1.
2) When both values are at their last use, the best choice
   depends on the register pressure of each. We don't have that information
   until we do register allocation.

This patch implements a simple idea to minimize how many of those Moves are needed.
Each commutative operation gets a 3 op variant. The register allocator then attempts
to alias *both* of them to the destination.
Since our aliasing is conservative, it removes as many copy as possible without causing
spilling.

There was an unexpected cool impovement too. If you have:
    Move Tmp1, Tmp2
    BranchAdd32 Tmp3, Tmp2
we would previously restore Tmp2 by substracting Tmp3 from the result.
We can now just use Tmp1. That removes quite a few Sub from the slow paths.

The problem is that simple idea uncoverred a bunch of issues that had to be fixed too.
I detail them inline below.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::and64):
* assembler/MacroAssemblerX86Common.h:
Most addition are adding an Address version of the 3 operands opcodes.
The reason for this is allow the complex addressing forms of instructions
when spilling.

(JSC::MacroAssemblerX86Common::and32):
(JSC::MacroAssemblerX86Common::mul32):
(JSC::MacroAssemblerX86Common::or32):
(JSC::MacroAssemblerX86Common::xor32):
(JSC::MacroAssemblerX86Common::moveDouble):
This was an unexpected discovery: removing tons of Move32 made floating-point heavy
code much slower.

It turns out the MoveDouble we were using has partial register dependencies.

The x86 optimization manual, Chapter 3, section 3.4.1.13 lists the move instructions executed
directly on the frontend. That's what we use now.

(JSC::MacroAssemblerX86Common::addDouble):
(JSC::MacroAssemblerX86Common::addFloat):
(JSC::MacroAssemblerX86Common::mulDouble):
(JSC::MacroAssemblerX86Common::mulFloat):
(JSC::MacroAssemblerX86Common::andDouble):
(JSC::MacroAssemblerX86Common::andFloat):
(JSC::MacroAssemblerX86Common::xorDouble):
(JSC::MacroAssemblerX86Common::xorFloat):
If the destination is not aliased, the version taking an address
use LoadFloat/LoadDouble instead of direct addressing.

That is because this:
    Move Tmp1, Tmp2
    Op [Tmp3], Tmp2
is slower than
    Move [Tmp3] Tmp2
    Op Tmp1, Tmp2
(sometimes significantly).

I am not exactly sure why.

(JSC::MacroAssemblerX86Common::branchAdd32):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::and64):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::and64):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::and32):
(JSC::MacroAssemblerX86Common::mul32):
(JSC::MacroAssemblerX86Common::or32):
(JSC::MacroAssemblerX86Common::xor32):
(JSC::MacroAssemblerX86Common::moveDouble):
(JSC::MacroAssemblerX86Common::addDouble):
(JSC::MacroAssemblerX86Common::addFloat):
(JSC::MacroAssemblerX86Common::mulDouble):
(JSC::MacroAssemblerX86Common::mulFloat):
(JSC::MacroAssemblerX86Common::andDouble):
(JSC::MacroAssemblerX86Common::andFloat):
(JSC::MacroAssemblerX86Common::xorDouble):
(JSC::MacroAssemblerX86Common::xorFloat):
(JSC::MacroAssemblerX86Common::branchAdd32):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::and64):
(JSC::MacroAssemblerX86_64::mul64):
(JSC::MacroAssemblerX86_64::xor64):
(JSC::MacroAssemblerX86_64::branchAdd64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::movapd_rr):
(JSC::X86Assembler::movaps_rr):
* b3/B3CheckSpecial.cpp:
(JSC::B3::CheckSpecial::shouldTryAliasingDef):
(JSC::B3::CheckSpecial::generate):
* b3/B3CheckSpecial.h:
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::lower):
* b3/air/AirCustom.h:
(JSC::B3::Air::PatchCustom::shouldTryAliasingDef):
* b3/air/AirInst.h:
* b3/air/AirInstInlines.h:
(JSC::B3::Air::Inst::shouldTryAliasingDef):
* b3/air/AirIteratedRegisterCoalescing.cpp:
Aliasing the operands is done the same way as any coalescing.

There were problem with considering all those coalescing
as equivalent for the result.

Moves are mostly generated for Upsilon-Phis. Getting rid of
those tends to give better loops.

Sometimes, blocks have only Phis and a Jump. Coalescing
those moves gets rids of the block entirely.

Where it go interesting was that something like:
    Move Tmp1, Tmp2
    Op Tmp3, Tmp2
was significantly better than:
    Op Tmp1, Tmp3
    Move Tmp1, Tmp4
even in the same basic block.

To get back to the same performance when, I had to prioritize
regular Moves operations over argument coalescing.

Another argument for doing this is that the alias has a shorter
life in the hardware because the operation itself gets a new
virtual register from the bank.

* b3/air/AirOpcode.opcodes:
* b3/air/AirSpecial.cpp:
(JSC::B3::Air::Special::shouldTryAliasingDef):
* b3/air/AirSpecial.h:
* b3/testb3.cpp:
(JSC::B3::testCheckAddArgumentAliasing64):
(JSC::B3::testCheckAddArgumentAliasing32):
(JSC::B3::testCheckAddSelfOverflow64):
(JSC::B3::testCheckAddSelfOverflow32):
(JSC::B3::testCheckMulArgumentAliasing64):
(JSC::B3::testCheckMulArgumentAliasing32):
(JSC::B3::run):

* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::reifyInlinedCallFrames):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitSaveOrCopyCalleeSavesFor):
This ruined my week.

When regenerating the frame of an inlined function that
was called through a tail call, we were ignoring r13 for some reason.

Since this patch makes it more likely to increase the degree
of each Tmp, the number of register used increased and r13 was more
commonly used.

When getting out of OSRExit, we would have that value trashed :(

The fix is simply to restore it like the other two Baseline callee saved
register.

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

3 years agoWeb Inspector: Avoid including ESLint until it is used
commit-queue@webkit.org [Fri, 12 Feb 2016 22:31:08 +0000 (22:31 +0000)]
Web Inspector: Avoid including ESLint until it is used
https://bugs.webkit.org/show_bug.cgi?id=154196

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-02-12
Reviewed by Timothy Hatcher.

* Scripts/copy-user-interface-resources.pl:
Do not include ESLint in optimized output yet.

* UserInterface/Controllers/AnalyzerManager.js:
Do not reference `eslint` until we use it.

* UserInterface/Main.html:
Remove include to ESLint until we need it.

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

3 years agoGet rid of a 6 year old compiler workaround
andersca@apple.com [Fri, 12 Feb 2016 22:30:37 +0000 (22:30 +0000)]
Get rid of a 6 year old compiler workaround
https://bugs.webkit.org/show_bug.cgi?id=154198

Reviewed by Sam Weinig.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::connectToService):
(WebKit::createService):

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

3 years ago[CSS Font Loading] Implement CSSFontFace Boilerplate
mmaxfield@apple.com [Fri, 12 Feb 2016 22:22:20 +0000 (22:22 +0000)]
[CSS Font Loading] Implement CSSFontFace Boilerplate
https://bugs.webkit.org/show_bug.cgi?id=154145

Reviewed by Dean Jackson.

The CSS Font Loading spec[1] dictates that the FontFace object needs to have string
accessors and mutators for a bunch of properties. Our CSSFontFace object currently
contains this parsed information, but it isn't accessible via string-based methods.
This patch adds the necessary accessors and mutators, and migrates CSSFontSelector
to use these mutators where necessary.

There is more work to come on CSSFontFace; the next step is to create an .idl file
and hook it up to our CSSFontFace object. In this patch I have left some
unimplemented pieces (for example: where the spec dictates that some operation should
throw a JavaScript exception) which will be implemented in a follow-up patch. This
patch does not have any visible behavior change; I'm separating out the boilerplate
into this patch in order to ease reviewing burden.

This patch separates the externally-facing JavaScript API into a new class, FontFace.
This class owns a CSSFontFace, which provides the backing implementation. There will
be a system of shared ownership of these objects once FontFaceSet is implemented.

No new tests because there is no behavior change.

* CMakeLists.txt: Add new files to CMake builds.
* WebCore.vcxproj/WebCore.vcxproj: Ditto for Windows.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto for Cocoa.
* css/CSSAllInOne.cpp: Ditto for All-In-One builds.
* css/CSSFontFace.cpp: Move shared code from CSSFontSelector into CSSFontFace.
(WebCore::CSSFontFace::CSSFontFace):
(WebCore::CSSFontFace::~CSSFontFace):
(WebCore::CSSFontFace::setFamilies):
(WebCore::CSSFontFace::setStyle):
(WebCore::CSSFontFace::setWeight):
(WebCore::CSSFontFace::setUnicodeRange):
(WebCore::CSSFontFace::setVariantLigatures):
(WebCore::CSSFontFace::setVariantPosition):
(WebCore::CSSFontFace::setVariantCaps):
(WebCore::CSSFontFace::setVariantNumeric):
(WebCore::CSSFontFace::setVariantAlternates):
(WebCore::CSSFontFace::setVariantEastAsian):
(WebCore::CSSFontFace::setFeatureSettings):
* css/CSSFontFace.h: Clean up.
(WebCore::CSSFontFace::create):
(WebCore::CSSFontFace::families):
(WebCore::CSSFontFace::traitsMask):
(WebCore::CSSFontFace::featureSettings):
(WebCore::CSSFontFace::variantSettings):
(WebCore::CSSFontFace::setVariantSettings):
(WebCore::CSSFontFace::setTraitsMask):
(WebCore::CSSFontFace::isLocalFallback):
(WebCore::CSSFontFace::addRange): Deleted.
(WebCore::CSSFontFace::insertFeature): Deleted.
(WebCore::CSSFontFace::setVariantCommonLigatures): Deleted.
(WebCore::CSSFontFace::setVariantDiscretionaryLigatures): Deleted.
(WebCore::CSSFontFace::setVariantHistoricalLigatures): Deleted.
(WebCore::CSSFontFace::setVariantContextualAlternates): Deleted.
(WebCore::CSSFontFace::setVariantPosition): Deleted.
(WebCore::CSSFontFace::setVariantCaps): Deleted.
(WebCore::CSSFontFace::setVariantNumericFigure): Deleted.
(WebCore::CSSFontFace::setVariantNumericSpacing): Deleted.
(WebCore::CSSFontFace::setVariantNumericFraction): Deleted.
(WebCore::CSSFontFace::setVariantNumericOrdinal): Deleted.
(WebCore::CSSFontFace::setVariantNumericSlashedZero): Deleted.
(WebCore::CSSFontFace::setVariantAlternates): Deleted.
(WebCore::CSSFontFace::setVariantEastAsianVariant): Deleted.
(WebCore::CSSFontFace::setVariantEastAsianWidth): Deleted.
(WebCore::CSSFontFace::setVariantEastAsianRuby): Deleted.
(WebCore::CSSFontFace::CSSFontFace): Deleted.
* css/CSSFontSelector.cpp: Migrate shared code into CSSFontFace, and udpate
to use the new API.
(WebCore::appendSources):
(WebCore::registerLocalFontFacesForFamily):
(WebCore::CSSFontSelector::addFontFaceRule):
(WebCore::computeTraitsMask): Deleted.
(WebCore::createFontFace): Deleted.
* css/FontFace.cpp: Added. External JavaScript API. Owns a CSSFontFace.
(WebCore::FontFace::FontFace):
(WebCore::FontFace::~FontFace):
(WebCore::parseString):
(WebCore::FontFace::setFamily):
(WebCore::FontFace::setStyle):
(WebCore::FontFace::setWeight):
(WebCore::FontFace::setStretch):
(WebCore::FontFace::setUnicodeRange):
(WebCore::FontFace::setVariant):
(WebCore::FontFace::setFeatureSettings):
(WebCore::FontFace::family):
(WebCore::FontFace::style):
(WebCore::FontFace::weight):
(WebCore::FontFace::stretch):
(WebCore::FontFace::unicodeRange):
(WebCore::FontFace::variant):
(WebCore::FontFace::featureSettings):
* css/FontFace.h: Added. Ditto.
(WebCore::FontFace::create):
* css/FontVariantBuilder.cpp: Added. Moved code here from FontVariantBuilder.h.
Refactored to support a new client (CSSFontFace).
(WebCore::extractFontVariantLigatures):
(WebCore::extractFontVariantNumeric):
(WebCore::extractFontVariantEastAsian):
(WebCore::computeFontVariant):
* css/FontVariantBuilder.h: Moved code from here into FontVariantBuilder.cpp.
(WebCore::applyValueFontVariantLigatures): Deleted.
(WebCore::applyValueFontVariantNumeric): Deleted.
(WebCore::applyValueFontVariantEastAsian): Deleted.
* css/StyleBuilderCustom.h: Update for new FontVariantBuilder API.
(WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
(WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
(WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
* platform/text/TextFlags.h: Provide convenience classes.
(WebCore::FontVariantLigaturesValues::FontVariantLigaturesValues):
(WebCore::FontVariantNumericValues::FontVariantNumericValues):
(WebCore::FontVariantEastAsianValues::FontVariantEastAsianValues):

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

3 years agoBuild fix after r196506; publish MediaResourceLoader.h as a private header so it...
jer.noble@apple.com [Fri, 12 Feb 2016 22:17:30 +0000 (22:17 +0000)]
Build fix after r196506; publish MediaResourceLoader.h as a private header so it can be used by
TestWebKitAPI.

* WebCore.xcodeproj/project.pbxproj:

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

3 years agoWeb Inspector: Tabs: Conflicts with multiple Formatters per SourceCode
commit-queue@webkit.org [Fri, 12 Feb 2016 22:15:14 +0000 (22:15 +0000)]
Web Inspector: Tabs: Conflicts with multiple Formatters per SourceCode
https://bugs.webkit.org/show_bug.cgi?id=144717
<rdar://problem/20845163>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-02-12
Reviewed by Timothy Hatcher.

The underlying issue here is that each tab may create its own ContentView,
and therefore SourceCodeTextEditor, per-SourceCode. Each SourceCodeTextEditor
was mutating the SourceCode's state without listening for or expecting
updates from the other. This causes a bunch of different issues:

    - editing in one tab does not get reflected in another tab for
      the same resource. This is common when using the Search tab
      to find and make an edit, then debug in another tab.

    - one tab may auto format (pretty print) a resource and set
      the formatter on the SourceCode to make SourceCodeLocations
      know about formatted locations. However, a jump to location
      that opens a new ContentView for the same Resource will
      start out un-formatted, and misunderstand the location.
      This often results in an unexpected jump to 0:0.

The solution taken by this change is to have a single ContentView
per represented object. When that ContentView gets shown in a new
ContentViewContainer it gets transferred, leaving a tombstone in the
previous ContentViewContainer that can be revived later. This keeps
back foward lists with expected values. It also means there is a
single ContentView that doesn't need to worry about having the
state of its represented object getting overrun.

Currently this makes the assumption that we won't ever show multiple
ContentViews for the same represented object at the same time. This
may need to change if we were to support split pane editor or
something like that.

This also makes the assumption that ContentViewContainer's showEntry
and hideEntry do not modify the back forward list. That has not been
the case, and I think it is safe to assume it will never be the case.

The contracts this patch maintains:

    - a ContentView is always owned by one ViewContainer.
      This ViewContainer is the one showing the ContentView.

    - when another ViewContainer wants to share the ContentView
      ownership is transferred. Creating tombstones in the old
      ViewContainer and Reviving tombstones in the new ViewContainer.

    - ViewContainer's have a tombstone per-BackForwardEntry that
      references the ContentView.

    - In order to ensure a ContentView always gets closed, when
      the owning ViewContainer would close the ContentView it
      checks if it should instead transfer ownership of the
      ContentView to another interested ViewContainer.

This also maintains the contract that a ContentView should only be
closed once. When the ContentView is transferred between two
ContentViewContainers it should hide/show from the old to the new.
The last ContentViewContainer to reference a ContentView should
be the one to close the ContentView.

* UserInterface/Models/BackForwardEntry.js:
(WebInspector.BackForwardEntry):
(WebInspector.BackForwardEntry.prototype.get tombstone):
(WebInspector.BackForwardEntry.prototype.set tombstone):
(WebInspector.BackForwardEntry.prototype.prepareToShow):
(WebInspector.BackForwardEntry.prototype.prepareToHide):
Tombstone state and assertions that we don't show/hide tombstones,
that should all be done before a back forward entry has become a tombstone.

* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.contentViewForRepresentedObject):
(WebInspector.ContentView.closedContentViewForRepresentedObject):
(WebInspector.ContentView.resolvedRepresentedObjectForRepresentedObject):
Helpers for getting / creating / clearing the single ContentView that
is associated with a represented object.

* UserInterface/Views/ContentViewContainer.js:
(WebInspector.ContentViewContainer.prototype.contentViewForRepresentedObject):
(WebInspector.ContentViewContainer.prototype.showContentView):
Eliminate code that dealt with multiple content views per represented object.
That is replaced by multiple ContentViewContainers per ContentView.

(WebInspector.ContentViewContainer.prototype.replaceContentView):
This is called in special places where we don't need to worry about a tombstone.
It is an in replace of a content view.

(WebInspector.ContentViewContainer.closeAllContentViewsOfPrototype):
(WebInspector.ContentViewContainer.prototype.closeContentView):
(WebInspector.ContentViewContainer.prototype.closeAllContentViews):
(WebInspector.ContentViewContainer.prototype._disassociateFromContentView):
Deal with closing BackForwardEntrys that are tombstones.

(WebInspector.ContentViewContainer.prototype._takeOwnershipOfContentView):
(WebInspector.ContentViewContainer.prototype._placeTombstonesForContentView):
(WebInspector.ContentViewContainer.prototype._clearTombstonesForContentView):
Helpers for transfering ownership of a ContentView to a ContentViewContainer.
There is always one owner of the ContentView. Non-owners have tombstone
BackForward entries.

(WebInspector.ContentViewContainer.prototype._showEntry):
If we are showing a tombstone, gain ownership.

(WebInspector.ContentViewContainer.prototype._hideEntry):
This may happen in closing, for simplicity we bail here instead of include
messy logic at the call site. We would have already hidden this entry
when making it a tombstone.

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

3 years agoFix ASan build.
andersca@apple.com [Fri, 12 Feb 2016 22:13:56 +0000 (22:13 +0000)]
Fix ASan build.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::copyASanDynamicLibraryPath): Deleted.

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

3 years ago[Mac] Adopt MediaResourceLoader (instead of CachedResourceLoader) in WebCoreNSURLSession.
jer.noble@apple.com [Fri, 12 Feb 2016 22:13:31 +0000 (22:13 +0000)]
[Mac] Adopt MediaResourceLoader (instead of CachedResourceLoader) in WebCoreNSURLSession.
https://bugs.webkit.org/show_bug.cgi?id=154136

Reviewed by Alex Christensen.

Source/WebCore:

MediaResourceLoader already supports using CORS attribute to verify CORS access requirements
when loading media resources, so use it, rather than CachedResourceLoader, as the backing for
WebCoreNSURLSession.

* platform/network/cocoa/WebCoreNSURLSession.h:
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSession delegateQueue]):
(-[WebCoreNSURLSession streamTaskWithNetService:]):
(-[WebCoreNSURLSession isKindOfClass:]):
(-[WebCoreNSURLSessionDataTask initWithSession:identifier:request:]):
(-[WebCoreNSURLSessionDataTask _restart]):
(-[WebCoreNSURLSessionDataTask _cancel]):
(-[WebCoreNSURLSessionDataTask resume]):
(-[WebCoreNSURLSessionDataTask _timingData]):
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
(-[WebCoreNSURLSessionDataTask resource:receivedData:length:]):
(-[WebCoreNSURLSession initWithResourceLoader:delegate:delegateQueue:]): Deleted.
(-[WebCoreNSURLSession loader]): Deleted.
(WebCore::WebCoreNSURLSessionDataTaskClient::dataSent): Deleted.
(WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived): Deleted.
(WebCore::WebCoreNSURLSessionDataTaskClient::dataReceived): Deleted.
(WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived): Deleted.
(WebCore::WebCoreNSURLSessionDataTaskClient::notifyFinished): Deleted.
(-[WebCoreNSURLSessionDataTask initWithSession:identifier:URL:]): Deleted.
(-[WebCoreNSURLSessionDataTask _finish]): Deleted.
(-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
(-[WebCoreNSURLSessionDataTask resource:sentBytes:totalBytesToBeSent:]): Deleted.
(-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:]): Deleted.
(-[WebCoreNSURLSessionDataTask resourceFinished:]): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):

Tools:

Use a MediaResourceLoader instead of a CachedResourceLoader for WebCoreNSURLSession.

Drive-by fix: generate USE and ENABLE macros for TestWebKitAPI by adding FEATURE_DEFINES
to GCC_PREPROCESSOR_DEFINES.

* TestWebKitAPI/Configurations/Base.xcconfig:
* TestWebKitAPI/Tests/WebCore/WebCoreNSURLSession.mm:
(TestWebKitAPI::WebCoreNSURLSessionTest::SetUp):
(TestWebKitAPI::WebCoreNSURLSessionTest::TearDown):
(TestWebKitAPI::TEST_F):

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

3 years agoRemove NPAPI for showing preference panes
andersca@apple.com [Fri, 12 Feb 2016 22:04:08 +0000 (22:04 +0000)]
Remove NPAPI for showing preference panes
https://bugs.webkit.org/show_bug.cgi?id=154193

Reviewed by Dan Bernstein.

No plug-ins ended up adopting this API, so there's no point in keeping it around.

* PluginProcess/PluginControllerProxy.h:
* PluginProcess/mac/PluginControllerProxyMac.mm:
(WebKit::PluginControllerProxy::openPluginPreferencePane): Deleted.
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::getPluginInfo): Deleted.
* Shared/Plugins/PluginModuleInfo.h:
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Plugins/PluginProcessProxy.messages.in:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::openPluginPreferencePane): Deleted.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
(WebKit::NPN_GetValue): Deleted.
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::openPluginPreferencePane): Deleted.
(WebKit::NetscapePlugin::plugInContainer): Deleted.
(WebKit::NetscapePlugin::platformDestroy): Deleted.
* WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainer.h: Removed.
* WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainer.mm: Removed.
(-[WKNPAPIPlugInContainer dealloc]): Deleted.
(-[WKNPAPIPlugInContainer _invalidate]): Deleted.
(-[WKNPAPIPlugInContainer openPlugInPreferencePane]): Deleted.
* WebProcess/Plugins/Netscape/mac/WKNPAPIPlugInContainerInternal.h: Removed.
* WebProcess/Plugins/PluginController.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::openPluginPreferencePane): Deleted.
* WebProcess/Plugins/PluginView.h:

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

3 years agoFix non-internal builds when using NetworkSession
achristensen@apple.com [Fri, 12 Feb 2016 21:52:17 +0000 (21:52 +0000)]
Fix non-internal builds when using NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=152285

* platform/spi/cf/CFNetworkSPI.h:
Add SPI declaration used in r194156.

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

3 years agoFix internal Windows WebKit debug build.
achristensen@apple.com [Fri, 12 Feb 2016 21:43:57 +0000 (21:43 +0000)]
Fix internal Windows WebKit debug build.
rdar://problem/24635219

* PlatformWin.cmake:
We were making WebKit.dll instead of WebKit_debug.dll.

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

3 years agoRemove PowerPC cruft
andersca@apple.com [Fri, 12 Feb 2016 21:39:56 +0000 (21:39 +0000)]
Remove PowerPC cruft
https://bugs.webkit.org/show_bug.cgi?id=154191

Reviewed by Dan Bernstein.

* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::getPluginArchitecture): Deleted.

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

3 years agoRemove more unneeded process launching code
andersca@apple.com [Fri, 12 Feb 2016 21:25:56 +0000 (21:25 +0000)]
Remove more unneeded process launching code
https://bugs.webkit.org/show_bug.cgi?id=154190

Reviewed by Tim Horton.

* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::getLaunchOptions): Deleted.
* UIProcess/Databases/mac/DatabaseProcessProxyMac.mm: Removed.
(WebKit::DatabaseProcessProxy::platformGetLaunchOptions): Deleted.
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions): Deleted.
* UIProcess/Network/mac/NetworkProcessProxyMac.mm:
(WebKit::NetworkProcessProxy::platformGetLaunchOptions): Deleted.
* UIProcess/Plugins/PluginProcessProxy.h:
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::pluginNeedsExecutableHeap): Deleted.
(WebKit::PluginProcessProxy::platformGetLaunchOptions): Deleted.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions): Deleted.
* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::platformGetLaunchOptions): Deleted.
* WebKit2.xcodeproj/project.pbxproj:

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

3 years agoUse different process types for 32-bit and 64-bit plug-ins
andersca@apple.com [Fri, 12 Feb 2016 21:11:28 +0000 (21:11 +0000)]
Use different process types for 32-bit and 64-bit plug-ins
https://bugs.webkit.org/show_bug.cgi?id=154186

Reviewed by Tim Horton.

* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::getLaunchOptions):
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
(WebKit::shouldLeakBoost):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/Plugins/PluginProcessProxy.cpp:
(WebKit::PluginProcessProxy::getLaunchOptions): Deleted.
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformGetLaunchOptions):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::getLaunchOptions):

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

3 years ago[ES6] Implement @@search
utatane.tea@gmail.com [Fri, 12 Feb 2016 20:46:30 +0000 (20:46 +0000)]
[ES6] Implement @@search
https://bugs.webkit.org/show_bug.cgi?id=143889

Reviewed by Darin Adler.

Source/JavaScriptCore:

Implement RegExp.prototype[@@search].
In ES6, String.prototype.search delegates the actual matching to it
instead of executing RegExp matching inside String.prototype.search method itself.
By customizing @@search method, we can change the behavior of String.prototype.search for
derived / customized RegExp object.

* CMakeLists.txt:
* DerivedSources.make:
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::BuiltinNames): Deleted.
* builtins/BuiltinUtils.h:
* builtins/StringPrototype.js:
(search):
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* bytecode/BytecodeIntrinsicRegistry.h:
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
(JSC::regExpProtoFuncSearch):
* runtime/RegExpPrototype.h:
(JSC::RegExpPrototype::create):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::getOwnPropertySlot):
(JSC::StringPrototype::finishCreation): Deleted.
(JSC::stringProtoFuncSearch): Deleted.
* runtime/StringPrototype.h:
* tests/es6.yaml:
* tests/stress/regexp-search.js: Added.
(shouldBe):
(shouldThrow):
(errorKey.toString):
(primitive.of.primitives.shouldThrow):
(testRegExpSearch):
(testSearch):
(testBoth):
(alwaysUnmatch):

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/dom/string-prototype-properties-expected.txt:
* js/regress/script-tests/v8-regexp-search.js: Added.
(runRegExpBenchmark.runBlock0):
(runRegExpBenchmark.runBlock1):
(runRegExpBenchmark):
(runRegExpBenchmark.runBlock3):
(runRegExpBenchmark.runBlock4):
* js/regress/v8-regexp-search-expected.txt: Added.
* js/regress/v8-regexp-search.html: Added.
* js/script-tests/Object-getOwnPropertyNames.js:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.12_String.prototype.search/S15.5.4.12_A1_T3-expected.txt:

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

3 years agoAdaptiveInferredPropertyValueWatchpoint can trigger a GC that frees its CodeBlock...
keith_miller@apple.com [Fri, 12 Feb 2016 20:44:44 +0000 (20:44 +0000)]
AdaptiveInferredPropertyValueWatchpoint can trigger a GC that frees its CodeBlock and thus itself
https://bugs.webkit.org/show_bug.cgi?id=154146

Reviewed by Filip Pizlo.

Consider the following: there is some CodeBlock, C, that is watching some object, O, with a
structure, S, for replacements. Also, suppose that C has no references anymore and is due to
be GCed. Now, when some new property is added to O, S will create a new structure S' and
fire its transition watchpoints. Since C is watching S for replacements it will attempt to
have its AdaptiveInferredPropertyValueWatchpoint relocate itself to S'. To do so, it needs
it allocate RareData on S'. This allocation may cause a GC, which frees C while still
executing its watchpoint handler. The solution to this is to defer GC while running
AdaptiveInferredPropertyValueWatchpointBase handlers.

* bytecode/AdaptiveInferredPropertyValueWatchpointBase.cpp:
(JSC::AdaptiveInferredPropertyValueWatchpointBase::fire):

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

3 years agoRe-name isClickableElement in InteractionInformationAtPosition to isElement
bdakin@apple.com [Fri, 12 Feb 2016 20:31:35 +0000 (20:31 +0000)]
Re-name isClickableElement in InteractionInformationAtPosition to isElement
https://bugs.webkit.org/show_bug.cgi?id=154179

Reviewed by Enrica Casucci.

The bool is set for all elements, so it’s just confusing to call it a
clickableElement instead of just element.
* Shared/ios/InteractionInformationAtPosition.h:
* Shared/ios/InteractionInformationAtPosition.mm:
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView _highlightLongPressRecognized:]):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

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

3 years agoThrow out all live resource decoded data on memory pressure / suspension.
akling@apple.com [Fri, 12 Feb 2016 20:22:54 +0000 (20:22 +0000)]
Throw out all live resource decoded data on memory pressure / suspension.
<https://webkit.org/b/154176>

Reviewed by Antti Koivisto.

When pruning live resource decoded data from the memory cache,
we normally avoid pruning anything that's been painted in the last second.
This is an optimization to avoid getting into image decoding loops.

For memory pressure / process suspension scenarios this doesn't really
make sense though:

    - In the pressure case, if we have to render again soon it'll likely
      be a new GIF frame which we have to decode anyway.

    - In the process suspension case, we might *never* render again,
      so we should be good citizens and drop all the decoded data we can.

This patch makes us drop all the decoded data, recently painted or not.

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseCriticalMemory):

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

3 years agoSeparate out !allowsAccess path in JSDOMWindowCustom getOwnPropertySlot
barraclough@apple.com [Fri, 12 Feb 2016 20:20:41 +0000 (20:20 +0000)]
Separate out !allowsAccess path in JSDOMWindowCustom getOwnPropertySlot
https://bugs.webkit.org/show_bug.cgi?id=154156

Reviewed by Chris Dumez.

Source/JavaScriptCore:

* runtime/CommonIdentifiers.h:
    - added new property names, needed by jsDOMWindowGetOwnPropertySlotDisallowAccess.

Source/WebCore:

JSDOMWindowCustom getOwnPropertySlot currently allows cross-origin access to all
static properties, relying on the property to perform the access check. This is
a little insecure, since it is error prone - someone could easily add a property
to the static table without realizing it would be automatcially exposed.

Instead, add a hard-coded filter to restrict access. As a future implementation
we might consider autogenerating this (the properties are already tagged in IDL,
we might be able to track this in a flag on the static table).

By separating out the handling of the same- and cross-origin access we can
simplify & make the policy being enforced much clearer.

* bindings/js/JSDOMBinding.cpp:
(WebCore::objectToStringFunctionGetter): Deleted.
    - removed objectToStringFunctionGetter - this duplicated functionality of
      nonCachingStaticFunctionGetter.
* bindings/js/JSDOMBinding.h:
(WebCore::objectToStringFunctionGetter): Deleted.
    - removed objectToStringFunctionGetter - this duplicated functionality of
      nonCachingStaticFunctionGetter.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotDisallowAccess):
    - explicitly handle providing access to only the things we do want to allow cross-origin.
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
    - push all !allowsAccess handling to jsDOMWindowGetOwnPropertySlotDisallowAccess
(WebCore::childFrameGetter): Deleted.
    - this was just a deoptimiztion - moving access into a callback saved very
      little & caused more work to be duplicated.

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

3 years agoRemove more unused process launcher code
andersca@apple.com [Fri, 12 Feb 2016 20:17:03 +0000 (20:17 +0000)]
Remove more unused process launcher code
https://bugs.webkit.org/show_bug.cgi?id=154181

Reviewed by Tim Horton.

* UIProcess/Launcher/ProcessLauncher.cpp:
(WebKit::ProcessLauncher::processTypeAsString): Deleted.
(WebKit::ProcessLauncher::getProcessTypeFromString): Deleted.
* UIProcess/Launcher/ProcessLauncher.h:

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

3 years agoUpdate ICU header files to version 52
sukolsak@gmail.com [Fri, 12 Feb 2016 20:15:30 +0000 (20:15 +0000)]
Update ICU header files to version 52
https://bugs.webkit.org/show_bug.cgi?id=154160

Reviewed by Alex Christensen.

Update ICU header files to version 52 to allow the use of newer APIs.

Source/JavaScriptCore:

* icu/unicode/localpointer.h:
* icu/unicode/platform.h:
* icu/unicode/ptypes.h:
* icu/unicode/putil.h:
* icu/unicode/ucal.h:
* icu/unicode/uchar.h:
* icu/unicode/ucnv.h:
* icu/unicode/ucol.h:
* icu/unicode/uconfig.h:
* icu/unicode/udat.h:
* icu/unicode/udatpg.h:
* icu/unicode/udisplaycontext.h: Added.
* icu/unicode/uenum.h:
* icu/unicode/uformattable.h: Added.
* icu/unicode/uiter.h:
* icu/unicode/uloc.h:
* icu/unicode/umachine.h:
* icu/unicode/unorm2.h:
* icu/unicode/unum.h:
* icu/unicode/urename.h:
* icu/unicode/uscript.h:
* icu/unicode/uset.h:
* icu/unicode/ustring.h:
* icu/unicode/utf.h:
* icu/unicode/utf16.h:
* icu/unicode/utf8.h:
* icu/unicode/utf_old.h:
* icu/unicode/utypes.h:
* icu/unicode/uvernum.h:
* icu/unicode/uversion.h:

Source/WebCore:

No new tests because there is no behavior change.

* icu/unicode/bytestream.h:
* icu/unicode/chariter.h:
* icu/unicode/localpointer.h:
* icu/unicode/platform.h:
* icu/unicode/ptypes.h:
* icu/unicode/putil.h:
* icu/unicode/rep.h:
(Replaceable::Replaceable):
* icu/unicode/std_string.h:
* icu/unicode/strenum.h:
* icu/unicode/stringpiece.h:
* icu/unicode/ubrk.h:
* icu/unicode/uchar.h:
* icu/unicode/ucnv.h:
* icu/unicode/ucol.h:
* icu/unicode/ucoleitr.h:
* icu/unicode/uconfig.h:
* icu/unicode/ucsdet.h:
* icu/unicode/uenum.h:
* icu/unicode/uidna.h:
* icu/unicode/uiter.h:
* icu/unicode/uloc.h:
* icu/unicode/umachine.h:
* icu/unicode/unistr.h:
(UnicodeString::UnicodeString):
(UnicodeString::operator== ):
(UnicodeString::startsWith):
(UnicodeString::setTo):
(UnicodeString::remove):
(UnicodeString::replace): Deleted.
(UnicodeString::extract): Deleted.
(UnicodeString::char32At): Deleted.
(UnicodeString::getChar32Start): Deleted.
(UnicodeString::getChar32Limit): Deleted.
(UnicodeString::getTerminatedBuffer): Deleted.
(UnicodeString::append): Deleted.
(UnicodeString::truncate): Deleted.
* icu/unicode/unorm2.h:
* icu/unicode/uobject.h:
* icu/unicode/urename.h:
* icu/unicode/uscript.h:
* icu/unicode/usearch.h:
* icu/unicode/uset.h:
* icu/unicode/ushape.h:
* icu/unicode/ustring.h:
* icu/unicode/utext.h:
* icu/unicode/utf.h:
* icu/unicode/utf16.h:
* icu/unicode/utf8.h:
* icu/unicode/utf_old.h:
* icu/unicode/utypes.h:
* icu/unicode/uvernum.h:
* icu/unicode/uversion.h:

Source/WebKit/mac:

* icu/unicode/localpointer.h:
* icu/unicode/platform.h:
* icu/unicode/ptypes.h:
* icu/unicode/putil.h:
* icu/unicode/uchar.h:
* icu/unicode/uconfig.h:
* icu/unicode/uidna.h:
* icu/unicode/uiter.h:
* icu/unicode/umachine.h:
* icu/unicode/unorm2.h:
* icu/unicode/urename.h:
* icu/unicode/uscript.h:
* icu/unicode/ustring.h:
* icu/unicode/utf.h:
* icu/unicode/utf16.h:
* icu/unicode/utf8.h:
* icu/unicode/utf_old.h:
* icu/unicode/utypes.h:
* icu/unicode/uvernum.h:
* icu/unicode/uversion.h:

Source/WTF:

* icu/unicode/bytestream.h:
* icu/unicode/localpointer.h:
* icu/unicode/platform.h:
* icu/unicode/ptypes.h:
* icu/unicode/putil.h:
* icu/unicode/rep.h:
(Replaceable::Replaceable):
* icu/unicode/std_string.h:
* icu/unicode/strenum.h:
* icu/unicode/stringpiece.h:
* icu/unicode/uchar.h:
* icu/unicode/ucnv.h:
* icu/unicode/ucol.h:
* icu/unicode/uconfig.h:
* icu/unicode/uenum.h:
* icu/unicode/uiter.h:
* icu/unicode/uloc.h:
* icu/unicode/umachine.h:
* icu/unicode/unistr.h:
(UnicodeString::UnicodeString):
(UnicodeString::operator== ):
(UnicodeString::startsWith):
(UnicodeString::setTo):
(UnicodeString::remove):
(UnicodeString::replace): Deleted.
(UnicodeString::extract): Deleted.
(UnicodeString::char32At): Deleted.
(UnicodeString::getChar32Start): Deleted.
(UnicodeString::getChar32Limit): Deleted.
(UnicodeString::getTerminatedBuffer): Deleted.
(UnicodeString::append): Deleted.
(UnicodeString::truncate): Deleted.
* icu/unicode/unorm2.h:
* icu/unicode/uobject.h:
* icu/unicode/urename.h:
* icu/unicode/uscript.h:
* icu/unicode/uset.h:
* icu/unicode/ustring.h:
* icu/unicode/utf.h:
* icu/unicode/utf16.h:
* icu/unicode/utf8.h:
* icu/unicode/utf_old.h:
* icu/unicode/utypes.h:
* icu/unicode/uvernum.h:
* icu/unicode/uversion.h:

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

3 years agoRemove more unused process launching code
andersca@apple.com [Fri, 12 Feb 2016 19:58:33 +0000 (19:58 +0000)]
Remove more unused process launching code
https://bugs.webkit.org/show_bug.cgi?id=154178

Reviewed by Tim Horton.

* UIProcess/Databases/mac/DatabaseProcessProxyMac.mm:
(WebKit::shouldUseXPC): Deleted.
(WebKit::DatabaseProcessProxy::platformGetLaunchOptions): Deleted.
* UIProcess/Launcher/ProcessLauncher.h:
* UIProcess/Launcher/mac/EnvironmentVariables.cpp:
(WebKit::EnvironmentVariables::preexistingProcessServiceNameKey): Deleted.
(WebKit::EnvironmentVariables::preexistingProcessTypeKey): Deleted.
* UIProcess/Launcher/mac/EnvironmentVariables.h:
* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::ProcessLauncher::launchProcess):
(WebKit::setUpTerminationNotificationHandler): Deleted.
(WebKit::addDYLDEnvironmentAdditions): Deleted.
(WebKit::tryPreexistingProcess): Deleted.
(WebKit::createProcess): Deleted.
* UIProcess/Network/mac/NetworkProcessProxyMac.mm:
(WebKit::shouldUseXPC): Deleted.
(WebKit::NetworkProcessProxy::platformGetLaunchOptions): Deleted.
* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::platformGetLaunchOptions): Deleted.
* UIProcess/ios/WebProcessProxyIOS.mm:
(WebKit::WebProcessProxy::platformGetLaunchOptions): Deleted.
* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::shouldUseXPC): Deleted.
(WebKit::WebProcessProxy::platformGetLaunchOptions): Deleted.

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

3 years agoFast path in JSObject::defineOwnIndexedProperty() forgets to check for the posibility...
fpizlo@apple.com [Fri, 12 Feb 2016 19:50:49 +0000 (19:50 +0000)]
Fast path in JSObject::defineOwnIndexedProperty() forgets to check for the posibility of a descriptor that doesn't have a value
https://bugs.webkit.org/show_bug.cgi?id=154175
rdar://problem/24291497

Reviewed by Geoffrey Garen.

* runtime/JSObject.cpp:
(JSC::JSObject::defineOwnIndexedProperty): Fix the bug.
* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::putEntry): Catch the bug sooner in debug.
(JSC::SparseArrayValueMap::putDirect):
* tests/stress/sparse-define-empty-descriptor.js: Added. This used to crash in release.

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

3 years agoNSRangeIsRelativeTo should not have NS prefix
bdakin@apple.com [Fri, 12 Feb 2016 19:43:10 +0000 (19:43 +0000)]
NSRangeIsRelativeTo should not have NS prefix
https://bugs.webkit.org/show_bug.cgi?id=154174

Reviewed by Tim Horton.

NSRangeIsRelativeTo -> WebRangeIsRelativeTo
* WebView/WebFrame.mm:
(-[WebFrame _convertToDOMRange:]):
(-[WebFrame _convertToDOMRange:rangeIsRelativeTo:]):
* WebView/WebFrameInternal.h:
* WebView/WebHTMLView.mm:
(-[WebHTMLView insertText:]):

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

3 years agoAdd a WebKit SPI for creating an automation session and advertise the active session...
bburg@apple.com [Fri, 12 Feb 2016 19:28:29 +0000 (19:28 +0000)]
Add a WebKit SPI for creating an automation session and advertise the active session via RemoteInspector
https://bugs.webkit.org/show_bug.cgi?id=153934

Reviewed by Dan Bernstein and Joseph Pecoraro.

An automation session is the main place where WebKit support for user agent automation is implemented.
A session encapsulates the state (default timeouts, page identifier mappings), objects (active automation
WebPages) and logic (how to open a window, run JS, send user input, etc.) used to implement automation
commands.

A process pool can only have one session at a time. The session is created by the WebKit client in
response to a request that comes through _WKAutomationDelegate. When a session is set on the process pool,
it is advertised to remote drivers and debuggers as a RemoteControllableTarget. A remote driver can use
the existing RemoteInspector API to connect to the session and send it automation commands.

The session has a delegate so that WebKit clients can perform actions that are outside the scope of WebKit,
such as creating new tabs, enumerating windows, or sending native user inputs.

This patch adds AutomationSession classes at the API and implementation level in WebKit2. The
implementation class contains RemoteInspector support, which cannot be used directly by WebKit clients.
AutomationSessionDelegate classes exist at both the API and implementation level to bridge between
Objective-C delegates and C++ clients. All code related to RemoteInspector and RemoteAutomationTarget
must be guarded by ENABLE(REMOTE_INSPECTOR).

* Shared/API/APIObject.h: Add new API type 'AutomationSession'.
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject): Allocate in the wrapper.
* UIProcess/API/APIAutomationSessionClient.h: Added.
(API::AutomationSessionClient::~AutomationSessionClient):
(API::AutomationSessionClient::didRequestNewWindow): Delegate window creation to the client.
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setAutomationSession:]): Keep at most one WebAutomationSession at a time.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/API/Cocoa/_WKAutomationSession.h: Added.
* UIProcess/API/Cocoa/_WKAutomationSession.mm: Added.
(-[_WKAutomationSession init]): Construct the API object in the implementation wrapper.
(-[_WKAutomationSession dealloc]): Clear the client before calling the implementation destructor.

(-[_WKAutomationSession sessionIdentifier]):
(-[_WKAutomationSession setSessionIdentifier:]):
Store the session identifier string in the implementation.

(-[_WKAutomationSession delegate]):
(-[_WKAutomationSession setDelegate:]):
Create an Objective-C adapter for the delegate if not nil and set it as the implementation's client.

(-[_WKAutomationSession _apiObject]):
* UIProcess/API/Cocoa/_WKAutomationSessionDelegate.h: Added.
* UIProcess/API/Cocoa/_WKAutomationSessionInternal.h: Added.
(wrapper):
* UIProcess/Cocoa/AutomationSessionClient.h: Added.
Set up the boilerplate for caching delegate method availability. It will include more methods later.

* UIProcess/Cocoa/AutomationSessionClient.mm: Added. Forward requests to the SPI delegate.
(WebKit::AutomationSessionClient::AutomationSessionClient):
(WebKit::AutomationSessionClient::didRequestNewWindow): Delegate window creation to the client.

* UIProcess/WebAutomationSession.cpp: Added.
(WebKit::WebAutomationSession::WebAutomationSession):
By default, a session should be available and not paired to any particular remote driver.

(WebKit::WebAutomationSession::~WebAutomationSession): Require callers to clear the client first.
(WebKit::WebAutomationSession::setClient):
(WebKit::WebAutomationSession::dispatchMessageFromRemote): Stub this out for now.

(WebKit::WebAutomationSession::connect):
(WebKit::WebAutomationSession::disconnect):
To prevent multiple connection attempts, mark the target as paired when a remote client has connected.

* UIProcess/WebAutomationSession.h: Added.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setAutomationSession):
Store the session object and tell it to register itself. Unregistering happens automatically
in RemoteControllableTarget::~RemoteControllableTarget.

* UIProcess/WebProcessPool.h:
* WebKit2.xcodeproj/project.pbxproj: Add files and headers.

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

3 years ago[Mac] BitmapImage::decodedDataIsPurgeable() is telling lies and causing massive memor...
akling@apple.com [Fri, 12 Feb 2016 18:34:57 +0000 (18:34 +0000)]
[Mac] BitmapImage::decodedDataIsPurgeable() is telling lies and causing massive memory usage.
<https://webkit.org/b/154172>

Reviewed by Antti Koivisto.

The underlying mechanism in CoreAnimation that made this work is no longer in place.

Instead of keeping purgeable frames and juggling volatility bits, we were simply caching
every single frame of large GIF animations, sometimes leading to monstrous memory usage.

Remove the code from WebCore since it's not doing at all what it means to.

Now iOS and Mac will behave the same again, and frame caching decisions will be
made by WebKit, based on total pixel byte size.

* loader/cache/CachedImage.h:
* loader/cache/CachedResource.h:
(WebCore::CachedResource::decodedDataIsPurgeable): Deleted.
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize): Deleted.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::decodedDataIsPurgeable): Deleted.
(WebCore::BitmapImage::destroyDecodedDataIfNecessary): Deleted.
* platform/graphics/BitmapImage.h:
* platform/graphics/Image.h:
(WebCore::Image::decodedDataIsPurgeable): Deleted.
* platform/graphics/cg/BitmapImageCG.cpp:
(WebCore::BitmapImage::decodedDataIsPurgeable): Deleted.
* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageSource::createFrameAtIndex): Deleted.

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

3 years agoModern IDB: Ref cycle between IDBObjectStore and IDBIndex.
beidson@apple.com [Fri, 12 Feb 2016 18:30:43 +0000 (18:30 +0000)]
Modern IDB: Ref cycle between IDBObjectStore and IDBIndex.
https://bugs.webkit.org/show_bug.cgi?id=154110

Reviewed by Darin Adler.

No new tests (Currently untestable).

The lifetime of IDBObjectStore and IDBIndex are closely intertwined, but we have to break the ref cycle.

This patch does a few semi-gnarly things:
1 - Makes both IDBIndex and IDBObjectStore have a custom marking function so they can add each other as
    opaque roots.
2 - Adds a lock to protect IDBObjectStore's collection of referenced indexes to support #1, as GC marking
    can happen on any thread.
3 - Makes IDBIndex not be traditionally RefCounted; Instead, IDBIndex::ref()/deref() simply ref()/deref()
    the owning IDBObjectStore.
4 - ...Except when somebody deletes an IDBIndex from its IDBObjectStore. Once that happens, the object
    store no longer has a reference back to the index, but the index still needs a reference back to the
    object store. To support this, the IDBIndex becomes "traditionally RefCounted" while holding a ref to
    its IDBObjectStore.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:

* Modules/indexeddb/IDBIndex.h:
(WebCore::IDBIndex::isModern):
* Modules/indexeddb/IDBIndex.idl:

* Modules/indexeddb/IDBObjectStore.h:
(WebCore::IDBObjectStore::isModern):
* Modules/indexeddb/IDBObjectStore.idl:

* Modules/indexeddb/client/IDBIndexImpl.cpp:
(WebCore::IDBClient::IDBIndex::objectStore):
(WebCore::IDBClient::IDBIndex::openCursor):
(WebCore::IDBClient::IDBIndex::doCount):
(WebCore::IDBClient::IDBIndex::openKeyCursor):
(WebCore::IDBClient::IDBIndex::doGet):
(WebCore::IDBClient::IDBIndex::doGetKey):
(WebCore::IDBClient::IDBIndex::markAsDeleted):
(WebCore::IDBClient::IDBIndex::ref):
(WebCore::IDBClient::IDBIndex::deref):
(WebCore::IDBClient::IDBIndex::create): Deleted.
* Modules/indexeddb/client/IDBIndexImpl.h:
(WebCore::IDBClient::IDBIndex::modernObjectStore):

* Modules/indexeddb/client/IDBObjectStoreImpl.cpp:
(WebCore::IDBClient::IDBObjectStore::createIndex):
(WebCore::IDBClient::IDBObjectStore::index):
(WebCore::IDBClient::IDBObjectStore::deleteIndex):
(WebCore::IDBClient::IDBObjectStore::visitReferencedIndexes):
* Modules/indexeddb/client/IDBObjectStoreImpl.h:

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::createIndex):
* Modules/indexeddb/client/IDBTransactionImpl.h:

* Modules/indexeddb/legacy/LegacyIndex.cpp:
(WebCore::LegacyIndex::ref):
(WebCore::LegacyIndex::deref):
* Modules/indexeddb/legacy/LegacyIndex.h:

* bindings/js/JSIDBIndexCustom.cpp: Added.
(WebCore::JSIDBIndex::visitAdditionalChildren):

* bindings/js/JSIDBObjectStoreCustom.cpp:
(WebCore::JSIDBObjectStore::visitAdditionalChildren):

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

3 years ago[EFL][GTK] Fix ENABLE(SVG_OTF_CONVERTER) build
ossy@webkit.org [Fri, 12 Feb 2016 17:33:00 +0000 (17:33 +0000)]
[EFL][GTK] Fix ENABLE(SVG_OTF_CONVERTER) build
https://bugs.webkit.org/show_bug.cgi?id=154165

Reviewed by Alex Christensen.

.:

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

* CMakeLists.txt:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
* svg/SVGToOTFFontConversion.cpp:
* svg/SVGToOTFFontConversion.h:

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

3 years agoGet rid of NetscapePluginModule::createPluginMIMETypesPreferences
andersca@apple.com [Fri, 12 Feb 2016 17:24:13 +0000 (17:24 +0000)]
Get rid of NetscapePluginModule::createPluginMIMETypesPreferences
https://bugs.webkit.org/show_bug.cgi?id=154173

Reviewed by Dan Bernstein.

* Shared/Plugins/Netscape/NetscapePluginModule.h:
* Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
(WebKit::NetscapePluginModule::createPluginMIMETypesPreferences): Deleted.

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

3 years agoRebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html for ios-simulator...
ryanhaddad@apple.com [Fri, 12 Feb 2016 17:23:33 +0000 (17:23 +0000)]
Rebaseline imported/w3c/web-platform-tests/html/dom/interfaces.html for ios-simulator after r196466

Unreviewed test gardening.

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

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

3 years agoRemove legacy processes from WebKit2
andersca@apple.com [Fri, 12 Feb 2016 17:10:19 +0000 (17:10 +0000)]
Remove legacy processes from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=154119

Reviewed by Darin Adler.

* Configurations/BaseLegacyProcess.xcconfig: Removed.
* DatabaseProcess/EntryPoint/mac/LegacyProcess/DatabaseProcessMain.mm: Removed.
(DatabaseProcessMain): Deleted.
* DatabaseProcess/EntryPoint/mac/LegacyProcess/Info.plist: Removed.
* NetworkProcess/EntryPoint/mac/LegacyProcess/Info.plist: Removed.
* NetworkProcess/EntryPoint/mac/LegacyProcess/NetworkProcessMain.mm: Removed.
(NetworkProcessMain): Deleted.
* PluginProcess/EntryPoint/mac/LegacyProcess/Info.plist: Removed.
* PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm: Removed.
(WebKit::PluginProcessMainDelegate::PluginProcessMainDelegate): Deleted.
(PluginProcessMain): Deleted.
* Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessEntryPoint.h: Removed.
(WebKit::ChildProcessMainDelegate::ChildProcessMainDelegate): Deleted.
(WebKit::ChildProcessMain): Deleted.
* Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessEntryPoint.mm: Removed.
(WebKit::ChildProcessMainDelegate::~ChildProcessMainDelegate): Deleted.
(WebKit::ChildProcessMainDelegate::installSignalHandlers): Deleted.
(WebKit::ChildProcessMainDelegate::doPreInitializationWork): Deleted.
(WebKit::ChildProcessMainDelegate::getConnectionIdentifier): Deleted.
(WebKit::ChildProcessMainDelegate::getClientIdentifier): Deleted.
(WebKit::ChildProcessMainDelegate::getClientProcessName): Deleted.
(WebKit::ChildProcessMainDelegate::getExtraInitializationData): Deleted.
(WebKit::ChildProcessMainDelegate::startRunLoop): Deleted.
(WebKit::ChildProcessMainDelegate::doPostRunWork): Deleted.
* Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.mm: Removed.
(WebKit::closeUnusedFileDescriptors): Deleted.
(WebKit::BootstrapMain): Deleted.
(main): Deleted.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/EntryPoint/mac/LegacyProcess/Info.plist: Removed.
* WebProcess/EntryPoint/mac/LegacyProcess/WebContentProcessMain.mm: Removed.
(WebKit::WebContentProcessMainDelegate::WebContentProcessMainDelegate): Deleted.
(WebContentProcessMain): Deleted.

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

3 years agoUnreviewed nit fixes after r196466.
cdumez@apple.com [Fri, 12 Feb 2016 16:49:01 +0000 (16:49 +0000)]
Unreviewed nit fixes after r196466.

* Modules/speech/SpeechSynthesisUtterance.idl: Fix curly bracket
  placement.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader): Use wrappableObject instead of domObject.
* bindings/scripts/test/*: Rebaseline.
* dom/WebKitNamedFlow.idl: Drop unnecessary #if case.

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

3 years ago[GTK] HTTP auth dialog incorrectly rendered with Accelerated Compositing enabled
carlosgc@webkit.org [Fri, 12 Feb 2016 16:40:14 +0000 (16:40 +0000)]
[GTK] HTTP auth dialog incorrectly rendered with Accelerated Compositing enabled
https://bugs.webkit.org/show_bug.cgi?id=154159

Reviewed by Michael Catanzaro.

There are two problems here, first we are changing the cairo
operator when rendering the xcomposite window pixmap without a
proper save/restore, so it affects the drawing that happens after
that, and second problem is that we are not rendering the gray
background in AC mode because we are returning earlier.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewRenderAcceleratedCompositingResults):
(webkitWebViewBaseDraw):

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

3 years ago[GTK] Properly handle classes inheriting from EventTarget
carlosgc@webkit.org [Fri, 12 Feb 2016 16:37:13 +0000 (16:37 +0000)]
[GTK] Properly handle classes inheriting from EventTarget
https://bugs.webkit.org/show_bug.cgi?id=154158

Reviewed by Michael Catanzaro.

Instead of removing its parent we now handle the case of classes
having EventTarget as parent to make them implement the interface
instead.

* bindings/scripts/CodeGeneratorGObject.pm:
(ShouldBeExposedAsInterface): Whether the parent given class
should be exposed as an interface instead of a parent class.
(GetParentClassName): Return Object as parent for classes having
a parent that should be exposed as an interface.
(GetParentImplClassName): Ditto.
(GetBaseClass): Ditto.
(GetParentGObjType): Ditto.
(SkipFunction): Add FIXME comment.
(ImplementsInterface): Helper function to check if a class
implements the given interface.
(GenerateCFile): Check whether the class implements EventTarget to
generate the interface implementation.
(GenerateInterface): Do not remove the parent class when it's EventTarget.

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

3 years agoUnreviewed, rolling out r196470.
commit-queue@webkit.org [Fri, 12 Feb 2016 15:49:24 +0000 (15:49 +0000)]
Unreviewed, rolling out r196470.
https://bugs.webkit.org/show_bug.cgi?id=154167

Broke some tests (Requested by anttik on #webkit).

Reverted changeset:

"Factor class change style invalidation code into a class"
https://bugs.webkit.org/show_bug.cgi?id=154163
http://trac.webkit.org/changeset/196470

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

3 years agoFactor class change style invalidation code into a class
antti@apple.com [Fri, 12 Feb 2016 15:05:12 +0000 (15:05 +0000)]
Factor class change style invalidation code into a class
https://bugs.webkit.org/show_bug.cgi?id=154163

Reviewed by Andreas Kling.

Factor this piece of functionality out of Element and into ClassChangeInvalidation class.

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::classStringHasClassName):
(WebCore::Element::classAttributeChanged):
(WebCore::collectClasses): Deleted.
(WebCore::computeClassChange): Deleted.
(WebCore::invalidateStyleForClassChange): Deleted.
* style/ClassChangeInvalidation.cpp: Added.
(WebCore::Style::ClassChangeInvalidation::computeClassChange):
(WebCore::Style::ClassChangeInvalidation::invalidateStyle):
* style/ClassChangeInvalidation.h: Added.
(WebCore::Style::ClassChangeInvalidation::needsInvalidation):
(WebCore::Style::ClassChangeInvalidation::ClassChangeInvalidation):
(WebCore::Style::ClassChangeInvalidation::~ClassChangeInvalidation):

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

3 years agoGCC buildfix in Source/WebCore/svg/SVGToOTFFontConversion.cpp
ossy@webkit.org [Fri, 12 Feb 2016 13:52:07 +0000 (13:52 +0000)]
GCC buildfix in Source/WebCore/svg/SVGToOTFFontConversion.cpp
https://bugs.webkit.org/show_bug.cgi?id=154162

Reviewed by Andreas Kling.

* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::finishAppendingKERNSubtable):

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

3 years agoDon't invalidate the FontCache on memory pressure.
akling@apple.com [Fri, 12 Feb 2016 12:39:45 +0000 (12:39 +0000)]
Don't invalidate the FontCache on memory pressure.
<https://webkit.org/b/154161>

Reviewed by Antti Koivisto.

Invalidating the FontCache does more harm than good:

    - Anything that's still in the cache at this point is also
      referenced outside the cache, thus will not actually get deleted.

    - Future deduplication will fail, leading to more objects.

    - The global FontCache generation gets bumped, causing future style
      recalcs to be less efficient and breaking style sharing.

    - All FontSelector invalidation callbacks will fire, potentially
      causing forced full-document style recalcs.

In fact, the only win from invalidating the FontCache comes from some
minor shrinkage in the containers that make up the cache itself.

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseCriticalMemory): Deleted.

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

3 years ago[GTK] Allow applications to disable Accelerated Compositing mode.
clopez@igalia.com [Fri, 12 Feb 2016 11:37:31 +0000 (11:37 +0000)]
[GTK] Allow applications to disable Accelerated Compositing mode.
https://bugs.webkit.org/show_bug.cgi?id=154147

Reviewed by Carlos Garcia Campos.

* UIProcess/gtk/WebPreferencesGtk.cpp:
(WebKit::WebPreferences::platformInitializeStore): if the environment
variable  WEBKIT_DISABLE_COMPOSITING_MODE is defined, then disable AC.

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

3 years ago[Web IDL] interfaces should inherit EventTarget instead of duplicating the EventTarge...
cdumez@apple.com [Fri, 12 Feb 2016 07:28:32 +0000 (07:28 +0000)]
[Web IDL] interfaces should inherit EventTarget instead of duplicating the EventTarget API
https://bugs.webkit.org/show_bug.cgi?id=154121
<rdar://problem/24613234>

Reviewed by Gavin Barraclough.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Interfaces should inherit EventTarget instead of duplicating the
EventTarget API in their IDL. Not only the duplication is ugly and
error-prone, but this also does not match the specifications and
have subtle web-exposed differences.

This patch takes care of all interfaces except for DOMWindow and
WorkerGlobalScope. Those will be updated in the follow-up patch
as they will require a little bit more work and testing.

We should also be able to get rid of the [EventTarget] WebKit IDL
attribute in a follow-up.

No new tests, already covered by existing tests.

* Modules/battery/BatteryManager.idl:
* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBRequest.idl:
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/IDBTransaction.idl:
* Modules/mediasession/MediaRemoteControls.idl:
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/MediaSource.idl:
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBuffer.idl:
* Modules/mediasource/SourceBufferList.h:
* Modules/mediasource/SourceBufferList.idl:
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStream.idl:
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCDTMFSender.idl:
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCDataChannel.idl:
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/notifications/Notification.idl:
* Modules/speech/SpeechSynthesisUtterance.idl:
* Modules/webaudio/AudioContext.idl:
* Modules/webaudio/AudioNode.idl:
* Modules/websockets/WebSocket.idl:
* css/FontLoader.idl:
* dom/EventTarget.h:
* dom/MessagePort.idl:
* dom/Node.h:
* dom/Node.idl:
* dom/WebKitNamedFlow.idl:
* fileapi/FileReader.idl:
* html/MediaController.idl:
* html/track/AudioTrackList.idl:
* html/track/TextTrack.idl:
* html/track/TextTrackCue.idl:
* html/track/TextTrackList.idl:
* html/track/VideoTrackList.idl:
* loader/appcache/DOMApplicationCache.h:
* loader/appcache/DOMApplicationCache.idl:
* page/EventSource.idl:
* page/Performance.h:
* page/Performance.idl:
* workers/Worker.idl:
* xml/XMLHttpRequest.h:
* xml/XMLHttpRequest.idl:
* xml/XMLHttpRequestUpload.idl:
- Drop hardcoded EventTarget operations and inherit EventTarget instead.
- Drop JSGenerateToNativeObject / JSGenerateToJSObject IDL extended
  attributes for interfaces inheriting the EventTarget interface as
  the bindings generator now does this automatically for us.
- On native side, have EventTarget subclass ScriptWrappable instead of
  each of its subclasses doing so. The issue was that
  EventTargetOwner::finalize() was calling uncacheWrapper() with an
  EventTarget*, which would not clear inlined cached wrapped (see
  clearInlineCachedWrapper()) because EventTarget did not subclass
  ScriptWrappable. However, cacheWrapper() is called is a specific
  subtype pointer (e.g. Node*) and we would decide to create an
  inline cached wrapper because Node subclassed ScriptWrappable
  (as well as EventTarget).

* WebCore.xcodeproj/project.pbxproj:
Export JSEventTarget.h as private header to fix the build.

* bindings/js/JSDOMBinding.h:
(WebCore::wrapperKey):
(WebCore::getCachedWrapper):
(WebCore::cacheWrapper):
(WebCore::uncacheWrapper):
Use new wrapperKey() function that is generated for each bindings
class that also has wrapperOwner(). This is used instead of the
C cast to void* in order to cast to the base wrapped type to fix
issues with multiple inheritance. The issue was that cacheWrapper()
was getting called with a DOM object subtype pointer (e.g.
AudioContext*) but uncacheWrapper() was getting called with a base
wrapped type pointer (e.g. EventTarget*). Most of our DOM classes
use multiple inheritance and thus the pointer values (used as keys
in the weak map) may differ.

* bindings/js/JSTrackCustom.cpp:
(WebCore::toJS):
Call CREATE_DOM_WRAPPER() with an actual wrapped type (e.g. AudioTrack)
instead of TrackBase type. TrackBase does not have corresponding
generated bindings and therefore does not have a wrapperKey()
function.

* bindings/scripts/CodeGeneratorJS.pm:
(ShouldGenerateToWrapped):
(ShouldGenerateToJSDeclaration):
(GenerateHeader):
- Generate a wrapperKey() utility function along-side wrapperOwner()
  to help cast to the base wrapped type.
- Generate toWrapped() / toJS() utility functions for interfaces
  that inherit EventTarget as those are required by our
  implementation and this avoids having to explicitly have them in
  the IDL.

* bindings/scripts/test/*:
Rebaseline bindings tests.

LayoutTests:

Rebaseline a couple of layout tests now that interfaces inherit EventTarget
instead of duplicating the EventTarget API in their IDL.

* fast/dom/Window/window-properties-performance-expected.txt:
* fast/dom/prototype-chain-expected.txt:

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

3 years agoLand the change that was supposed to be the part of r196463.
rniwa@webkit.org [Fri, 12 Feb 2016 05:21:29 +0000 (05:21 +0000)]
Land the change that was supposed to be the part of r196463.

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskPage.prototype._didFetchTestGroups): Select the latest test group by default.

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

3 years agoWeb Inspector: SourceCodeTextEditor close() generates removeEventListener warnings
commit-queue@webkit.org [Fri, 12 Feb 2016 05:17:12 +0000 (05:17 +0000)]
Web Inspector: SourceCodeTextEditor close() generates removeEventListener warnings
https://bugs.webkit.org/show_bug.cgi?id=154150

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-02-11
Reviewed by Timothy Hatcher.

* UserInterface/Views/SourceCodeTextEditor.js:
(WebInspector.SourceCodeTextEditor.prototype.close):
Remove the event listeners in the cases that we would have added them.
If we have SourceMap information we should remove the key listener,
and if we don't we should remove the SourceMapAdded listener.

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

3 years agoRefine v3 UI's analysis task page
rniwa@webkit.org [Fri, 12 Feb 2016 05:14:32 +0000 (05:14 +0000)]
Refine v3 UI's analysis task page
https://bugs.webkit.org/show_bug.cgi?id=154152

Reviewed by Chris Dumez.

This patch makes the following refinements to the analysis task page:
 - Always show the relative different of in-progress A/B testing.
 - Make the annotations (colored bars) in the chart open other analysis tasks.
 - Order the A/B testing groups in the reverse chronological order.
 - Select the time range corresponding to the current test group.

* public/v3/components/analysis-results-viewer.js:
(AnalysisResultsViewer.cssTemplate): Fixed the bug that pending and running testing groups are no longer
colored after r196440. Use a slightly more opaque color for currently running groups compared to pending ones.

* public/v3/components/chart-pane-base.js:
(ChartPaneBase.prototype.setMainSelection): Added.
(ChartPaneBase.prototype._openAnalysisTask): Moved the code from ChartPane._openAnalysisTask so that it can be
reused in both AnalysisTaskChartPane and ChartPane (in charts page).
(ChartPaneBase.prototype.router): Added. Overridden by each subclass.

* public/v3/components/test-group-results-table.js:
(TestGroupResultsTable.prototype.buildRowGroups): Always show the summary (relative difference of A to B) as
long as there are some results in each set.

* public/v3/models/test-group.js:
(TestGroup.prototype.compareTestResults): Always set .label and .fullLabel with the relative change as long as
there are some values. Keep using "pending" and "running" in .status since that would determine the color of
stacking blocks representing those A/B testing groups.

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskChartPane):
(AnalysisTaskChartPane.prototype.setPage): Added.
(AnalysisTaskChartPane.prototype.router): Added.
(AnalysisTaskPage):
(AnalysisTaskPage.prototype.render): Show the list of A/B testing groups in the reverse chronological order.
Also set the main chart's selection to the time range of the current test group.

* public/v3/pages/chart-pane.js:
(ChartPane.prototype.router): Added.
(ChartPane.prototype._openAnalysisTask): Moved to ChartPaneBase.prototype._openAnalysisTask.

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

3 years agoFix internal Windows build.
achristensen@apple.com [Fri, 12 Feb 2016 03:24:49 +0000 (03:24 +0000)]
Fix internal Windows build.
rdar://problem/24622882

* WebKit.vcxproj/WebKit.proj:
Don't define DEBUG_SUFFIX in release builds.

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

3 years agoUnreviewed, rolling out r196453.
ryanhaddad@apple.com [Fri, 12 Feb 2016 01:30:45 +0000 (01:30 +0000)]
Unreviewed, rolling out r196453.
https://bugs.webkit.org/show_bug.cgi?id=154142

This change broke internal iOS builds (Requested by ryanhaddad
on #webkit).

Reverted changeset:

"Move Download authentication code to AuthenticationManager"
https://bugs.webkit.org/show_bug.cgi?id=154132
http://trac.webkit.org/changeset/196453

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

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

3 years agoOptimize texture-complete checks
bfulgham@apple.com [Fri, 12 Feb 2016 01:05:48 +0000 (01:05 +0000)]
Optimize texture-complete checks
https://bugs.webkit.org/show_bug.cgi?id=98308

Reviewed by Dean Jackson.

No new tests: No change in behavior.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::initializeNewContext): Initially consider all
textures as suspect.
(WebCore::WebGLRenderingContextBase::extensions): New helper function.
(WebCore::WebGLRenderingContextBase::reshape): Mark textures as invalid when appropriate.
(WebCore::WebGLRenderingContextBase::bindTexture): Identify invalid textures and mark
them for later fix-up. Likewise, remove 'known good' textures from the fix-up pass.
(WebCore::WebGLRenderingContextBase::deleteTexture): Remove instances of the deleted texture
from our set of invalid textures.
(WebCore::WebGLRenderingContextBase::checkTextureCompleteness): Only iterate through
the 'bad' textures, rather than checking every single texture.
* html/canvas/WebGLRenderingContextBase.h:

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

3 years agoAdd a script to process backlogs created while perf dashboard was in the maintenance...
rniwa@webkit.org [Fri, 12 Feb 2016 01:05:14 +0000 (01:05 +0000)]
Add a script to process backlogs created while perf dashboard was in the maintenance mode
https://bugs.webkit.org/show_bug.cgi?id=154140

Reviewed by Chris Dumez.

Added a script to process the backlog JSONs created while the perf dashboard was put in the maintenance mode.
It re-submits each JSON file to the perf dashboard using the same server config file used by syncing scripts.

* public/include/report-processor.php:
(TestRunsGenerator::test_value_list_to_values_by_iterations): Fixed a bug in the error message code. It was
referencing an undeclared variable.
* tools/process-maintenance-backlog.py: Added.

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

3 years agoNeed WTFCrash workaround for shipping SafariForWebKitDevelopment binaries.
mark.lam@apple.com [Fri, 12 Feb 2016 00:59:11 +0000 (00:59 +0000)]
Need WTFCrash workaround for shipping SafariForWebKitDevelopment binaries.
https://bugs.webkit.org/show_bug.cgi?id=154125

Reviewed by Joseph Pecoraro.

Presently shipping SafariForWebKitDevelopment binaries still expect to link to a
WTFCrash function.  We need to provide this function as a workaround until we can
update SafariForWebKitDevelopment to use the new inlined version.

We do this by doing:
1. Make WTFCrashImpl() the sole function for implementing a crash.
   The CRASH() macro is now defined to be WTFCrashImpl() instead of WTFCrash().
2. Renamed the legacy WTFCrash() to WTFCrashImpl() for debug or non-Darwin builds.
   For (non-debug && OS(DARWIN)) builds, WTFCrashImpl() will be an inlined
   function with an asm statement that issues a breakpoint trap.
3. Implement WTFCrash() as a function that calls CRASH().
   This satisfies the need of shipping SafariForWebKitDevelopment binaries.
4. Change WTFCrashWithSecurityImplication() to call CRASH().
   This ensures that we have a consistent implementation of how we crash.
5. Changed WTFLogAlwaysAndCrash() to call CRASH() instead of WTFCrash().
   This is just to have consistency in that all code in the WebKit project
   now crashes by calling CRASH(), not WTFCrash().

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

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

3 years agoUse the system PluginProcess.app for generating plug-in MIME type preferences
andersca@apple.com [Fri, 12 Feb 2016 00:40:17 +0000 (00:40 +0000)]
Use the system PluginProcess.app for generating plug-in MIME type preferences
https://bugs.webkit.org/show_bug.cgi?id=154139

Reviewed by Dan Bernstein.

* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::PluginProcessProxy::createPropertyListFile):

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

3 years agoEditingRangeIsRelativeTo::Document and NSRangeIsRelativeTo::Document should
bdakin@apple.com [Fri, 12 Feb 2016 00:31:53 +0000 (00:31 +0000)]
EditingRangeIsRelativeTo::Document and NSRangeIsRelativeTo::Document should
be called EditableRoot instead
https://bugs.webkit.org/show_bug.cgi?id=154138

Reviewed by Alexey Proskuryakov.

EditableRoot is much more accurate than Document.
Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame _convertToDOMRange:]):
(-[WebFrame _convertToDOMRange:rangeIsRelativeTo:]):
* WebView/WebFrameInternal.h:
* WebView/WebHTMLView.mm:
(-[WebHTMLView insertText:]):

Source/WebKit2:

* Shared/EditingRange.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::insertText):
(WebKit::WebViewImpl::selectedRangeWithCompletionHandler):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::rangeFromEditingRange):
* WebProcess/WebPage/WebPage.h:

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

3 years agoAssert that IDBTransaction::transitionedToFinishing transitions to finishing.
achristensen@apple.com [Fri, 12 Feb 2016 00:17:18 +0000 (00:17 +0000)]
Assert that IDBTransaction::transitionedToFinishing transitions to finishing.
https://bugs.webkit.org/show_bug.cgi?id=154061

* Modules/indexeddb/client/IDBTransactionImpl.cpp:
(WebCore::IDBClient::IDBTransaction::transitionedToFinishing):
Added assertion that we are transitioning to a finished or finishing state, based on Darin's feedback.

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

3 years agoWeb Inspector: RemoteInspector's listings should include whether an AutomationTarget...
bburg@apple.com [Fri, 12 Feb 2016 00:02:29 +0000 (00:02 +0000)]
Web Inspector: RemoteInspector's listings should include whether an AutomationTarget is paired
https://bugs.webkit.org/show_bug.cgi?id=154077
<rdar://problem/24589133>

Reviewed by Joseph Pecoraro.

Instead of not generating a listing for the target when it is occupied,
generate the listing with a 'paired' flag. The old flag was redundant
because a _WKAutomationDelegate will not create a session if it doesn't
support automation or it already has an active session.

* inspector/remote/RemoteAutomationTarget.cpp:
(Inspector::RemoteAutomationTarget::setIsPaired):
(Inspector::RemoteAutomationTarget::setAutomationAllowed): Deleted.
* inspector/remote/RemoteAutomationTarget.h:
Return false for remoteControlAllowed() if the target is already paired.
This function is used by RemoteInspector to deny incoming connections.

* inspector/remote/RemoteInspector.mm:
(Inspector::RemoteInspector::listingForAutomationTarget):
* inspector/remote/RemoteInspectorConstants.h:

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

3 years agoMove Download authentication code to AuthenticationManager
achristensen@apple.com [Fri, 12 Feb 2016 00:02:03 +0000 (00:02 +0000)]
Move Download authentication code to AuthenticationManager
https://bugs.webkit.org/show_bug.cgi?id=154132

Reviewed by Sam Weinig.

When a video element makes a request that receives an authentication challenge, the
AuthenticationManager receives an AuthenticationChallenge without an AuthenticationClient.
As a result, Download::receivedCredential and other functions were being called, which
sent a message to the challenge's sender.  This functionality is not specific to downloads,
so I moved it from Download to AuthenticationManager.

This fixes http/tests/media/video-auth.html when using NetworkSession
because I use AuthenticationManager::receivedCredential if there is no AuthenticationClient
instead of improperly asserting that there is always an AuthenticationClient if there is no
completionHandler.

* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/ios/DownloadIOS.mm:
(WebKit::Download::platformDidFinish):
(WebKit::Download::receivedCredential): Deleted.
(WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted.
(WebKit::Download::receivedCancellation): Deleted.
(WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted.
(WebKit::Download::receivedChallengeRejection): Deleted.
* NetworkProcess/Downloads/mac/DownloadMac.mm:
(WebKit::Download::platformDidFinish):
(WebKit::Download::receivedCredential): Deleted.
(WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted.
(WebKit::Download::receivedCancellation): Deleted.
(WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted.
(WebKit::Download::receivedChallengeRejection): Deleted.
* NetworkProcess/Downloads/soup/DownloadSoup.cpp:
(WebKit::Download::platformDidFinish):
(WebKit::Download::receivedCredential): Deleted.
(WebKit::Download::receivedRequestToContinueWithoutCredential): Deleted.
(WebKit::Download::receivedCancellation): Deleted.
(WebKit::Download::continueWithoutCredential): Deleted.
(WebKit::Download::useCredential): Deleted.
(WebKit::Download::cancelAuthenticationChallenge): Deleted.
(WebKit::Download::receivedRequestToPerformDefaultHandling): Deleted.
(WebKit::Download::receivedChallengeRejection): Deleted.
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
(WebKit::AuthenticationManager::useCredentialForSingleChallenge):
(WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
(WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
(WebKit::AuthenticationManager::cancelChallenge):
(WebKit::AuthenticationManager::cancelSingleChallenge):
(WebKit::AuthenticationManager::performDefaultHandling):
(WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
(WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
(WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
* Shared/Authentication/AuthenticationManager.h:
(WebKit::AuthenticationManager::outstandingAuthenticationChallengeCount):
* Shared/Authentication/cocoa: Added.
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm: Added.
(WebKit::AuthenticationManager::receivedCredential):
(WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
(WebKit::AuthenticationManager::receivedCancellation):
(WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
(WebKit::AuthenticationManager::receivedChallengeRejection):
* Shared/Authentication/soup: Added.
* Shared/Authentication/soup/AuthenticationManagerSoup.cpp: Added.
(WebKit::AuthenticationManager::receivedCredential):
(WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
(WebKit::AuthenticationManager::receivedCancellation):
(WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
(WebKit::AuthenticationManager::receivedChallengeRejection):
* WebKit2.xcodeproj/project.pbxproj:

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

3 years agoSoft spaces are often tracked in the wrong spot
bdakin@apple.com [Thu, 11 Feb 2016 23:39:15 +0000 (23:39 +0000)]
Soft spaces are often tracked in the wrong spot
https://bugs.webkit.org/show_bug.cgi?id=154127
-and corresponding-
rdar://problem/24493140

Reviewed by Sam Weinig.

Soft spaces are in the wrong space now for two reasons. First of all, the
NSRange we get from the accepted candidate is relative to the paragraph
start, so without this patch, soft spaces are only ever right for the first
paragraph. Secondly, if focus changes for any reason other than text
insertion, soft spaces are also wrong because they need to be re-set.

Source/WebKit/mac:

New version of _convertToDOMRange takes a NSRangeIsRelativeTo so that it can
handle ranges relative to both the document and the paragraph.
* WebView/WebFrame.mm:
(-[WebFrame _convertToDOMRange:rangeIsRelativeTo:]):
(-[WebFrame _convertNSRangeToDOMRange:]):

New enum NSRangeIsRelativeTo.
* WebView/WebFrameInternal.h:

Re-set the softSpaceRange on selection changes so long as the WebCore::Editor
is not currently handling an accepted candidate.
* WebView/WebHTMLView.mm:
(-[WebHTMLView _selectionChanged]):

If needToRemoveSoftSpace is true, then the replacementRange is
relative to the paragraph.
(-[WebHTMLView insertText:]):

Source/WebKit2:

New enum can be used to indicate what an EditingRange is relative to.
* Shared/EditingRange.h:
(WebKit::EditingRange::EditingRange):

didHandleAcceptedCandidate is a new message that gets sent from the
WebProcess. This lets us track a bool m_isHandlingAcceptedCandidate.
* UIProcess/Cocoa/WebViewImpl.h:
(WebKit::WebViewImpl::didHandleAcceptedCandidate):

Re-set the m_softSpaceRange on selection changes so long as
m_isHandlingAcceptedCandidate is false.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::selectionDidChange):

Set m_isHandlingAcceptedCandidate to true.
(WebKit::WebViewImpl::handleAcceptedCandidate):

Set m_isHandlingAcceptedCandidate to false.
(WebKit::WebViewImpl::didHandleAcceptedCandidate):

insertTextAsync takes a new parameter indicating what the replacementRange is
relative to. If needToRemoveSoftSpace is true, then the replacementRange is
relative to the paragraph.
(WebKit::WebViewImpl::insertText):

Pipe didHandleAcceptedCandidate through to WebViewImpl.
* UIProcess/PageClient.h:

insertTextAsync takes an EditingRangeIsRelativeTo.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::insertTextAsync):

Pipe didHandleAcceptedCandidate through to WebViewImpl.
(WebKit::WebPageProxy::didHandleAcceptedCandidate):
* UIProcess/WebPageProxy.h:

New message lets the WebProcess tell the UIProcess when the candidate has
been accepted.
* UIProcess/WebPageProxy.messages.in:

Pipe didHandleAcceptedCandidate through to WebViewImpl.
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::didHandleAcceptedCandidate):

insertTextAsync takes an EditingRangeIsRelativeTo. Pass that through to
rangeFromEditingRange to get the correct range.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::insertTextAsync):

Use the EditingRangeIsRelativeTo to find the right WebCore::Range.
(WebKit::WebPage::rangeFromEditingRange):

Take EditingRangeIsRelativeTo in a few places.
* WebProcess/WebPage/WebPage.h:

InsertTextAsync takes a EditingRangeIsRelativeTo.
* WebProcess/WebPage/WebPage.messages.in:

Send didHandleAccpetedCandidate to the UIProcess
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::handleAcceptedCandidate):

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

3 years agoDFG::ByteCodeParser needs to null check the result of presenceLike()
fpizlo@apple.com [Thu, 11 Feb 2016 23:06:02 +0000 (23:06 +0000)]
DFG::ByteCodeParser needs to null check the result of presenceLike()
https://bugs.webkit.org/show_bug.cgi?id=154135
rdar://problem/24291586

Reviewed by Geoffrey Garen.

ByteCodeParser::presenceLike() could return a null object property condition if it detects a
contradiction. That could happen due to bogus profiling. It's totally OK - we just need to
bail from using a property condition when that happens.

* bytecode/ObjectPropertyCondition.h:
(JSC::ObjectPropertyCondition::equivalence):
(JSC::ObjectPropertyCondition::operator bool):
(JSC::ObjectPropertyCondition::object):
(JSC::ObjectPropertyCondition::condition):
(JSC::ObjectPropertyCondition::operator!): Deleted.
* bytecode/PropertyCondition.h:
(JSC::PropertyCondition::equivalence):
(JSC::PropertyCondition::operator bool):
(JSC::PropertyCondition::kind):
(JSC::PropertyCondition::uid):
(JSC::PropertyCondition::operator!): Deleted.
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::check):
(JSC::DFG::ByteCodeParser::load):

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

3 years agoWebContent process crashes when performing data detection on content with existing...
enrica@apple.com [Thu, 11 Feb 2016 23:04:13 +0000 (23:04 +0000)]
WebContent process crashes when performing data detection on content with existing data detector links.
https://bugs.webkit.org/show_bug.cgi?id=154118
rdar://problem/24511860

Reviewed by Tim Horton.

The DOM mutation caused by removing the existing links, can shift the range endpoints.
We now save the range enpoints as positions so that we can recreate the ranges,
if a DOM mutation occurred.

* editing/cocoa/DataDetection.mm:
(WebCore::removeResultLinksFromAnchor):
(WebCore::searchForLinkRemovingExistingDDLinks):
(WebCore::DataDetection::detectContentInRange):

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

3 years ago[JSC] SqrtFloat and CeilFloat also suffer from partial register stalls
benjamin@webkit.org [Thu, 11 Feb 2016 23:01:39 +0000 (23:01 +0000)]
[JSC] SqrtFloat and CeilFloat also suffer from partial register stalls
https://bugs.webkit.org/show_bug.cgi?id=154131

Reviewed by Filip Pizlo.

Looks like I forgot to update this when adding Float support.
Credit to Filip for finding this issue.

* b3/air/AirFixPartialRegisterStalls.cpp:

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

3 years agoAnalysisResultsViewer never uses this._smallerIsBetter
rniwa@webkit.org [Thu, 11 Feb 2016 22:52:40 +0000 (22:52 +0000)]
AnalysisResultsViewer never uses this._smallerIsBetter
https://bugs.webkit.org/show_bug.cgi?id=154134

Reviewed by Chris Dumez.

Removed the unused instance variable _smallerIsBetter from AnalysisResultsViewer and TestGroupStackingBlock.

* public/v3/components/analysis-results-viewer.js:
(AnalysisResultsViewer): Removed the unused _smallerIsBetter.
(AnalysisResultsViewer.prototype.setSmallerIsBetter): Deleted.
(AnalysisResultsViewer.prototype.buildRowGroups):
(AnalysisResultsViewer.TestGroupStackingBlock): Removed the unused _smallerIsBetter.
* public/v3/pages/analysis-task-page.js:
(AnalysisTaskPage.prototype._didFetchTask):

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

3 years agoMake MediaResourceLoader behave more like a CachedResourceLoader.
jer.noble@apple.com [Thu, 11 Feb 2016 22:34:36 +0000 (22:34 +0000)]
Make MediaResourceLoader behave more like a CachedResourceLoader.
https://bugs.webkit.org/show_bug.cgi?id=154117

Reviewed by Alex Christensen.

MediaResourceLoader currently can only handle a single request at a time. Split the class
into two, MediaResourceLoader and MediaResource, effectively wrapping CachedResourceLoader
and CachedRawResource respectively. With this devision, the same loader can be used to issue
multiple simultaneous resource requests.

This necessecitates splitting PlatformMediaResource into two classes as well.  To simplify
the HTMLMediaElement, MediaPlayer, and MediaPlayerClient APIs, do not require a client
object when creating the loader; instead, the client is required to create the resource.
This also matches the CachedRawResource API.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader): Remove the client parameter.
* html/HTMLMediaElement.h:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::MediaResourceLoader):
(WebCore::MediaResourceLoader::~MediaResourceLoader):
(WebCore::MediaResourceLoader::requestResource): Renamed from start().
(WebCore::MediaResourceLoader::removeResource): Remove resource from live resource list.
(WebCore::MediaResource::create): Utility factory.
(WebCore::MediaResource::MediaResource):
(WebCore::MediaResource::~MediaResource):
(WebCore::MediaResource::stop): Moved from MediaResourceLoader.
(WebCore::MediaResource::setDefersLoading): Ditto.
(WebCore::MediaResource::responseReceived): Ditto.
(WebCore::MediaResource::redirectReceived): Ditto.
(WebCore::MediaResource::dataSent): Ditto.
(WebCore::MediaResource::dataReceived): Ditto.
(WebCore::MediaResource::notifyFinished): Ditto.
(WebCore::MediaResource::getOrCreateReadBuffer): Ditto.
* loader/MediaResourceLoader.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::createResourceLoader):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerCreateResourceLoader):
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::~PlatformMediaResourceClient): Renamed from PlatformMediaResourceLoaderClient.
(WebCore::PlatformMediaResourceClient::responseReceived): Client methods now take a reference to the resource.
(WebCore::PlatformMediaResourceClient::redirectReceived): Ditto.
(WebCore::PlatformMediaResourceClient::dataSent): Ditto.
(WebCore::PlatformMediaResourceClient::dataReceived): Ditto.
(WebCore::PlatformMediaResourceClient::accessControlCheckFailed): Ditto.
(WebCore::PlatformMediaResourceClient::loadFailed): Ditto.
(WebCore::PlatformMediaResourceClient::loadFinished): Ditto.
(WebCore::PlatformMediaResourceClient::getOrCreateReadBuffer): Ditto.
(WebCore::PlatformMediaResourceLoader::PlatformMediaResourceLoader): Ditto.
(WebCore::PlatformMediaResource::PlatformMediaResource):
(WebCore::PlatformMediaResource::~PlatformMediaResource):
(WebCore::PlatformMediaResource::setClient):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStart):
(webKitWebSrcNeedData):
(webKitWebSrcEnoughData):
(CachedResourceStreamingClient::getOrCreateReadBuffer):
(CachedResourceStreamingClient::responseReceived):
(CachedResourceStreamingClient::dataReceived):
(CachedResourceStreamingClient::accessControlCheckFailed):
(CachedResourceStreamingClient::loadFailed):
(CachedResourceStreamingClient::loadFinished):

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

3 years agoBuild fix after r196440.
rniwa@webkit.org [Thu, 11 Feb 2016 22:28:47 +0000 (22:28 +0000)]
Build fix after r196440.

* public/v3/models/test-group.js:
(TestGroup.prototype.addBuildRequest): Clear the map instead of setting the property to null.

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

3 years agoPerf dashboard should have UI to retry A/B testing
rniwa@webkit.org [Thu, 11 Feb 2016 22:17:55 +0000 (22:17 +0000)]
Perf dashboard should have UI to retry A/B testing
https://bugs.webkit.org/show_bug.cgi?id=154090

Reviewed by Chris Dumez.

Added a button to re-try an existing A/B testing group with a custom repetition count. The same button functions
as a way of confirming the progression/regression when there have been no A/B testing scheduled in the task.

Also fixed the bug that A/B testing groups that have been waiting for other test groups will be shown as "running".

* public/v3/components/results-table.js:
(ResultsTable.cssTemplate): Don't pad the list of extra repositories when it's empty.

* public/v3/components/test-group-results-table.js:
(TestGroupResultsTable.prototype.buildRowGroups): Use TestGroup.labelForRootSet instead of manually
computing the letter for each configuration set.

* public/v3/models/build-request.js:
(BuildRequest.prototype.hasStarted): Added.

* public/v3/models/data-model.js:
(DataModelObject.ensureSingleton): Added.
(DataModelObject.cachedFetch): Added noCache option. This is used when re-fetching the test groups after
creating one.

* public/v3/models/measurement-cluster.js:
(MeasurementCluster.prototype.startTime): Added.

* public/v3/models/measurement-set.js:
(MeasurementSet.prototype.hasFetchedRange): Added. Returns true only if there are no "holes" (cluster
yet to be fetched) between the specified time range. This was added to fix a bug in AnalysisTaskPage's
_didFetchMeasurement.

* public/v3/models/test-group.js:
(TestGroup): Added this._rootSetToLabel.
(TestGroup.prototype.addBuildRequest): Reset this._rootSetToLabel along with this._requestedRootSets.
(TestGroup.prototype.repetitionCount): Added. Returns the number of iterations executed per set. We assume that
every root set in the test group shares a single repetition count.
(TestGroup.prototype.requestedRootSets): Now populates this._rootSetToLabel for labelForRootSet.
(TestGroup.prototype.labelForRootSet): Added.
(TestGroup.prototype.hasStarted): Added.
(TestGroup.prototype.compareTestResults): Use 'running' and 'pending' to differentiate test groups that are waiting
for other groups to finish running from the ones that are actually running ('incomplete' before this patch).
(TestGroup.fetchByTask):
(TestGroup.createAndRefetchTestGroups): Added. Creates a new test group using the privileged-api/create-test-group
and fetches the list of test groups for the specified analysis task.
(TestGroup._createModelsFromFetchedTestGroups): Extracted from TestGroup.fetchByTask.

* public/v3/pages/analysis-task-page.js:
(AnalysisTaskPage): Initialize _renderedCurrentTestGroup to undefined so that we'd always can differentiate
the initial call to AnalysisTaskPage.render and subsequent calls in which it's identical to _currentTestGroup.
(AnalysisTaskPage.prototype._didFetchMeasurement): Fixed a bug that we don't exit early even when some
clusters in between startPoint and endPoint are still being fetched via newly added hasFetchedRange.
(AnalysisTaskPage.prototype.render): Update the default repetition count based on the current test group.
Also update the label of the button to "Confirm the change" if there is no A/B testing in this task.
(AnalysisTaskPage.prototype._retryCurrentTestGroup): Added. Re-triggers an existing A/B testing group or creates
the A/B testing for the entire range of the analysis task.
(AnalysisTaskPage.prototype._hasDuplicateTestGroupName): Added.
(AnalysisTaskPage.prototype._createRetryNameForTestGroup): Added.
(AnalysisTaskPage.htmlTemplate): Added form controls to re-trigger A/B testing.
(AnalysisTaskPage.cssTemplate): Updated the style.

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

3 years agoSubpixel rendering: Make focusring painting subpixel aware.
zalan@apple.com [Thu, 11 Feb 2016 22:15:45 +0000 (22:15 +0000)]
Subpixel rendering: Make focusring painting subpixel aware.
https://bugs.webkit.org/show_bug.cgi?id=154111

Reviewed by David Hyatt.

Do not integral snap focusring rects while collecting them (use device pixel snapping instead
right before passing them to GraphicsContext::drawFocusRing).

Source/WebCore:

Unable to test.

* platform/graphics/GraphicsContext.h:
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawFocusRingRects::create):
(WebCore::DisplayList::DrawFocusRingRects::rects):
(WebCore::DisplayList::DrawFocusRingRects::DrawFocusRingRects):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawFocusRing):
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/mac/GraphicsContextMac.mm:
(WebCore::GraphicsContext::drawFocusRing):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addFocusRingRectsForInlineChildren):
(WebCore::RenderBlock::addFocusRingRects):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addFocusRingRectsForInlineChildren):
* rendering/RenderBlockFlow.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::addFocusRingRects):
* rendering/RenderBox.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
(WebCore::RenderElement::issueRepaintForOutlineAuto):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::absoluteRects):
(WebCore::RenderInline::addFocusRingRects):
* rendering/RenderInline.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::addFocusRingRects):
* rendering/RenderListBox.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addPDFURLRect):
(WebCore::RenderObject::absoluteFocusRingQuads):
* rendering/RenderObject.h:
(WebCore::RenderObject::addFocusRingRects):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::addFocusRingRects):
* rendering/RenderTextControl.h:
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::addFocusRingRects):
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::addFocusRingRects):
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::addFocusRingRects):
* rendering/svg/RenderSVGShape.h:

LayoutTests:

* platform/mac/accessibility/image-link-expected.txt:
* platform/mac/accessibility/mac/aria-columnrowheaders-expected.txt: Copied from LayoutTests/platform/mac/accessibility/table-cells-expected.txt.
* platform/mac/accessibility/mac/document-links-expected.txt: Added.
* platform/mac/accessibility/table-attributes-expected.txt:
* platform/mac/accessibility/table-cells-expected.txt:
* platform/mac/accessibility/table-sections-expected.txt:
* platform/mac/accessibility/table-with-rules-expected.txt:

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

3 years agoAddressing post-review comments after r196393
mmaxfield@apple.com [Thu, 11 Feb 2016 22:12:16 +0000 (22:12 +0000)]
Addressing post-review comments after r196393

Unreviewed.

* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::getFontFace):
* css/CSSSegmentedFontFace.h:

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