WebKit-https.git
3 years agoREGRESSION (r197724): <object>/<embed> with no URL does not match source *
dbates@webkit.org [Fri, 1 Apr 2016 01:54:47 +0000 (01:54 +0000)]
REGRESSION (r197724): <object>/<embed> with no URL does not match source *
https://bugs.webkit.org/show_bug.cgi?id=156079
<rdar://problem/25470805>

Reviewed by Brent Fulgham.

Source/WebCore:

Fixes an issue where HTML object and embed elements that are not associated with a URL are
allowed to load when object-src/default-src contains source *. More generally, we allow
such elements to load so long as object-src/default-src is not 'none' per section object-src
of the Content Security Policy Level 3 spec., <http://w3c.github.io/webappsec-csp> (Editor's Draft, 29 February 2016).

Tests: http/tests/security/contentSecurityPolicy/embed-with-no-url-allowed-by-default-src-star.html
       http/tests/security/contentSecurityPolicy/embed-with-no-url-allowed-by-star.html
       http/tests/security/contentSecurityPolicy/object-with-no-url-allowed-by-default-src-star.html
       http/tests/security/contentSecurityPolicy/object-with-no-url-allowed-by-star.html

* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::allowObjectFromSource): Modified to call violatedDirectiveInAnyPolicy() passing
ContentSecurityPolicySourceListDirective::ShouldAllowEmptyURLIfSourceListIsNotNone::Yes.
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkSource): Modified to take argument of type ContentSecurityPolicySourceListDirective::ShouldAllowEmptyURLIfSourceListIsNotNone (defaults to false)
and pass it through to ContentSecurityPolicySourceListDirective.
(WebCore::checkFrameAncestors): Explicitly pass ContentSecurityPolicySourceListDirective::ShouldAllowEmptyURLIfSourceListIsNotNone::No
to avoid URL from having the compiler implicitly convert it to a String and selecting override ContentSecurityPolicySourceListDirective::allows(const String&),
which will lead to incorrect results. We will look to make this code less error prone in <https://bugs.webkit.org/show_bug.cgi?id=156086>.
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForObjectSource): Modified to take argument of type
ContentSecurityPolicySourceListDirective::ShouldAllowEmptyURLIfSourceListIsNotNone and pass it through.
* page/csp/ContentSecurityPolicyDirectiveList.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
(WebCore::ContentSecurityPolicySourceList::parse): Set instance variable m_isNone to true so that we can differentiate
a source list with value 'none' from a source list that lists one or more sources or non-none keywords.
* page/csp/ContentSecurityPolicySourceList.h:
(WebCore::ContentSecurityPolicySourceList::isNone): Added.
* page/csp/ContentSecurityPolicySourceListDirective.cpp:
(WebCore::ContentSecurityPolicySourceListDirective::allows): Modified to take argument of type ContentSecurityPolicySourceListDirective::ShouldAllowEmptyURLIfSourceListIsNotNone
and updated code to return true for an empty URL only if this argument is ContentSecurityPolicySourceListDirective::ShouldAllowEmptyURLIfSourceListIsNotNone::Yes and
the source list does not have value 'none'.
* page/csp/ContentSecurityPolicySourceListDirective.h:

LayoutTests:

Add tests to ensure that HTML object and embed elements are allowed by source *.

* platform/ios-simulator/TestExpectations: Skip added tests as plugins are not supported on iOS.
* http/tests/security/contentSecurityPolicy/embed-with-no-url-allowed-by-default-src-star-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/embed-with-no-url-allowed-by-default-src-star.html: Added.
* http/tests/security/contentSecurityPolicy/embed-with-no-url-allowed-by-star-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/embed-with-no-url-allowed-by-star.html: Added.
* http/tests/security/contentSecurityPolicy/object-with-no-url-allowed-by-default-src-star-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/object-with-no-url-allowed-by-default-src-star.html: Added.
* http/tests/security/contentSecurityPolicy/object-with-no-url-allowed-by-star-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/object-with-no-url-allowed-by-star.html: Added.

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

3 years ago[JSC] CFA's valuesAtHead should be a list, not a map
commit-queue@webkit.org [Fri, 1 Apr 2016 01:48:34 +0000 (01:48 +0000)]
[JSC] CFA's valuesAtHead should be a list, not a map
https://bugs.webkit.org/show_bug.cgi?id=156087

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-03-31
Reviewed by Mark Lam.

One more step toward moving to the Air-style of liveness analysis:

Make DFG's valuesAtHead a list of Node*-AbstractValue.
This patch alone is already a speedup because our many CFAs
spend an unreasonable amount of time updating at block boundaries.

* dfg/DFGBasicBlock.h:
* dfg/DFGCFAPhase.cpp:
(JSC::DFG::CFAPhase::performBlockCFA):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::beginBasicBlock):
(JSC::DFG::setLiveValues):
(JSC::DFG::InPlaceAbstractState::merge):
* dfg/DFGNode.h:
(JSC::DFG::nodeValuePairComparator):
(JSC::DFG::nodeValuePairListDump):

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

3 years ago[EFL] Bump EFL version to 1.17.0
gyuyoung.kim@webkit.org [Fri, 1 Apr 2016 01:40:25 +0000 (01:40 +0000)]
[EFL] Bump EFL version to 1.17.0
https://bugs.webkit.org/show_bug.cgi?id=153008

Reviewed by Michael Catanzaro.

Original author is Csaba Osztrogon√°c  <ossy@webkit.org>

* efl/jhbuild.modules:

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

3 years agoREGRESSION (r194660): Navigating to HTTPS sites may fail with error
dbates@webkit.org [Fri, 1 Apr 2016 01:12:55 +0000 (01:12 +0000)]
REGRESSION (r194660): Navigating to HTTPS sites may fail with error
https://bugs.webkit.org/show_bug.cgi?id=155455
<rdar://problem/24308793>

Reviewed by Alexey Proskuryakov.

Fixes an issue where navigating to an HTTPS site may fail because the Security Framework uses
a cache directory that it does not have permission to use.

* Shared/mac/ChildProcessMac.mm:
(WebKit::codeSigningIdentifierForProcess): Queries the Security Framework for the code signed
bundle identifier/code signing identifier.
(WebKit::ChildProcess::initializeSandbox): Use the client identifier as part of the user directory
suffix. Verify that the client identifier matches the code signed bundled identifier/code
signing identifier for the code signed app/tool. Fix minor code style issue; use a C++-style cast
instead of a C-style cast when casting an OSStatus to a long.
(WebKit::findSecCodeForProcess): Deleted; incorporated logic into WebKit::codeSigningIdentifierForProcess().

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

3 years agoRevert rewrite const as var workaround
sbarati@apple.com [Fri, 1 Apr 2016 00:24:18 +0000 (00:24 +0000)]
Revert rewrite const as var workaround
https://bugs.webkit.org/show_bug.cgi?id=155393

Reviewed by Mark Lam.

Source/JavaScriptCore:

* parser/Parser.h:
(JSC::Parser::next):
(JSC::Parser::nextExpectIdentifier):
* runtime/VM.h:
(JSC::VM::setShouldRewriteConstAsVar): Deleted.
(JSC::VM::shouldRewriteConstAsVar): Deleted.

Source/WebCore:

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonVM):
* page/Settings.cpp:
* page/Settings.h:
(WebCore::Settings::shouldUseHighResolutionTimers):
(WebCore::Settings::backgroundShouldExtendBeyondPage):
(WebCore::Settings::shouldRewriteConstAsVar): Deleted.
(WebCore::Settings::setShouldRewriteConstAsVar): Deleted.

Source/WebKit2:

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

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

3 years agoUnreviewed, rolling out r196854.
cdumez@apple.com [Thu, 31 Mar 2016 23:59:18 +0000 (23:59 +0000)]
Unreviewed, rolling out r196854.

We do not need those assertions anymore as it seems
<rdar://problem/24457478> is fixed

Reverted changeset:

"Land release assertions to help track down a possible
HTMLCollection lifetime bug"
https://bugs.webkit.org/show_bug.cgi?id=154490
http://trac.webkit.org/changeset/196854

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

3 years agorun-webkit-tests fails to create user's cache directory when System Integrity Protect...
dbates@webkit.org [Thu, 31 Mar 2016 23:45:54 +0000 (23:45 +0000)]
run-webkit-tests fails to create user's cache directory when System Integrity Protection is enabled
https://bugs.webkit.org/show_bug.cgi?id=156071
<rdar://problem/25467827>

Reviewed by Brent Fulgham.

Fixes an issue where run-webkit-tests will fail to create the suffixed user's cache directory
on non-Apple Internal machines with System Integrity Protection enabled because the OS only
honors the suffix, specified by the environment variable DIRHELPER_USER_DIR_SUFFIX, in
privileged processes. And python(1) does not have sufficient privileges. As a workaround for
systems that have System Integrity Protection enabled we compute the path to the suffixed
user's cache directory by hand.

Additionally, fix an issue where the user's cache directory created by run-webkit-test was
never deleted on cessation of the test run.

* Scripts/webkitpy/port/driver.py:
(Driver._start): Actually store the path to the user's cache directory in self._driver_user_cache_directory
so that we can delete this directory on cessation of the test run.
* Scripts/webkitpy/port/mac.py:
(MacPort):
(MacPort._path_to_user_cache_directory): Unset the environment variable DIRHELPER_USER_DIR_SUFFIX (if set),
query the OS for the path to the user's cache directory and concatenate this path with the
specified suffix.

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

3 years ago[iOS] Both WebPage's volatility timer and WebProcess's processSuspensionCleanupTimer...
cdumez@apple.com [Thu, 31 Mar 2016 23:33:56 +0000 (23:33 +0000)]
[iOS] Both WebPage's volatility timer and WebProcess's processSuspensionCleanupTimer are trying to make surfaces volatile with very short interval
https://bugs.webkit.org/show_bug.cgi?id=156065
<rdar://problem/25452004>

Reviewed by Simon Fraser.

Source/WebCore:

Export a symbol so it can be used from WebKit2.

* page/Page.h:

Source/WebKit2:

Upon process suspension, both the WebPage's volatility timer and
WebProcess' processSuspensionCleanupTimer are trying to make surfaces
volatile with a very short interval. This is overly aggressive given
that this operation normally succeeds very quickly or does not (due
to underlying bugs).

This patch does the following:
- Drop the WebProcess' processSuspensionCleanupTimer and have the
  WebProcess drive the WebPages' volatility timer instead.
- Update the WebPages' volatility timer to do exponential back off.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::layerVolatilityTimerFired):
(WebKit::WebPage::markLayersVolatileImmediatelyIfPossible):
(WebKit::WebPage::markLayersVolatile):
(WebKit::WebPage::cancelMarkLayersVolatile):
(WebKit::WebPage::isAlwaysOnLoggingAllowed):
(WebKit::WebPage::setLayerTreeStateIsFrozen): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::markLayersVolatile):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::applicationDidEnterBackground):
(WebKit::WebPage::applicationWillEnterForeground):
(WebKit::WebPage::applicationDidBecomeActive): Deleted.
(WebKit::adjustVelocityDataForBoundedScale): Deleted.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::actualPrepareToSuspend):
(WebKit::WebProcess::processWillSuspendImminently):
(WebKit::WebProcess::prepareToSuspend):
(WebKit::WebProcess::cancelPrepareToSuspend):
(WebKit::WebProcess::markAllLayersVolatile):
(WebKit::WebProcess::cancelMarkAllLayersVolatile):
(WebKit::WebProcess::setAllLayerTreeStatesFrozen):
(WebKit::WebProcess::processDidResume):
(WebKit::WebProcess::WebProcess): Deleted.
* WebProcess/WebProcess.h:

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

3 years ago[ES6] Disallow var assignments in for-in loops
sbarati@apple.com [Thu, 31 Mar 2016 23:07:39 +0000 (23:07 +0000)]
[ES6] Disallow var assignments in for-in loops
https://bugs.webkit.org/show_bug.cgi?id=155451

Reviewed by Mark Lam.

Source/JavaScriptCore:

We're doing this in its own patch instead of the patch for https://bugs.webkit.org/show_bug.cgi?id=155384
because last time we made this change it broke some websites. Lets try making
it again because it's what the ES6 mandates. If it still breaks things we will
roll it out.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseForStatement):

LayoutTests:

* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:

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

3 years agoparsing arrow function expressions slows down the parser by 8% lets recoup some loss
sbarati@apple.com [Thu, 31 Mar 2016 23:01:29 +0000 (23:01 +0000)]
parsing arrow function expressions slows down the parser by 8% lets recoup some loss
https://bugs.webkit.org/show_bug.cgi?id=155988

Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

We used to eagerly check if we're parsing an arrow function.
We did this inside parseAssignmentExpression(), and it was
very costly. The reason it was costly is that arrow functions
might start with an identifier. This means anytime we saw an
identifier we would have to do a lookahead, and then most likely
backtrack because more often than not, we wouldn't see "=>"
as the next token.

In this patch I implement a new approach. We just parse
the lhs of an assignment expression eagerly without doing any
lookahead. Retroactively, if we see that we might have started
with an arrow function, and we don't have a valid lhs or the
next token is a "=>", we try to parse as an arrow function.

Here are a few examples motivating why this is valid:

`x => x`
In this example:
- "x" is a valid arrow function starting point.
- "x" also happens to be a valid lhs
- because we see "=>" as the next token, we parse as an arrow function and succeed.

`(x) => x`
In this example:
- "(" is a valid arrow function starting point.
- "(x)" also happens to be a valid lhs
- because we see "=>" as the next token, we parse as an arrow function and succeed.

`({x = 30}) => x;`
In this example:
- "(" is a valid arrow function starting point.
- "({x = 30})" is NOT a valid lhs. Because of this, we try to parse it as an arrow function and succeed.

There is one interesting implementation detail where we might
parse something that is both a valid LHS but happens
to actually be the arrow function parameters. The valid LHS
parsing might declare such variables as "uses" which would cause
weird capture analysis. This patch also introduces a mechanism
to backtrack on used variable analysis.

This is a 3.5%-4.5% octane code load speedup.

* parser/Lexer.h:
(JSC::Lexer::sawError):
(JSC::Lexer::setSawError):
(JSC::Lexer::getErrorMessage):
(JSC::Lexer::setErrorMessage):
(JSC::Lexer::sourceURL):
(JSC::Lexer::sourceMappingURL):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::isArrowFunctionParameters):
(JSC::Parser<LexerType>::parseAssignmentExpression):
(JSC::Parser<LexerType>::parsePrimaryExpression):
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::startSwitch):
(JSC::Scope::declareParameter):
(JSC::Scope::usedVariablesContains):
(JSC::Scope::useVariable):
(JSC::Scope::pushUsedVariableSet):
(JSC::Scope::currentUsedVariablesSize):
(JSC::Scope::revertToPreviousUsedVariables):
(JSC::Scope::setNeedsFullActivation):
(JSC::Scope::needsFullActivation):
(JSC::Scope::isArrowFunctionBoundary):
(JSC::Scope::setInnerArrowFunctionUsesEvalAndUseArgumentsIfNeeded):
(JSC::Scope::collectFreeVariables):
(JSC::Scope::fillParametersForSourceProviderCache):
(JSC::Scope::restoreFromSourceProviderCache):
(JSC::Scope::setIsModule):

LayoutTests:

* js/parser-syntax-check-expected.txt:
* js/script-tests/parser-syntax-check.js:
(catch):

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

3 years ago[Win] Skip INTL related tests.
peavo@outlook.com [Thu, 31 Mar 2016 22:54:48 +0000 (22:54 +0000)]
[Win] Skip INTL related tests.
https://bugs.webkit.org/show_bug.cgi?id=156074

Reviewed by Alex Christensen.

Temporarily skip failing INTL related tests, because AppleWin currently
does not have INTL enabled.

* js/script-tests/array-toLocaleString.js:
* js/script-tests/date-toLocaleString.js:
* js/script-tests/intl-collator.js:
* js/script-tests/intl-datetimeformat.js:
* js/script-tests/intl-numberformat.js:
* js/script-tests/intl.js:
* js/script-tests/number-toLocaleString.js:
* js/script-tests/string-toLocaleLowerCase.js:
* js/script-tests/string-toLocaleUpperCase.js:
* platform/win/TestExpectations:

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

3 years agoWeb Inspector: ScriptSyntaxTree doesn't handle RestElement AST nodes
commit-queue@webkit.org [Thu, 31 Mar 2016 22:50:33 +0000 (22:50 +0000)]
Web Inspector: ScriptSyntaxTree doesn't handle RestElement AST nodes
https://bugs.webkit.org/show_bug.cgi?id=156085

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-31
Reviewed by Saam Barati.

Source/WebInspectorUI:

* UserInterface/Models/ScriptSyntaxTree.js:
(WebInspector.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration.gatherIdentifiers):
(WebInspector.ScriptSyntaxTree.prototype._gatherIdentifiersInDeclaration):
When searching for identifiers in Function parameters, pass
through the RestElement to its argument.

(WebInspector.ScriptSyntaxTree.prototype._recurse):
(WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
Create a ScriptSyntaxTree RestElement node.
Also, every case in recurse visits the current
node, so simplify the code!

LayoutTests:

* inspector/model/parse-script-syntax-tree-expected.txt:
* inspector/model/parse-script-syntax-tree.html:
Add a test for a RestElement.

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

3 years agoREGRESSION (r195605): ASSERTION FAILED: !NoEventDispatchAssertion::isEventDispatchFor...
dbates@webkit.org [Thu, 31 Mar 2016 22:43:45 +0000 (22:43 +0000)]
REGRESSION (r195605): ASSERTION FAILED: !NoEventDispatchAssertion::isEventDispatchForbidden()
when pressing the back button on a page with a focused subframe
https://bugs.webkit.org/show_bug.cgi?id=156033
<rdar://problem/25446561>

Reviewed by Chris Dumez.

Source/WebCore:

Fixes an assertion failure when navigating back, by pressing the browser back button, to
the previous page from a page with a focused subframe.

Following r195605 (https://bugs.webkit.org/show_bug.cgi?id=153449), the responsibility for
dispatching a DOM pagehide event moved from CachedFrame to PageCache and we now instantiate
a NoEventDispatchAssertion object to enforce the invariant that no additional DOM events are
dispatched as part of adding a page to the page cache. When adding a page with a focused
subframe to the page cache we focus its main frame, which implicitly defocuses the subframe
and dispatches a DOM blur event at it. Therefore an assertion failure occurs when dispatching
this DOM blur event (because a NoEventDispatchAssertion object was allocated on the stack).

Test: fast/history/back-from-page-with-focused-iframe.html

* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame): Move logic to focus the main frame from here...
* history/PageCache.cpp:
(WebCore::PageCache::addIfCacheable): to here such that any DOM blur and focus events
are dispatched before instantiate the NoEventDispatchAssertion object and enter the page
cache.

LayoutTests:

Add a test to ensure that when navigating back from a page with a focused <iframe> f, a DOM
blur event is dispatched to f, a DOM focus event is dispatched at the main frame and that
an assertion failure does not occur (only applicable in a debug build).

* fast/history/back-from-page-with-focused-iframe-expected.txt: Added.
* fast/history/back-from-page-with-focused-iframe.html: Added.

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

3 years agoSimplify API of Test model by removing Test.setParentTest
rniwa@webkit.org [Thu, 31 Mar 2016 22:42:15 +0000 (22:42 +0000)]
Simplify API of Test model by removing Test.setParentTest
https://bugs.webkit.org/show_bug.cgi?id=156055

Reviewed by Joseph Pecoraro.

Removed Test.setParentTest. Keep track of the child-parent relationship using the static map instead.

Now each test only stores parent's id and uses the ID static map in Test.parentTest().

* public/v3/models/manifest.js:
(Manifest._didFetchManifest.buildObjectsFromIdMap): Removed the code to create the map of child-parent
relationship and call setParentTest.
* public/v3/models/test.js:
(Test): Updated a static map by the name of "childTestMap" to store itself. We should probably sort
child tests using some fixed criteria in the future instead of relying on the creation order but
preserve the old code's ordering for now.
(Test.prototype.parentTest): Look up the static map by the parent test's id.
(Test.prototype.onlyContainsSingleMetric):
(Test.prototype.setParentTest): Deleted.
(Test.prototype.childTests): Look up the child test map.

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

3 years agotool tip/alt. text appears when mouse is no longer hovering over link
dbates@webkit.org [Thu, 31 Mar 2016 22:38:20 +0000 (22:38 +0000)]
tool tip/alt. text appears when mouse is no longer hovering over link
https://bugs.webkit.org/show_bug.cgi?id=24427
<rdar://problem/8045235>

Reviewed by Antonio Gomes.

Although the bug no longer reproduces, add a manual test that can be used to determine if a
tooltip for a hyperlink is shown when the cursor no longer hovers over it.

* ManualTests/tooltip-when-mouse-not-directly-over-hyperlink.html: Added.

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

3 years agoFix download links for desktops with small resolutions
jond@apple.com [Thu, 31 Mar 2016 21:55:47 +0000 (21:55 +0000)]
Fix download links for desktops with small resolutions
https://bugs.webkit.org/show_bug.cgi?id=156081

Reviewed by Timothy Hatcher.

* wp-content/themes/webkit/downloads.php:

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

3 years agoFails to build in Linux / PowerPC due to different ucontext_t definition
utatane.tea@gmail.com [Thu, 31 Mar 2016 21:52:04 +0000 (21:52 +0000)]
Fails to build in Linux / PowerPC due to different ucontext_t definition
https://bugs.webkit.org/show_bug.cgi?id=156015

Reviewed by Michael Catanzaro.

PPC does not have mcontext_t in ucontext_t::uc_mcontext.
So we take the special way to retrieve mcontext_t in PPC.

* heap/MachineStackMarker.cpp:
(pthreadSignalHandlerSuspendResume):

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

3 years agoWeb Automation: the interaction queue in WebAutomationSession::performKeyInteractions...
bburg@apple.com [Thu, 31 Mar 2016 21:51:40 +0000 (21:51 +0000)]
Web Automation: the interaction queue in WebAutomationSession::performKeyInteractions doesn't work
https://bugs.webkit.org/show_bug.cgi?id=156083

Reviewed by Timothy Hatcher.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::performKeyboardInteractions):
Use Vector::reserveCapacity instead of the size constructor since we use append.
Empty the interaction queue outside of loops so all interactions are performed once.

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

3 years agoREGRESSION (r191180): Safari does not send Referer Header to iframe src in certain...
cdumez@apple.com [Thu, 31 Mar 2016 21:12:55 +0000 (21:12 +0000)]
REGRESSION (r191180): Safari does not send Referer Header to iframe src in certain situations
https://bugs.webkit.org/show_bug.cgi?id=155754
<rdar://problem/25296445>

Unreviewed, roll out r191180 as it breaks sites and needs to be reworked.

Source/WebCore:

* html/parser/HTMLPreloadScanner.cpp:
(WebCore::TokenPreloadScanner::tagIdFor): Deleted.
(WebCore::TokenPreloadScanner::initiatorFor): Deleted.
(WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Deleted.
(WebCore::TokenPreloadScanner::StartTagScanner::resourceType): Deleted.
* html/parser/HTMLPreloadScanner.h:

LayoutTests:

* fast/preloader/frame-src-expected.txt: Removed.
* fast/preloader/frame-src.html: Removed.
* fast/preloader/resources/testFrame.html: Removed.
* http/tests/loading/preload-no-store-frame-src-expected: Removed.
* http/tests/loading/preload-no-store-frame-src.html: Removed.

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

3 years agoWeb Automation: Add support for script timeouts to the evaluateJavaScriptFunction...
timothy@apple.com [Thu, 31 Mar 2016 21:03:52 +0000 (21:03 +0000)]
Web Automation: Add support for script timeouts to the evaluateJavaScriptFunction command

https://bugs.webkit.org/show_bug.cgi?id=156052
rdar://problem/25457151

Address additional review comments.

* WebProcess/Automation/WebAutomationSessionProxy.js:
(AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Add semicolons and remove
and clearTimeout that wasn't needed.

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

3 years agoWeb Automation: Navigation commands should not return until page loads or fails
timothy@apple.com [Thu, 31 Mar 2016 20:52:44 +0000 (20:52 +0000)]
Web Automation: Navigation commands should not return until page loads or fails

https://bugs.webkit.org/show_bug.cgi?id=156063
rdar://problem/25464373

Reviewed by Brian Burg.

* UIProcess/Automation/Automation.json: Make navigation commands async.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::navigateBrowsingContext): Save callback and timeout previous.
(WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto.
(WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto.
(WebKit::WebAutomationSession::reloadBrowsingContext): Ditto.
(WebKit::WebAutomationSession::navigationOccuredForPage): Added. Fire callback for page.
* UIProcess/Automation/WebAutomationSession.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFinishLoadForFrame): Call WebAutomationSession::navigationOccuredForPage.
(WebKit::WebPageProxy::didFailLoadForFrame): Ditto.
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame): Ditto.

* UIProcess/WebProcessPool.h: Added automationSession() getter.

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

3 years agoWeb Automation: Add support for script timeouts to the evaluateJavaScriptFunction...
timothy@apple.com [Thu, 31 Mar 2016 20:52:38 +0000 (20:52 +0000)]
Web Automation: Add support for script timeouts to the evaluateJavaScriptFunction command

https://bugs.webkit.org/show_bug.cgi?id=156052
rdar://problem/25457151

Reviewed by Brian Burg.

* UIProcess/Automation/Automation.json: Added callbackTimeout to evaluateJavaScriptFunction.
Also made expectsImplicitCallbackArgument optional, since it is not required. Added JavaScriptTimeout error.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::evaluateJavaScriptFunction): Added callbackTimeout.
* UIProcess/Automation/WebAutomationSession.h:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::evaluateJavaScriptCallback): Send JavaScriptTimeout error if the timeout fired.
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Added callbackTimeout.
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.js:
(AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Set a timeout to fire if the
callback is not called, then return an error.
* WebProcess/Automation/WebAutomationSessionProxy.messages.in:
(EvaluateJavaScriptFunction): Added callbackTimeout parameter.

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

3 years agoRebaseline media control tests when new media control appearances are finalized
eric.carlson@apple.com [Thu, 31 Mar 2016 20:43:41 +0000 (20:43 +0000)]
Rebaseline media control tests when new media control appearances are finalized
https://bugs.webkit.org/show_bug.cgi?id=142142

Reviewed by Brent Fulgham.

* fullscreen/video-controls-override.html: Test height as an integer.
* http/tests/media/hls/video-controls-live-stream.html: Start playback explicitly instead of
  using autoplay, and pause playback before dumping controls state to make the test results
  more deterministic.
* media/audio-delete-while-slider-thumb-clicked.html: Make the <audio> element wide enough
  that it will always have a timeline scrubber. Trigger test on 'canplaythrough' instead of
  autoplay + 'playing' to simplify the test slightly.
* media/nodesFromRect-shadowContent.html: Test for controls panel-background instead
  timeline-container because of changes to the controls structure.
* platform/mac-mavericks/media/audio-controls-rendering-expected.png: Removed.
* platform/mac-mavericks/media/audio-controls-rendering-expected.txt: Removed.
* platform/mac-mavericks/media/video-volume-slider-expected.txt: Removed.
* platform/mac-wk1/media/controls-styling-expected.txt: Removed.
* platform/mac-yosemite/http/tests/media/hls/video-controls-live-stream-expected.txt: Added
* platform/mac-yosemite/media: Added.
* platform/mac-yosemite/media/controls-styling-expected.txt: Added.
* platform/mac/TestExpectations: Unskip some tests.
* platform/mac/accessibility/media-element-expected.txt: Update results.
* platform/mac/fast/layers/video-layer-expected.png: Ditto.
* platform/mac/fast/layers/video-layer-expected.txt: Ditto.
* platform/mac/fullscreen/video-controls-override-expected.txt: Ditto.
* platform/mac/http/tests/media/hls/video-controls-live-stream-expected.txt: Ditto.
* platform/mac/media/audio-controls-rendering-expected.png: Ditto.
* platform/mac/media/audio-controls-rendering-expected.txt: Ditto.
* platform/mac/media/controls-after-reload-expected.png: Ditto.
* platform/mac/media/controls-after-reload-expected.txt: Ditto.
* platform/mac/media/controls-strict-expected.png: Ditto.
* platform/mac/media/controls-strict-expected.txt: Ditto.
* platform/mac/media/controls-styling-expected.png: Ditto.
* platform/mac/media/controls-styling-expected.txt: Ditto.
* platform/mac/media/controls-without-preload-expected.png: Ditto.
* platform/mac/media/controls-without-preload-expected.txt: Ditto.
* platform/mac/media/media-controls-clone-expected.png: Ditto.
* platform/mac/media/media-controls-clone-expected.txt: Ditto.
* platform/mac/media/media-document-audio-repaint-expected.png: Ditto.
* platform/mac/media/video-controls-rendering-expected.png: Ditto.
* platform/mac/media/video-controls-rendering-expected.txt: Ditto.
* platform/mac/media/video-display-toggle-expected.png: Ditto.
* platform/mac/media/video-display-toggle-expected.txt: Ditto.
* platform/mac/media/video-empty-source-expected.png: Ditto.
* platform/mac/media/video-empty-source-expected.txt: Ditto.
* platform/mac/media/video-no-audio-expected.png: Ditto.
* platform/mac/media/video-no-audio-expected.txt: Ditto.
* platform/mac/media/video-volume-slider-expected.png: Ditto.
* platform/mac/media/video-volume-slider-expected.txt: Ditto.
* platform/mac/media/video-zoom-controls-expected.png: Ditto.
* platform/mac/media/video-zoom-controls-expected.txt: Ditto.

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

3 years agoWebKit should set Original URL of a download request correctly
jiewen_tan@apple.com [Thu, 31 Mar 2016 20:39:24 +0000 (20:39 +0000)]
WebKit should set Original URL of a download request correctly
https://bugs.webkit.org/show_bug.cgi?id=155914
<rdar://problem/10473811>

Reviewed by Anders Carlsson.

Source/WebCore:

Added API tests.

Replace the old logic for identifying the Original URL of a download request
with a new method based on the logic from Document::firstPartyForCookies, which
does a much better job determining the URL a user actually visited.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setOriginalURLForDownloadRequest):
(WebCore::originatingURLFromBackForwardList): Deleted.

Source/WebKit2:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::convertTaskToDownload):
(WebKit::NetworkLoad::didReceiveResponseNetworkSession):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::findPendingDownloadLocation):
* NetworkProcess/NetworkProcess.h:
Add logic to set the original URL of a download request when a main resource load
is converted to a download.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::download):
* UIProcess/WebProcessPool.h:
Add logic to set the original URL of a download request during a context menu:
Download Linked File action.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/Download.mm:
(-[DownloadRequestOriginalURLDelegate initWithExpectOriginalURL:]):
(-[DownloadRequestOriginalURLDelegate _downloadDidStart:]):
(-[DownloadRequestOriginalURLNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(TEST):
* TestWebKitAPI/Tests/WebKit2Cocoa/DownloadRequestOriginalURL.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/DownloadRequestOriginalURL2.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/DownloadRequestOriginalURLFrame.html: Added.

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

3 years agoMoving a few skipped tests from ios-simulator-wk2 to ios-simulator TestExpectations...
ryanhaddad@apple.com [Thu, 31 Mar 2016 19:36:20 +0000 (19:36 +0000)]
Moving a few skipped tests from ios-simulator-wk2 to ios-simulator TestExpectations file.

Unreviewed test gardening.

These particular tests time out due to lack of touch event support, which applies
to both wk1 and wk2 ios-simulator testers.

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

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

3 years agoeventMayStartDrag() does not check for shiftKey or isOverLink
tonikitoo@webkit.org [Thu, 31 Mar 2016 19:25:45 +0000 (19:25 +0000)]
eventMayStartDrag() does not check for shiftKey or isOverLink
https://bugs.webkit.org/show_bug.cgi?id=155746

Reviewed by Darin Adler.

There is currently a mismatch between the logic that checks whether
an event can start a dragging action in EventHandler::handleMousePressEvent
and in EventHandler::eventMayStartDrag
Basically the former checks for event's count, type, button, target and modifier.
The later, on the other hand, only checks for event's button and count.

In order to sync them up again, as per the comment in the code,
patch factors out the logic in ::handleMousePressEvent into a helper function,
and ultimately reuses it in ::eventMayStartDrag.

No new tests for two reasons:

1) ::handleMousePressEvent will not have any behavior change. Code is factored out
into a helper.

2) The callees of ::eventMayStartDrag are currently WebPage::shouldDelayWindowOrderingEvent
and ::acceptsFirstMouse. Based on my understanding of [1], these methods
are called when there is a (say) browser window in background with some text selected,
and user starts to drag the selected content. Dragging happens without bringing the window
foreground. This is called "non-activating click".
Such behavior will not change with the patch.

[1] https://bugs.webkit.org/show_bug.cgi?id=55053 - "Implement non-activating clicks to allow dragging out of a background window"

* page/EventHandler.cpp:
(WebCore::isSingleMouseDownOnLinkOrImage):
(WebCore::canMouseEventStartDragInternal):
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::documentPointForWindowPoint): Moved up in the file to be used elsewhere.
(WebCore::EventHandler::eventMayStartDrag):

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

3 years agoMarking inspector/console/heapSnapshot.html as a flaky timeout on Mac
ryanhaddad@apple.com [Thu, 31 Mar 2016 19:12:29 +0000 (19:12 +0000)]
Marking inspector/console/heapSnapshot.html as a flaky timeout on Mac
https://bugs.webkit.org/show_bug.cgi?id=156078

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years agoWeb Automation: Add Automation.screenshot
joepeck@webkit.org [Thu, 31 Mar 2016 19:03:37 +0000 (19:03 +0000)]
Web Automation: Add Automation.screenshot
https://bugs.webkit.org/show_bug.cgi?id=156073
<rdar://problem/25468646>

Reviewed by Timothy Hatcher and Brian Burg.

* UIProcess/Automation/Automation.json:
Add Automation.screenshot which returns base64 encoded PNG data.

* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.messages.in:
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::screenshot):
(WebKit::WebAutomationSession::didTakeScreenshot):
(WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
Send a message to the WebPage to get an Image of the page
and handle the response.

* UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
Convert the bitmap data to a base64 encoded PNG.

* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.messages.in:
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::evaluateJavaScriptCallback):
(WebKit::WebAutomationSessionProxy::didClearWindowObjectForFrame):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithOrdinal):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithNodeHandle):
(WebKit::WebAutomationSessionProxy::resolveChildFrameWithName):
(WebKit::WebAutomationSessionProxy::resolveParentFrame):
(WebKit::WebAutomationSessionProxy::computeElementLayout):
Use null string where possible for efficiency.

(WebKit::WebAutomationSessionProxy::takeScreenshot):
Take an image of the entire page and pass back to the UIProcess.

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

3 years agoWeb Automation: Handle undefined when calling a function that has no result
timothy@apple.com [Thu, 31 Mar 2016 18:56:10 +0000 (18:56 +0000)]
Web Automation: Handle undefined when calling a function that has no result

https://bugs.webkit.org/show_bug.cgi?id=156075
rdar://problem/25468907

Reviewed by Brian Burg.

* WebProcess/Automation/WebAutomationSessionProxy.js:
(let.AutomationSessionProxy.prototype._jsonParse): Return undefined for empty string.
(let.AutomationSessionProxy.prototype._jsonStringify): Always return a string.

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

3 years ago[JSC][x86] Add the indexed forms of floating point addition and multiplication
benjamin@webkit.org [Thu, 31 Mar 2016 18:54:36 +0000 (18:54 +0000)]
[JSC][x86] Add the indexed forms of floating point addition and multiplication
https://bugs.webkit.org/show_bug.cgi?id=156058

Reviewed by Geoffrey Garen.

B3 supports lowering [base, index] addresses into
arbitrary instructions but we were not using that feature.

This patch adds the missing support for the lowering
of Add and Mul.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::addDouble):
(JSC::MacroAssemblerX86Common::addFloat):
(JSC::MacroAssemblerX86Common::mulDouble):
(JSC::MacroAssemblerX86Common::mulFloat):
* assembler/X86Assembler.h:
(JSC::X86Assembler::addsd_mr):
(JSC::X86Assembler::vaddsd_mr):
(JSC::X86Assembler::addss_mr):
(JSC::X86Assembler::vaddss_mr):
(JSC::X86Assembler::mulsd_mr):
(JSC::X86Assembler::vmulsd_mr):
(JSC::X86Assembler::mulss_mr):
(JSC::X86Assembler::vmulss_mr):
(JSC::X86Assembler::X86InstructionFormatter::SingleInstructionBufferWriter::memoryModRM):
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::appendBinOp):
Unlike the Addr form, we never need to transform a Tmp
into an Index for spilling.

Instead of duplicating all the code in MacroAssembler, I can
just have the lowering phase try using addresses for the first
argument when possible.

* b3/air/AirOpcode.opcodes:
* b3/air/testair.cpp:
(JSC::B3::Air::testX86VMULSDBaseNeedsRex):
(JSC::B3::Air::testX86VMULSDIndexNeedsRex):
(JSC::B3::Air::testX86VMULSDBaseIndexNeedRex):
(JSC::B3::Air::run):

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

3 years agoSelectionController::positionForPlatform should ask EditingBehavior for platform...
tonikitoo@webkit.org [Thu, 31 Mar 2016 18:50:55 +0000 (18:50 +0000)]
SelectionController::positionForPlatform should ask EditingBehavior for platform specific behavior
https://bugs.webkit.org/show_bug.cgi?id=41976

Reviewed by Darin Adler.

SSIA.

No new tests needed.

* editing/EditingBehavior.h:
(WebCore::EditingBehavior::shouldAlwaysExtendSelectionFromExtentEndpoint):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::positionForPlatform):

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

3 years agoDFG JIT bug in typeof constant folding where the input to typeof is an object or...
sbarati@apple.com [Thu, 31 Mar 2016 18:28:48 +0000 (18:28 +0000)]
DFG JIT bug in typeof constant folding where the input to typeof is an object or function
https://bugs.webkit.org/show_bug.cgi?id=156034
<rdar://problem/25446785>

Reviewed by Ryosuke Niwa.

AI would constant fold TypeOf to the string "object" if it saw that
its input type didn't expand past the types contained in the set
"SpecObject - SpecObjectOther". But, SpecObject contains SpecFunction.
And typeof of a function should return "function". This patch fixes
this bug by making sure we constant fold to object iff the type
doesn't expand past the set "SpecObject - SpecObjectOther - SpecFunction".

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* tests/stress/typeof-dfg-function-or-object.js: Added.
(assert):
(foo.else.o):
(foo):

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

3 years agomediaShouldUsePersistentCache() is redundant. Use Page::usesEphemeralSession() instead.
commit-queue@webkit.org [Thu, 31 Mar 2016 18:24:24 +0000 (18:24 +0000)]
mediaShouldUsePersistentCache() is redundant. Use Page::usesEphemeralSession() instead.
https://bugs.webkit.org/show_bug.cgi?id=155924

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-03-31
Reviewed by Simon Fraser.

Source/WebCore:

No new tests because there is no behavior change.

Remove machinery for mediaShouldUsePersistentCache() adopt usesEphemeralSession().

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerShouldUsePersistentCache):
* page/ChromeClient.h: remove mediaShouldUsePersistentCache()

Source/WebKit/mac:

Remove mediaShouldUsePersistentCache machinery as it is redundant.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::mediaShouldUsePersistentCache): Deleted.

Source/WebKit2:

Remove machinery for mediaShouldUsePersistentCache as it is redundant.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode): Deleted.
(WebKit::WebPageCreationParameters::decode): Deleted.
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::mediaShouldUsePersistentCache): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_mediaShouldUsePersistentCache): Deleted.
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::mediaShouldUsePersistentCache): Deleted.

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

3 years agoAdd the new "toggle enhanced fullscreen" context menu item to the video context menu...
adachan@apple.com [Thu, 31 Mar 2016 18:23:29 +0000 (18:23 +0000)]
Add the new "toggle enhanced fullscreen" context menu item to the video context menu on supporting platforms.
https://bugs.webkit.org/show_bug.cgi?id=156031

Reviewed by Eric Carlson.

Source/WebCore:

* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
Handle the selection of the context menu item.
(WebCore::ContextMenuController::populate):
Add this menu item on Mac.
(WebCore::ContextMenuController::checkOrEnableIfNeeded):
Set the menu item's title depending on the current enhanced fullscreen state
and enable this menu item if supported.

* platform/ContextMenuItem.h:
Define the new tag for this menu item.

* platform/LocalizedStrings.cpp:
(WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen):
(WebCore::contextMenuItemTagExitVideoEnhancedFullscreen):
* platform/LocalizedStrings.h:

* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::mediaSupportsEnhancedFullscreen):
(WebCore::HitTestResult::mediaIsInEnhancedFullscreen):
(WebCore::HitTestResult::toggleEnhancedFullscreenForVideo):
* rendering/HitTestResult.h:

Source/WebKit/mac:

* WebView/WebHTMLView.mm:
(toAction):
(toTag):
* WebView/WebUIDelegatePrivate.h:

Source/WebKit2:

* Shared/API/c/WKContextMenuItemTypes.h:
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
(WebKit::toImpl):

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

3 years agoThree js/regress/string-repeat-* are flaky timeouts on Mac
utatane.tea@gmail.com [Thu, 31 Mar 2016 18:16:37 +0000 (18:16 +0000)]
Three js/regress/string-repeat-* are flaky timeouts on Mac
https://bugs.webkit.org/show_bug.cgi?id=156062

Reviewed by Saam Barati.

Reduce the test cases to avoid timeouts.

* js/regress/script-tests/string-repeat-resolving-no-inline.js:
* js/regress/script-tests/string-repeat-resolving.js:
* js/regress/script-tests/string-repeat-small-resolving.js:
* platform/mac/TestExpectations:

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

3 years agoAdd a -mismatch test case for r198785.
zalan@apple.com [Thu, 31 Mar 2016 16:48:39 +0000 (16:48 +0000)]
Add a -mismatch test case for r198785.
see webkit.org/b/155973

Unreviewed.

* plugins/missing-plugin-placeholder-expected-mismatch.html: Added.
* plugins/missing-plugin-placeholder.html: Added.

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

3 years agoRemoved leftovers of ENABLE(INSPECTOR) and ENABLE(VIEWPORT).
commit-queue@webkit.org [Thu, 31 Mar 2016 16:45:21 +0000 (16:45 +0000)]
Removed leftovers of ENABLE(INSPECTOR) and ENABLE(VIEWPORT).
https://bugs.webkit.org/show_bug.cgi?id=156064

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-03-31
Reviewed by Csaba Osztrogon√°c.

This ifdef guards were removed in r178820 and r147714, respectively.

* wtf/FeatureDefines.h:

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

3 years agoUnreviewed build fix after r198893.
bfulgham@apple.com [Thu, 31 Mar 2016 16:39:32 +0000 (16:39 +0000)]
Unreviewed build fix after r198893.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::findPendingDownloadLocation): Pass
new argument to download method.

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

3 years agoAX: aria-hidden=false causes video fallback content to be exposed to AX API
n_wang@apple.com [Thu, 31 Mar 2016 16:17:17 +0000 (16:17 +0000)]
AX: aria-hidden=false causes video fallback content to be exposed to AX API
https://bugs.webkit.org/show_bug.cgi?id=149278

Reviewed by Chris Fleizach.

Source/WebCore:

The comment says when aria-hidden="false" and object is not rendered, we should
check each parent's aria-hidden status until we encounter a rendered object. So
added a check for the rendered parent in order to break out of the loop earlier.

Test case covered in modified accessibility/aria-hidden-negates-no-visibility.html

* accessibility/AXObjectCache.cpp:
(WebCore::isNodeAriaVisible):

LayoutTests:

* accessibility/aria-hidden-negates-no-visibility-expected.txt:
* accessibility/aria-hidden-negates-no-visibility.html:

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

3 years agoGardening: Build and logic fix after r198873.
mark.lam@apple.com [Thu, 31 Mar 2016 16:12:26 +0000 (16:12 +0000)]
Gardening: Build and logic fix after r198873.
https://bugs.webkit.org/show_bug.cgi?id=156043

Not reviewed.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::addFloat):
- 2 args were meant to be ordered differently in order to call the other addFloat.
  Instead, there was an infinite recursion bug.  This is now fixed.

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

3 years ago[WK2] Support download attribute feature
bfulgham@apple.com [Thu, 31 Mar 2016 15:35:41 +0000 (15:35 +0000)]
[WK2] Support download attribute feature
https://bugs.webkit.org/show_bug.cgi?id=102914
<rdar://problem/13177492>

Reviewed by Darin Adler.

Source/WebCore:

Tested by imported/w3c/web-platform-tests/html/dom/interfaces.html
          imported/w3c/web-platform-tests/html/dom/reflection-text.html

A first draft implementation of this feature.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick): If the anchor has the 'download'
attribute, pass along the information to the rest of the load system.
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::FrameLoadRequest): Create new overload that
accepts a download attribute flag and a suggested filename.
(WebCore::FrameLoadRequest::hasDownloadAttribute): Added.
(WebCore::FrameLoadRequest::suggestedFilename): Added.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected): Expand to accept the download attribute
flag and suggested filename.
(WebCore::FrameLoader::loadURL): Populate the NavigationAction with the new
download attribute flag and suggested filename.
(WebCore::FrameLoader::loadPostRequest): Ditto.
* loader/FrameLoader.h:
* loader/FrameLoaderTypes.h: Add new 'HasDownloadAttribute' enum.
* loader/NavigationAction.cpp:
(WebCore::navigationType):
(WebCore::NavigationAction::NavigationAction): Update to accept new download
attribute flag and suggested filename.
* loader/NavigationAction.h:
(WebCore::NavigationAction::hasDownloadAttribute): Added.
(WebCore::NavigationAction::suggestedFilename): Added.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy): Pass more information to
'continueAfterNavigationPolicy'
(WebCore::PolicyChecker::continueAfterNavigationPolicy): Accept suggested
filename
* loader/PolicyChecker.h:

Source/WebKit2:

A first draft implementation of this feature.

* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::Download): Update to accept default filename.
(WebKit::Download::didStart): Send default filename in message.
* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::startDownload): Expect a default filename argument.
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::startDownload): Expect a default
filename argument.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in: Update messages to
expect a default filename argument.
* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode): Handle the download attribute flag and
the default filename.
(WebKit::NavigationActionData::decode): Ditto.
* Shared/NavigationActionData.h:
* UIProcess/API/APINavigationAction.h:
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::didStart): Expect a default filename argument.
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilename): Use the suggested
filename if the client delegate does not override it.
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxy.messages.in: Include a default filename value.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision): If the feature is enabled, and
the load was started with a download attribute, convert a "PolicyUse" decision
to "PolicyDownload".
(WebKit::WebPageProxy::decidePolicyForNavigationAction): Remember if the load
is happening due to a 'download' attribute link.
* UIProcess/WebPageProxy.h:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createWindow): Populate the navigationActionData object
with any download attribute and suggested filename.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Populate the
navigationActionData object with any download attribute and suggested filename.
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
(WebKit::WebFrameLoaderClient::startDownload): Expect a suggested filename argument.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::startDownload): Expect a suggested filename argument.
* WebProcess/WebPage/WebFrame.h:

Source/WTF:

* wtf/FeatureDefines.h: Turn the ENABLE_DOWNLOAD_ATTRIBUTE flag
on to see what happens.

LayoutTests:

* imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt: Update for
<a download>.
* imported/w3c/web-platform-tests/html/dom/reflection-text-expected.txt: Ditto.
* js/dom/dom-static-property-for-in-iteration-expected.txt: Ditto.
* platform/ios-simulator/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt: Ditto.

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

3 years agoMarking three js/regress/string-repeat-* tests as flaky timeouts on Mac
ryanhaddad@apple.com [Thu, 31 Mar 2016 14:57:47 +0000 (14:57 +0000)]
Marking three js/regress/string-repeat-* tests as flaky timeouts on Mac
https://bugs.webkit.org/show_bug.cgi?id=156062

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

3 years ago[Fetch API] Add basic loading of resources for Workers
youenn.fablet@crf.canon.fr [Thu, 31 Mar 2016 11:05:11 +0000 (11:05 +0000)]
[Fetch API] Add basic loading of resources for Workers
https://bugs.webkit.org/show_bug.cgi?id=155886

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Updating test expectations as new tests are passing.

* web-platform-tests/fetch/api/basic/accept-header-worker-expected.txt:
* web-platform-tests/fetch/api/basic/integrity-worker-expected.txt:
* web-platform-tests/fetch/api/basic/mode-no-cors-worker-expected.txt:
* web-platform-tests/fetch/api/basic/mode-same-origin-worker-expected.txt:
* web-platform-tests/fetch/api/basic/request-forbidden-headers-worker-expected.txt:
* web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-about-worker-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-blob-worker-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-data-worker-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-others-worker-expected.txt:
* web-platform-tests/fetch/api/basic/stream-response-worker-expected.txt:

Source/WebCore:

Adding impplementation to WorkerGlobalScopeFetch::fetch similarly to DOMWindowFetch::fetch.
Refactored code in FetchResponse to share code between the two.

Updated WorkerThreadableLoader to cope with an ASSERT.
The ASSERT ensures that a DocumentThreadableLoader::create returns non null.
In our case, it might happen as all cross origin fetch requests are denied at the moment.
This leads to calling didFail in DocumentThreadableLoader::create call and DocumentThreadableLoader::create to return null.
Updated the ASSERT to ensures that either the load is finished or DocumentThreadableLoader::create does not return null.

Covered by rebased tests.

* Modules/fetch/DOMWindowFetch.cpp:
(WebCore::DOMWindowFetch::fetch):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::startFetching):
(WebCore::FetchResponse::fetch):
* Modules/fetch/FetchResponse.h:
* Modules/fetch/WorkerGlobalScopeFetch.cpp:
(WebCore::WorkerGlobalScopeFetch::fetch):
* Modules/fetch/WorkerGlobalScopeFetch.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFailAccessControlCheck):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFailRedirectCheck):
* loader/WorkerThreadableLoader.h:

LayoutTests:

Soup and Mac HTTP backends differ on Content-Length header handling.

* platform/gtk/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt: Added.

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

3 years ago[Fetch API] Move isDisturbed handling to FetchBodyOwner
youenn.fablet@crf.canon.fr [Thu, 31 Mar 2016 10:31:28 +0000 (10:31 +0000)]
[Fetch API] Move isDisturbed handling to FetchBodyOwner
https://bugs.webkit.org/show_bug.cgi?id=155968

Reviewed by Darin Adler.

Moved isDisturbed handling in FetchBodyOwner.
This includes promise rejection in case of disturbed bodies.

No behavior change observable from user scripts.

* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::arrayBuffer):
(WebCore::FetchBody::blob):
(WebCore::FetchBody::json):
(WebCore::FetchBody::text):
(WebCore::FetchBody::extractFromBody):
(WebCore::FetchBody::consume):
(WebCore::FetchBody::consumeArrayBuffer):
(WebCore::FetchBody::processIfEmptyOrDisturbed): Deleted.
* Modules/fetch/FetchBody.h:
(WebCore::FetchBody::isEmpty): Deleted.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::arrayBuffer):
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::json):
(WebCore::FetchBodyOwner::text):
* Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::isDisturbed):
(WebCore::FetchBodyOwner::setDisturbed):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::create):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::clone):

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

3 years agoRemove forEach use from Fetch Headers builtin constructor
youenn.fablet@crf.canon.fr [Thu, 31 Mar 2016 08:31:25 +0000 (08:31 +0000)]
Remove forEach use from Fetch Headers builtin constructor
https://bugs.webkit.org/show_bug.cgi?id=155967

Reviewed by Joseph Pecoraro.

Source/WebCore:

Tests: fetch/shadowing-forEach.html
       streams/shadowing-Promise.html
       streams/shadowing-defineProperty.html

* Modules/fetch/FetchHeaders.idl: Adding fillFromJS private method.
* Modules/fetch/FetchHeaders.js:
(initializeFetchHeaders): Using fillFromJS private method. Using
instanceof test to check whether parameter is Headers or subclass of it.
* bindings/js/WebCoreBuiltinNames.h: Adding fillFromJS private symbol.

LayoutTests:

Renaming tests covering user scripts breaking some WebCore JS built ins.

* fetch/header-constructor-subclass-expected.txt: Added.
* fetch/header-constructor-subclass.html: Added.
* fetch/shadowing-forEach-expected.txt: Renamed from LayoutTests/streams/builtin-overrides-expected.txt.
* fetch/shadowing-forEach.html: Renamed from LayoutTests/fetch/builtin-overrides.html.
* streams/shadowing-Promise-expected.txt: Renamed from LayoutTests/streams/streams-promises-expected.txt.
* streams/shadowing-Promise.html: Renamed from LayoutTests/streams/streams-promises.html.
* streams/shadowing-defineProperty-expected.txt: Renamed from LayoutTests/fetch/builtin-overrides-expected.txt.
* streams/shadowing-defineProperty.html: Renamed from LayoutTests/streams/builtin-overrides.html.

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

3 years ago[Fetch API] Update web-platform-test fetch API tests
youenn.fablet@crf.canon.fr [Thu, 31 Mar 2016 08:26:29 +0000 (08:26 +0000)]
[Fetch API] Update web-platform-test fetch API tests
https://bugs.webkit.org/show_bug.cgi?id=155969

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Resyncing tests and updated expectations.
New test web-platform-tests/fetch/api/request/request-cache.html is timing out.

* web-platform-tests/fetch/api/basic/scheme-blob-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-blob-worker-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-blob.js:
(checkFetchResponse):
* web-platform-tests/fetch/api/headers/headers-basic.html:
* web-platform-tests/fetch/api/request/request-cache-expected.txt: Added.
* web-platform-tests/fetch/api/request/request-cache.html: Added.
* web-platform-tests/fetch/api/request/request-consume-empty.html:
* web-platform-tests/fetch/api/request/request-consume.html:
* web-platform-tests/fetch/api/request/request-idl-expected.txt:
* web-platform-tests/fetch/api/request/request-idl.html:
* web-platform-tests/fetch/api/request/request-init-002-expected.txt:
* web-platform-tests/fetch/api/request/request-init-002.html:
* web-platform-tests/fetch/api/request/resources/cache.py: Added.
(main):
* web-platform-tests/fetch/api/resources/utils.js:
(stringToArray):
(validateBufferFromString):
(validateStreamFromString):
* web-platform-tests/fetch/api/response/response-clone.html:
* web-platform-tests/fetch/api/response/response-consume-empty.html:
* web-platform-tests/fetch/api/response/response-consume.html:
* web-platform-tests/fetch/api/response/response-init-002.html:

LayoutTests:

* TestExpectations: Marking imported/w3c/web-platform-tests/fetch/api/request/request-cache.html as timing out.

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

3 years agoCMake build fix.
achristensen@apple.com [Thu, 31 Mar 2016 06:18:22 +0000 (06:18 +0000)]
CMake build fix.

* PlatformMac.cmake:

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

3 years agoFix Windows build.
achristensen@apple.com [Thu, 31 Mar 2016 06:08:14 +0000 (06:08 +0000)]
Fix Windows build.

* platform/text/LineEnding.cpp:
make the char's and uint8_t's compile.

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

3 years agoSpeculative Yosemite fix after r198872.
achristensen@apple.com [Thu, 31 Mar 2016 06:00:42 +0000 (06:00 +0000)]
Speculative Yosemite fix after r198872.

* UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::platformSimulateKeySequence):
Yosemite didn't like _Nullable.

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

3 years agoBuild fix.
achristensen@apple.com [Thu, 31 Mar 2016 05:49:05 +0000 (05:49 +0000)]
Build fix.

* platform/text/LineEnding.cpp:

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

3 years agoFix GTK and Windows builds after r198869.
achristensen@apple.com [Thu, 31 Mar 2016 05:44:58 +0000 (05:44 +0000)]
Fix GTK and Windows builds after r198869.

* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::blobIsOutOfDate):
(WebCore::addEncodedBlobItemToSoupMessageBody):
* platform/text/LineEnding.cpp:

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

3 years agoBuildRequest should have associated platform and test
rniwa@webkit.org [Thu, 31 Mar 2016 04:18:39 +0000 (04:18 +0000)]
BuildRequest should have associated platform and test
https://bugs.webkit.org/show_bug.cgi?id=156054

Reviewed by Joseph Pecoraro.

Added methods to retrieve the platform and the test associated with a build request with tests.

* public/v3/models/build-request.js:
(BuildRequest):
(BuildRequest.prototype.platform): Added.
(BuildRequest.prototype.test): Added.
* server-tests/api-build-requests-tests.js:
* server-tests/api-manifest.js: Fixed a typo. This tests /api/manifest, not /api/build-requests.
* unit-tests/buildbot-syncer-tests.js:
(.createSampleBuildRequest): Now takes Platform and Test objects to avoid hitting assertions in
BuildRequest's constructor.

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

3 years agoNeed to expose makeAllShadowRootsOpen in WKWebProcessPlugInScriptWorld.
commit-queue@webkit.org [Thu, 31 Mar 2016 03:56:25 +0000 (03:56 +0000)]
Need to expose makeAllShadowRootsOpen in WKWebProcessPlugInScriptWorld.
https://bugs.webkit.org/show_bug.cgi?id=156046

Add an SPI makeAllShadowRootsOpen method in WKWebProcessPlugInScriptWorld.

Patch by Yongjun Zhang <yongjun_zhang@apple.com> on 2016-03-30
Reviewed by Dan Bernstein.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInScriptWorld.mm:
(-[WKWebProcessPlugInScriptWorld makeAllShadowRootsOpen]):

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

3 years agoExtend animometer timeout for slow CPUs.
dewei_zhu@apple.com [Thu, 31 Mar 2016 02:13:04 +0000 (02:13 +0000)]
Extend animometer timeout for slow CPUs.
https://bugs.webkit.org/show_bug.cgi?id=156047

Reviewed by Ryosuke Niwa.

Extend animometer timeout to 30 minutes for slow device.

* Scripts/webkitpy/benchmark_runner/data/plans/animometer.plan:

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

3 years ago[iOS WK2] Avoid creating tiles that are too large for rendering
simon.fraser@apple.com [Thu, 31 Mar 2016 02:07:47 +0000 (02:07 +0000)]
[iOS WK2] Avoid creating tiles that are too large for rendering
https://bugs.webkit.org/show_bug.cgi?id=156050
rdar://problem/25424541

Reviewed by Darin Adler.

In the case of a WKWebView which is sized large enough to show an entire document
(for example, when enclosed inside a UIScrollView), we would create tiles that were
larger than CoreAnimation was willing to deal with.

* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::tileSize): Take the device scale, and the max IOSurface size
into account when computing the max tile size.
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::maximumSize): CoreAnimation imposes limits in addition to the size reported
by IOSurfaceGetPropertyMaximum(), namely an 8k cap, so mimic that here.
(IOSurface::ensurePlatformContext): Typo.

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

3 years agoFixed typo in fast/css/viewport-vmin-border test.
commit-queue@webkit.org [Thu, 31 Mar 2016 02:07:17 +0000 (02:07 +0000)]
Fixed typo in fast/css/viewport-vmin-border test.
https://bugs.webkit.org/show_bug.cgi?id=156028

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-03-30
Reviewed by Darin Adler.

* fast/css/viewport-vmin-border.html: Test should should say "vmin" instead of
"vmax".
* fast/css/viewport-vmin-border-expected.txt: Adjust expectation.

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

3 years ago[JSC][x86] Add the 3 operands forms of floating point addition and multiplication
benjamin@webkit.org [Thu, 31 Mar 2016 02:05:13 +0000 (02:05 +0000)]
[JSC][x86] Add the 3 operands forms of floating point addition and multiplication
https://bugs.webkit.org/show_bug.cgi?id=156043

Reviewed by Geoffrey Garen.

When they are available, VADD and VMUL are better options to lower
floating point addition and multiplication.

In the simple cases when one of the operands is aliased to the destination,
those forms have the same size or 1 byte shorter depending on the registers.

In the more advanced cases, we gain nice advantages with the new forms:
-We can get rid of the MoveDouble in front the instruction when we cannot
 alias.
-We can disable aliasing entirely in Air. That is useful for latency
 since computing coalescing is not exactly cheap.

* assembler/MacroAssemblerX86Common.cpp:
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::and32):
(JSC::MacroAssemblerX86Common::mul32):
(JSC::MacroAssemblerX86Common::or32):
(JSC::MacroAssemblerX86Common::xor32):
(JSC::MacroAssemblerX86Common::branchAdd32):
The change in B3LowerToAir exposed a bug in the fake 3 operands
forms of those instructions. If the address is equal to
the destination, we were nuking the address.

For example,
    Add32([%r11], %eax, %r11)
would generate:
    move %eax, %r11
    add32 [%r11], %r11
which crashes.

I updated codegen of those cases to support that case through
    load32 [%r11], %r11
    add32 %eax, %r11

The weird case were all arguments have the same registers
is handled too.

(JSC::MacroAssemblerX86Common::addDouble):
(JSC::MacroAssemblerX86Common::addFloat):
(JSC::MacroAssemblerX86Common::mulDouble):
(JSC::MacroAssemblerX86Common::mulFloat):
(JSC::MacroAssemblerX86Common::supportsFloatingPointRounding):
(JSC::MacroAssemblerX86Common::supportsAVX):
(JSC::MacroAssemblerX86Common::updateEax1EcxFlags):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::branchAdd64):
* assembler/X86Assembler.h:
(JSC::X86Assembler::vaddsd_rr):
(JSC::X86Assembler::vaddsd_mr):
(JSC::X86Assembler::vaddss_rr):
(JSC::X86Assembler::vaddss_mr):
(JSC::X86Assembler::vmulsd_rr):
(JSC::X86Assembler::vmulsd_mr):
(JSC::X86Assembler::vmulss_rr):
(JSC::X86Assembler::vmulss_mr):
(JSC::X86Assembler::X86InstructionFormatter::SingleInstructionBufferWriter::memoryModRM):
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::appendBinOp):
Add the 3 operand forms so that we lower Add and Mul
to the best form directly.

I will change how we lower the fake 3 operands instructions
but the codegen should end up the same in most cases.
The new codegen is the load32 + op above.

* b3/air/AirInstInlines.h:
(JSC::B3::Air::Inst::shouldTryAliasingDef):
* b3/air/testair.cpp:
(JSC::B3::Air::testX86VMULSD):
(JSC::B3::Air::testX86VMULSDDestRex):
(JSC::B3::Air::testX86VMULSDOp1DestRex):
(JSC::B3::Air::testX86VMULSDOp2DestRex):
(JSC::B3::Air::testX86VMULSDOpsDestRex):
(JSC::B3::Air::testX86VMULSDAddr):
(JSC::B3::Air::testX86VMULSDAddrOpRexAddr):
(JSC::B3::Air::testX86VMULSDDestRexAddr):
(JSC::B3::Air::testX86VMULSDRegOpDestRexAddr):
(JSC::B3::Air::testX86VMULSDAddrOpDestRexAddr):
Make sure we have some coverage for AVX encoding of instructions.

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

3 years agoWeb Automation: Add Automation.performKeyboardInteractions
joepeck@webkit.org [Thu, 31 Mar 2016 02:03:57 +0000 (02:03 +0000)]
Web Automation: Add Automation.performKeyboardInteractions
https://bugs.webkit.org/show_bug.cgi?id=155990
<rdar://problem/25426408>

Patch by Brian Burg <bburg@apple.com> on 2016-03-30
Reviewed by Timothy Hatcher.

Source/WebKit2:

Add a command that allows automation to simulate single
key strokes or insertion of an entire string, character
by character.

* UIProcess/Automation/Automation.json: Add new command.
Add a large enumeration of all virtual keys that exist
on a US 109-key keyboard layout. Add an interaction object.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::performKeyboardInteractions):
Added. This method validates the incoming key interactions
from the protocol and makes a list of simulated interactions
to perform. If everything validates, then delegate the key
interaction simulations to platform-specific methods.

(WebKit::WebAutomationSession::platformSimulateKeyStroke):
(WebKit::WebAutomationSession::platformSimulateKeySequence):
Add stubs for other platforms.

* UIProcess/Automation/WebAutomationSession.h: Add new
protocol command handler and platform simulation methods.

* UIProcess/Cocoa/WebAutomationSessionCocoa.mm:
(WebKit::WebAutomationSession::platformSimulateKeyStroke):
(WebKit::WebAutomationSession::platformSimulateKeySequence):
These methods implement keyboard simulation for AppKit, used
by the Mac port. In the keystroke case, figure out the AppKit
keyCode for the key as well as any key modifiers that should
be included with the key event. Keep track of sticky modifiers
and update the session state appropriately. In the key sequence
case, split the string into combining character sequences and
send a 'key up/down'. This is a weird way to send non-ASCII
text, so a better alternative should be explored in the future.

Source/WTF:

Add a missing NSEventType declaration.

* wtf/mac/AppKitCompatibilityDeclarations.h:

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

3 years ago[EFL][CMake] WebKit include path has been added to system include path
gyuyoung.kim@webkit.org [Thu, 31 Mar 2016 01:36:30 +0000 (01:36 +0000)]
[EFL][CMake] WebKit include path has been added to system include path
https://bugs.webkit.org/show_bug.cgi?id=156019

Reviewed by Darin Adler.

Fix wrong include path addition.

* PlatformEfl.cmake:

    Add ${WEBCORE_DIR}/platform/graphics/surfaces/egl to WebCore include directory path.

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

3 years agoAX: Update handling of SVG elements with presentational role
jdiggs@igalia.com [Thu, 31 Mar 2016 01:31:51 +0000 (01:31 +0000)]
AX: Update handling of SVG elements with presentational role
https://bugs.webkit.org/show_bug.cgi?id=156042

Reviewed by Chris Fleizach.

Source/WebCore:

Because the new expected behavior is to treat SVG elements with a
presentational role just like we treat other host language elements
with a presentational role, delete AccessibilitySVGElement's
determineAriaRoleAttribute().

No new test files. The expectations for w3c-svg-presentational-role.html
were updated because the presentational elements which have global ARIA
attributes are now being included in the accessibility tree. In addition,
several new test cases were added to this layout test so that we have
coverage for more presentational elements which lack global ARIA attributes.

* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::determineAriaRoleAttribute): Deleted.
* accessibility/AccessibilitySVGElement.h:

LayoutTests:

The expectations needed to be updated to reflect the elements which are
now being included in the accessibility tree. Also added several new test
cases with presentational elements that lack global ARIA attributes.

* accessibility/w3c-svg-presentational-role.html: Added several new test cases.
* platform/gtk/accessibility/w3c-svg-presentational-role-expected.txt: Updated.
* platform/mac/accessibility/w3c-svg-presentational-role-expected.txt: Updated

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

3 years agoMake BlobData use ThreadSafeSharedBuffer instead of RawData.
beidson@apple.com [Thu, 31 Mar 2016 01:21:04 +0000 (01:21 +0000)]
Make BlobData use ThreadSafeSharedBuffer instead of RawData.
https://bugs.webkit.org/show_bug.cgi?id=156041

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No change in behavior).

* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::consumeText):
(WebCore::FetchBody::extractFromText):
(WebCore::blobFromArrayBuffer):
* Modules/fetch/FetchBody.h:
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
(WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
* Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::didReceiveBinaryData):
* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processFrame):
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WebSocketChannelClient.h:
(WebCore::WebSocketChannelClient::didReceiveBinaryData):
* Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
(WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* fileapi/Blob.cpp:
(WebCore::Blob::Blob):
* fileapi/Blob.h:
(WebCore::Blob::create):
* fileapi/WebKitBlobBuilder.h:
* platform/network/BlobData.cpp:
(WebCore::BlobData::BlobData):
(WebCore::BlobDataItem::length):
(WebCore::BlobData::appendData):
(WebCore::BlobData::setContentType): Deleted.
* platform/network/BlobData.h:
(WebCore::BlobDataItem::type):
(WebCore::BlobDataItem::data):
(WebCore::BlobDataItem::file):
(WebCore::BlobDataItem::BlobDataItem):
(WebCore::BlobData::create):
(WebCore::RawData::create): Deleted.
(WebCore::RawData::data): Deleted.
(WebCore::RawData::length): Deleted.
(WebCore::RawData::RawData): Deleted.
* platform/network/BlobPart.h:
(WebCore::BlobPart::BlobPart):
(WebCore::BlobPart::data):
(WebCore::BlobPart::moveData):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::appendStorageItems):
(WebCore::BlobRegistryImpl::registerFileBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURLForSlice):
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::getSizeForNext):
(WebCore::BlobResourceHandle::readSync):
(WebCore::BlobResourceHandle::readDataSync):
(WebCore::BlobResourceHandle::readFileSync):
(WebCore::BlobResourceHandle::readAsync):
(WebCore::BlobResourceHandle::readDataAsync):
(WebCore::BlobResourceHandle::readFileAsync):
* platform/network/BlobResourceHandle.h:
* platform/network/FormData.cpp:
(WebCore::appendBlobResolved):
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::blobIsOutOfDate):
(WebCore::addEncodedBlobItemToSoupMessageBody):
* platform/text/LineEnding.cpp:
(WebCore::normalizeToCROrLF):
(WebCore::normalizeLineEndingsToNative):
(WebCore::normalizeLineEndingsToCR): Deleted.
(WebCore::normalizeLineEndingsToLF): Deleted.
* platform/text/LineEnding.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseBlob):

Source/WebKit2:

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::filesInBlob):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<BlobPart>::decode):

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

3 years agoChange some release asserts in CodeBlock linking into debug asserts
sbarati@apple.com [Thu, 31 Mar 2016 00:47:15 +0000 (00:47 +0000)]
Change some release asserts in CodeBlock linking into debug asserts
https://bugs.webkit.org/show_bug.cgi?id=155500

Reviewed by Filip Pizlo.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):

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

3 years agoRemove unused ScriptProfiler.Samples.totalTime
joepeck@webkit.org [Thu, 31 Mar 2016 00:40:11 +0000 (00:40 +0000)]
Remove unused ScriptProfiler.Samples.totalTime
https://bugs.webkit.org/show_bug.cgi?id=156002

Reviewed by Saam Barati.

Source/JavaScriptCore:

* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::buildSamples):
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
* inspector/protocol/ScriptProfiler.json:
Remove totalTime.

* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::SamplingProfiler): Deleted.
* runtime/SamplingProfiler.h:
(JSC::SamplingProfiler::totalTime): Deleted.
Remove now unused m_totalTime.

Source/WebInspectorUI:

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype.scriptProfilerTrackingCompleted):
* UserInterface/Models/CallingContextTree.js:
(WebInspector.CallingContextTree.prototype.get totalExecutionTime): Deleted.
(WebInspector.CallingContextTree.prototype.reset): Deleted.
(WebInspector.CallingContextTree.prototype.increaseExecutionTime): Deleted.
Remove unused totalExecutionTime.

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

3 years ago[ES6] Quantified unicode regular expressions do not work for counts greater than 1
msaboff@apple.com [Thu, 31 Mar 2016 00:38:20 +0000 (00:38 +0000)]
[ES6] Quantified unicode regular expressions do not work for counts greater than 1
https://bugs.webkit.org/show_bug.cgi?id=156044

Reviewed by Mark Lam.

Source/JavaScriptCore:

Fixed incorrect indexing of non-BMP characters in fixed patterns.  The old code
was indexing by character units, a single JS character, instead of code points
which is 2 JS characters.

* yarr/YarrInterpreter.cpp:
(JSC::Yarr::Interpreter::matchDisjunction):

LayoutTests:

Added new test cases.

* js/regexp-unicode-expected.txt:
* js/script-tests/regexp-unicode.js:

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

3 years agoUnreviewed, rolling out r198856.
dbates@webkit.org [Wed, 30 Mar 2016 23:44:08 +0000 (23:44 +0000)]
Unreviewed, rolling out r198856.

Broke the tests on the Apple El Capitan Release WK2 (Tests)
bot. Further investigation needed.

Reverted changeset:

"REGRESSION (r194660): Navigating to HTTPS sites may fail with
error"
https://bugs.webkit.org/show_bug.cgi?id=155455
http://trac.webkit.org/changeset/198856

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

3 years agoAdd a style for Data Detectors links.
enrica@apple.com [Wed, 30 Mar 2016 23:09:41 +0000 (23:09 +0000)]
Add a style for Data Detectors links.
https://bugs.webkit.org/show_bug.cgi?id=155996
rdar://problem/25343514

Reviewed by Sam Weinig.

Based on indication from the data detection engine,
we style some of the links differently.

* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
* platform/cocoa/DataDetectorsCoreSoftLink.h:
* platform/cocoa/DataDetectorsCoreSoftLink.mm:

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

3 years ago[OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
mmaxfield@apple.com [Wed, 30 Mar 2016 22:19:08 +0000 (22:19 +0000)]
[OS X] [RTL Scrollbars] Overlay RTL scrollbars animate in from the wrong side
https://bugs.webkit.org/show_bug.cgi?id=155962

Reviewed by Darin Adler.

Source/WebCore:

We can control the animation direction with the NSScrollerImp property
userInterfaceLayoutDirection.

This patch also adds an Internals function to set whether or not we
should mock the scrollbars. Not mocking the scrollbars is required
to use NSScrollerImps.

Test: fast/scrolling/rtl-scrollbars-animation-property.html

* platform/ScrollableArea.h: Use nullptr instead of 0.
(WebCore::ScrollableArea::horizontalScrollbar):
(WebCore::ScrollableArea::verticalScrollbar):
(WebCore::ScrollableArea::tiledBacking):
(WebCore::ScrollableArea::layerForHorizontalScrollbar):
(WebCore::ScrollableArea::layerForVerticalScrollbar):
(WebCore::ScrollableArea::layerForScrolling):
(WebCore::ScrollableArea::layerForScrollCorner):
(WebCore::ScrollableArea::layerForOverhangAreas):
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::updateScrollerStyle): Set the direction
of the new NSScrollerImps.
* platform/mac/ScrollbarThemeMac.h:
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::didCreateScrollerImp): Set the direction
of an NSScrollerImp.
(WebCore::ScrollbarThemeMac::registerScrollbar): Call
didCreateScrollerImp().
(WebCore::ScrollbarThemeMac::isLayoutDirectionRTL): Used for testing,
to tell if the scroller's direction is RTL.
* platform/spi/mac/NSScrollerImpSPI.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::write):
* testing/Internals.cpp:
(WebCore::Internals::setMockScrollbarsEnabled): Used for testing.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

This test only prints the "RTL" token when running on certain OSes.

* fast/scrolling/rtl-scrollbars-animation-property.html: Added.
* platform/mac/fast/scrolling/rtl-scrollbars-animation-property-expected.txt: Added.

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

3 years ago-webkit-text-underline-position: under; does not work in ToT
weinig@apple.com [Wed, 30 Mar 2016 22:06:38 +0000 (22:06 +0000)]
-webkit-text-underline-position: under; does not work in ToT
https://bugs.webkit.org/show_bug.cgi?id=156038

Reviewed by David Hyatt.

Source/WebCore:

Test: fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-vs-alphabetic.html

* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
Only resolve the underline position when based on the InlineTextBox when it is specified as auto.

LayoutTests:

* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-vs-alphabetic-expected-mismatch.html: Added.
* fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-vs-alphabetic.html: Added.
Add mismatch test to show that -webkit-text-underline-position: under works.

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

3 years agoFix the media test added in r185402
eric.carlson@apple.com [Wed, 30 Mar 2016 22:05:04 +0000 (22:05 +0000)]
Fix the media test added in r185402
https://bugs.webkit.org/show_bug.cgi?id=156040

Reviewed by Simon Fraser.

* media/video-transformed-by-javascript.html: Load a valid media file.

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

3 years agoREGRESSION (r194660): Navigating to HTTPS sites may fail with error
dbates@webkit.org [Wed, 30 Mar 2016 21:48:52 +0000 (21:48 +0000)]
REGRESSION (r194660): Navigating to HTTPS sites may fail with error
https://bugs.webkit.org/show_bug.cgi?id=155455
<rdar://problem/24308793>

Reviewed by Alexey Proskuryakov.

Fixes an issue where navigating to an HTTPS site may fail because the Security Framework uses
a cache directory that it does not have permission to use.

* Shared/mac/ChildProcessMac.mm:
(WebKit::codeSigningIdentifierForProcess): Queries the Security Framework for the code signed
bundle identifier/code signing identifier.
(WebKit::ChildProcess::initializeSandbox): Use the client identifier as part of the user directory
suffix. Verify that the client identifier matches the code signed bundled identifier/code
signing identifier for the code signed app/tool. Fix minor code style issue; use a C++-style cast
instead of a C-style cast when casting an OSStatus to a long.
(WebKit::findSecCodeForProcess): Deleted; incorporated logic into WebKit::codeSigningIdentifierForProcess().

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

3 years agoMake the $vm debugging tools available to builtins as @$vm.
mark.lam@apple.com [Wed, 30 Mar 2016 20:47:33 +0000 (20:47 +0000)]
Make the $vm debugging tools available to builtins as @$vm.
https://bugs.webkit.org/show_bug.cgi?id=156012

Reviewed by Saam Barati.

We also need some debugging tools for builtin development.  The $vm object will
be made available to builtins as @$vm, which gives us, amongst many goodies,
@$vm.print() (which prints the toString() values of its args) and
@$vm.printValue() (which dataLogs its arg as a JSValue).  @$vm will only be
available if we run with JSC_useDollarVM=true.

Also changed @$vm.print() to not automatically insert a space between the
printing of each of its args.  This makes it clearer as to what will be printed
i.e. it will only print what is passed to it.

* builtins/BuiltinNames.h:
(JSC::BuiltinNames::BuiltinNames):
(JSC::BuiltinNames::dollarVMPublicName):
(JSC::BuiltinNames::dollarVMPrivateName):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* tools/JSDollarVMPrototype.cpp:
(JSC::functionPrint):

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

3 years agoFix Windows EWS after r198766
commit-queue@webkit.org [Wed, 30 Mar 2016 20:39:08 +0000 (20:39 +0000)]
Fix Windows EWS after r198766
https://bugs.webkit.org/show_bug.cgi?id=156029

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

* CMakeLists.txt:
* PlatformWin.cmake:
Copy headers before compiling WebCoreDerivedSources, not just before compiling WebCore.

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

3 years agoBuildRequest should have a method to fetch all in-progress and pending requests for...
rniwa@webkit.org [Wed, 30 Mar 2016 19:46:23 +0000 (19:46 +0000)]
BuildRequest should have a method to fetch all in-progress and pending requests for a triggerable
https://bugs.webkit.org/show_bug.cgi?id=156008

Reviewed by Darin Adler.

Add a method to BuildRequest that fetches all pending and in-progress requests for a triggerable.

Now, new syncing scripts must be able to figure out the build slave the first build requests in
a given test group had used in order to schedule subsequent build requests in the test group.

For this purpose, /api/build-requests has been modified to return all build requests whose test
group had not finished yet. A test group is finished if all build requests in the test group had
finished (completed, failed, or canceled).

* public/include/build-requests-fetcher.php:
(BuildRequestFetcher::fetch_incomplete_requests_for_triggerable): Return all build requests in test
groups that have not been finished.
* public/v3/models/build-request.js:
(BuildRequest):
(BuildRequest.prototype.testGroupId): Added.
(BuildRequest.prototype.isPending): Renamed from hasPending to fix a bad grammar.
(BuildRequest.fetchForTriggerable): Added.
(BuildRequest.constructBuildRequestsFromData): Extracted from _createModelsFromFetchedTestGroups in
TestGroup.
* public/v3/models/manifest.js:
(Manifest.fetch): Use the full path from root so that it works in server tests.
* public/v3/models/test-group.js:
(TestGroup.hasPending):
(TestGroup._createModelsFromFetchedTestGroups):
* server-tests/api-build-requests-tests.js: Added tests to ensure all build requests for a test group
is present in the response returned by /api/build-requests iff any build request in the group had not
finished yet.
(.addMockData):
(.addAnotherMockTestGroup): Added.
* unit-tests/test-groups-tests.js:

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

3 years agoRandom SerializedScriptValue cleanup.
beidson@apple.com [Wed, 30 Mar 2016 19:42:59 +0000 (19:42 +0000)]
Random SerializedScriptValue cleanup.
https://bugs.webkit.org/show_bug.cgi?id=156032

Rubberstamped by Tim Hatcher.

- Remove two unused functions.
- Make the class always be ThreadSafeRefCounted.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::numberValue): Deleted.
(WebCore::SerializedScriptValue::undefinedValue): Deleted.
* bindings/js/SerializedScriptValue.h:

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

3 years agoWeb Inspector: Calculate more accurate time per-sample instead of assuming 1ms
commit-queue@webkit.org [Wed, 30 Mar 2016 19:36:20 +0000 (19:36 +0000)]
Web Inspector: Calculate more accurate time per-sample instead of assuming 1ms
https://bugs.webkit.org/show_bug.cgi?id=155961
<rdar://problem/25404505>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-03-30
Reviewed by Geoffrey Garen.

Give each sample a duration based on the best time bounds we have available.
Script Profiler Events give us time bounds for (nearly) all script evaluations.
The only evaluations that are missed are Inspector scripts.

The duration per-sample is computed per-event:

    durationPerSample = (event.endTime - event.startTime) / numSamplesInTimeRange.

If a 10ms Script Event contains 5 samples, they would each get a 2ms duration.
If a 0.5ms Script Event contains 1 sample, it would get a 0.5ms duration.

We were seeing an average of 1.6-1.8ms per sample for events that had more
than 3 samples.

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.prototype.scriptProfilerTrackingCompleted):
Associate a time duration per sample. For each Script Event we compute
an average time for all the samples in the event and assign it to the sample.

* UserInterface/Models/CallingContextTree.js:
(WebInspector.CallingContextTree.prototype.totalDurationInTimeRange):
(WebInspector.CallingContextTree.prototype.numberOfSamplesInTimeRange): Deleted.
Accumulate the duration by checking each sample. Number of samples
is now meaningless.

(WebInspector.CallingContextTree.prototype.updateTreeWithStackTrace):
(WebInspector.CCTNode):
(WebInspector.CCTNode.prototype.addTimestampAndExpressionLocation):
Give CCTNodes a list of durations and leafDurations that parallels
the timestamps and leafTimestamps lists of individual samples.

(WebInspector.CCTNode.prototype.filteredTimestampsAndDuration):
(WebInspector.CCTNode.prototype.filteredLeafTimestampsAndDuration):
(WebInspector.CCTNode.prototype.filteredTimestamps): Deleted.
(WebInspector.CCTNode.prototype.numberOfLeafTimestamps): Deleted.
Whenever we get a list of timestamps, also compute the duration
of those timestamps at the same time.

* UserInterface/Views/ProfileDataGridNode.js:
(WebInspector.ProfileDataGridNode):
(WebInspector.ProfileDataGridNode.prototype._updateChildrenForModifiers):
(WebInspector.ProfileDataGridNode.prototype._recalculateData):
* UserInterface/Views/ProfileDataGridTree.js:
(WebInspector.ProfileDataGridTree):
(WebInspector.ProfileDataGridTree.prototype.get totalSampleTime):
(WebInspector.ProfileDataGridTree.prototype._updateCurrentFocusDetails):
(WebInspector.ProfileDataGridTree.prototype.get sampleInterval): Deleted.
(WebInspector.ProfileDataGridTree.prototype.get numberOfSamples): Deleted.
Instead of computing total time from (samples * sampleInterval),
accumulate it by adding up the duration of each individual sample.
Update the Profile Data Grid nodes to use the new calculations.

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

3 years agoAvoid WebCore-prefixed paths when building WebCore
bfulgham@apple.com [Wed, 30 Mar 2016 19:36:11 +0000 (19:36 +0000)]
Avoid WebCore-prefixed paths when building WebCore
https://bugs.webkit.org/show_bug.cgi?id=156027

Reviewed by David Kilzer.

Replace instances of '#include <WebCore/XXXYYY.h>"' with the normal
'#include "XXXYYY.h"' for files inside WebCore.

* config.h:
* inspector/InspectorTimelineAgent.cpp:
* page/ViewportConfiguration.cpp:
* platform/audio/ios/AudioDestinationIOS.cpp:
* platform/cocoa/WebVideoFullscreenModel.h:
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
* platform/graphics/Font.h:
* platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
* platform/graphics/cg/ColorCG.cpp:
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/mac/WebVideoFullscreenInterfaceMac.h:
* platform/mock/MediaPlaybackTargetPickerMock.cpp:

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

3 years agoMove the CG ImageDecoder class from ImageSourceCG.cpp to ImageDecoderCG.h and .cpp
commit-queue@webkit.org [Wed, 30 Mar 2016 19:10:18 +0000 (19:10 +0000)]
Move the CG ImageDecoder class from ImageSourceCG.cpp to ImageDecoderCG.h and .cpp
https://bugs.webkit.org/show_bug.cgi?id=155980

Patch by Said Abou-Hallawa <sabouhallawa@apple,com> on 2016-03-30
Reviewed by Simon Fraser.

After this step, ImageSource.cpp and ImageSourceCG.cpp look very similar
so they can be merged in one file. All the redundant code in these two files
can be removed.

* PlatformAppleWin.cmake:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cg/ImageDecoderCG.cpp: Copied from Source/WebCore/platform/graphics/cg/ImageSourceCG.cpp.
(WebCore::createImageSourceOptions):
(WebCore::imageSourceOptions):
(WebCore::orientationFromProperties):
(WebCore::sharedBufferGetBytesAtPosition):
(WebCore::sharedBufferRelease):
(WebCore::ImageDecoder::ImageDecoder):
(WebCore::ImageDecoder::subsamplingLevelForScale):
(WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
(WebCore::ImageDecoder::filenameExtension):
(WebCore::ImageDecoder::isSizeAvailable):
(WebCore::ImageDecoder::size):
(WebCore::ImageDecoder::frameCount):
(WebCore::ImageDecoder::repetitionCount):
(WebCore::ImageDecoder::hotSpot):
(WebCore::ImageDecoder::frameSizeAtIndex):
(WebCore::ImageDecoder::frameIsCompleteAtIndex):
(WebCore::ImageDecoder::orientationAtIndex):
(WebCore::ImageDecoder::frameDurationAtIndex):
(WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
(WebCore::ImageDecoder::frameHasAlphaAtIndex):
(WebCore::ImageDecoder::frameBytesAtIndex):
(WebCore::ImageDecoder::createFrameImageAtIndex):
(WebCore::ImageDecoder::setData):
* platform/graphics/cg/ImageDecoderCG.h: Added.
(WebCore::ImageDecoder::create):
* platform/graphics/cg/ImageSourceCG.cpp:
(WebCore::ImageDecoder::create): Deleted.
(WebCore::createImageSourceOptions): Deleted.
(WebCore::imageSourceOptions): Deleted.
(WebCore::orientationFromProperties): Deleted.
(WebCore::sharedBufferGetBytesAtPosition): Deleted.
(WebCore::sharedBufferRelease): Deleted.
(WebCore::ImageDecoder::ImageDecoder): Deleted.
(WebCore::ImageDecoder::subsamplingLevelForScale): Deleted.
(WebCore::ImageDecoder::bytesDecodedToDetermineProperties): Deleted.
(WebCore::ImageDecoder::filenameExtension): Deleted.
(WebCore::ImageDecoder::isSizeAvailable): Deleted.
(WebCore::ImageDecoder::size): Deleted.
(WebCore::ImageDecoder::frameCount): Deleted.
(WebCore::ImageDecoder::repetitionCount): Deleted.
(WebCore::ImageDecoder::hotSpot): Deleted.
(WebCore::ImageDecoder::frameSizeAtIndex): Deleted.
(WebCore::ImageDecoder::frameIsCompleteAtIndex): Deleted.
(WebCore::ImageDecoder::orientationAtIndex): Deleted.
(WebCore::ImageDecoder::frameDurationAtIndex): Deleted.
(WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex): Deleted.
(WebCore::ImageDecoder::frameHasAlphaAtIndex): Deleted.
(WebCore::ImageDecoder::frameBytesAtIndex): Deleted.
(WebCore::ImageDecoder::createFrameImageAtIndex): Deleted.
(WebCore::ImageDecoder::setData): Deleted.

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

3 years ago[WinCairo][MediaFoundation] Video size is not always set.
peavo@outlook.com [Wed, 30 Mar 2016 18:31:47 +0000 (18:31 +0000)]
[WinCairo][MediaFoundation] Video size is not always set.
https://bugs.webkit.org/show_bug.cgi?id=156020

Reviewed by Darin Adler.

Getting the video display control object from the media session might fail the first time.
In case it fails, we should try again when setting the video size.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::setSize):
(WebCore::MediaPlayerPrivateMediaFoundation::getVideoDisplay):
(WebCore::MediaPlayerPrivateMediaFoundation::onTopologySet):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:

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

3 years agoUnreviewed, rolling out r198828.
commit-queue@webkit.org [Wed, 30 Mar 2016 18:24:26 +0000 (18:24 +0000)]
Unreviewed, rolling out r198828.
https://bugs.webkit.org/show_bug.cgi?id=156030

Confirming PLT regression (Requested by anttik on #webkit).

Reverted changeset:

"Separate render tree updating from style resolve"
https://bugs.webkit.org/show_bug.cgi?id=155298
http://trac.webkit.org/changeset/198828

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

3 years agoTweak styles for transparent, isolated image presentation for blog posts.
jond@apple.com [Wed, 30 Mar 2016 18:08:33 +0000 (18:08 +0000)]
Tweak styles for transparent, isolated image presentation for blog posts.

Reviewed by Timothy Hatcher.

* wp-content/themes/webkit/style.css:
(.tile .background-image.loaded):
(.tile .featured-image):
(.tag-transparent:not(.featured-tile) .featured-image):
(.tag-transparent:not(.featured-tile) .background-image.loaded):

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

3 years agoUnreviewed, buildfix.
keith_miller@apple.com [Wed, 30 Mar 2016 18:03:44 +0000 (18:03 +0000)]
Unreviewed, buildfix.

* bytecode/BytecodeIntrinsicRegistry.h:

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

3 years agoUnreviewed, rollout r198808. The patch causes crashes on 32-bit and appears to be...
keith_miller@apple.com [Wed, 30 Mar 2016 17:55:24 +0000 (17:55 +0000)]
Unreviewed, rollout r198808. The patch causes crashes on 32-bit and appears to be a JSBench regression.

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

3 years ago[OS X] [RTL Scrollbars] List boxes should obey RTL scrollbars
mmaxfield@apple.com [Wed, 30 Mar 2016 17:34:20 +0000 (17:34 +0000)]
[OS X] [RTL Scrollbars] List boxes should obey RTL scrollbars
https://bugs.webkit.org/show_bug.cgi?id=155991

Reviewed by Darin Adler.

Source/WebCore:

List boxes were created before RenderLayers, and therefore don't share
the scollbar logic with them. Instead, they manage their own Scrollbars.
The placement logic needs to be updated to take RTL scrollbars into
account.

Tests: fast/scrolling/rtl-scrollbars-listbox-scroll.html
       fast/scrolling/rtl-scrollbars-listbox-select-left.html
       fast/scrolling/rtl-scrollbars-listbox-select-right.html
       fast/scrolling/rtl-scrollbars-listbox-simple.html
       fast/scrolling/rtl-scrollbars-listbox.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::contentBoxRect):
* rendering/RenderBox.h:
(WebCore::RenderBox::contentBoxRect): Deleted.
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::itemBoundingBoxRect):
(WebCore::RenderListBox::paintScrollbar):
(WebCore::RenderListBox::paintItemBackground):
(WebCore::RenderListBox::isPointInOverflowControl):
(WebCore::RenderListBox::listIndexAtOffset):
(WebCore::RenderListBox::nodeAtPoint):
(WebCore::RenderListBox::controlClipRect):
(WebCore::RenderListBox::invalidateScrollbarRect):
(WebCore::RenderListBox::convertFromScrollbarToContainingView):
(WebCore::RenderListBox::convertFromContainingViewToScrollbar):
(WebCore::RenderListBox::scrolledToTop):
(WebCore::RenderListBox::scrolledToBottom):

LayoutTests:

As with the previous patches, mark new tests as failing on all OSes that
don't support RTL scrollbars.

* TestExpectations:
* fast/scrolling/rtl-scrollbars-listbox-expected.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-scroll-expected.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-scroll.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-select-left-expected.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-select-left.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-select-right-expected.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-select-right.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-simple-expected-mismatch.html: Added.
* fast/scrolling/rtl-scrollbars-listbox-simple.html: Added.
* fast/scrolling/rtl-scrollbars-listbox.html: Added.

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

3 years agorun-webkit-tests must create parent directory of user's cache directory before runnin...
dbates@webkit.org [Wed, 30 Mar 2016 17:23:41 +0000 (17:23 +0000)]
run-webkit-tests must create parent directory of user's cache directory before running tests
https://bugs.webkit.org/show_bug.cgi?id=156009
<rdar://problem/25442682>

Reviewed by Alexey Proskuryakov.

The script run-webkit-tests must create the parent directory of the user's cache directory
before running tests because a WebKit2 child process expects that this directory exists
when it starts.

The script run-webkit-tests influences the path chosen by a WebKit2 child process for the
user's temporary directory and user's cache directory via the environment variable
DIRHELPER_USER_DIR_SUFFIX. For the user's temporary directory, run-webkit-tests creates it
as part of setting up the test environment. But run-webkit-tests does not create the user's
cache directory. Therefore there is race between the time AppKit creates it and when the
launched WebContent and Network processes query for the path to the user's cache directory
such that the OS may return the empty string to the WebContent and Network processes if
queried for this directory before AppKit creates it.

* Scripts/webkitpy/port/base.py:
(Port._path_to_user_cache_directory): Added. Base class implementation that returns the
empty string. We will override this method for the OS X port to return the path to the
user's cache directory with the specified suffix.
(Port.remove_cache_directory): Deleted.
* Scripts/webkitpy/port/driver.py:
(Driver.__init__): Initialize self._driver_user_directory_suffix and self._driver_user_cache_directory
to the suffix to use for the user's temporary and cache directories and the path to the
user's cache directory, respectively.
(Driver._setup_environ_for_driver): Modified to set the environment variable DIRHELPER_USER_DIR_SUFFIX
to self._driver_user_directory_suffix.
(Driver._start): Compute the user directory suffix and the path to the user's cache
directory. Create the user's cache directory (if applicable).
(Driver.stop): Modified to remove directory self._driver_user_cache_directory (if applicable).
* Scripts/webkitpy/port/mac.py:
(MacPort.user_cache_directory): Added. Overrides Port._path_to_user_cache_directory().
(MacPort.remove_cache_directory): Deleted.

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

3 years agoUse references instead of pointers in scrollbar-related code
mmaxfield@apple.com [Wed, 30 Mar 2016 16:50:14 +0000 (16:50 +0000)]
Use references instead of pointers in scrollbar-related code
https://bugs.webkit.org/show_bug.cgi?id=155998

Reviewed by Dean Jackson.

Source/WebCore:

Migrate pointers to references.

No new tests because there is no behavior change.

* page/FrameView.cpp:
(WebCore::FrameView::invalidateScrollbarRect):
(WebCore::FrameView::setVisibleScrollerThumbRect):
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::convertFromScrollbarToContainingView):
(WebCore::ScrollView::convertFromContainingViewToScrollbar):
* platform/ScrollView.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::invalidateScrollbar):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::convertFromScrollbarToContainingView):
(WebCore::ScrollableArea::convertFromContainingViewToScrollbar):
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::invalidateRect):
(WebCore::Scrollbar::convertToContainingView):
(WebCore::Scrollbar::convertFromContainingView):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::convertFromScrollbarToContainingView):
(WebCore::RenderLayer::convertFromContainingViewToScrollbar):
(WebCore::RenderLayer::scrollbarOffset):
(WebCore::RenderLayer::invalidateScrollbarRect):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::destroyRootLayer):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::invalidateScrollbarRect):
(WebCore::RenderListBox::convertFromScrollbarToContainingView):
(WebCore::RenderListBox::convertFromContainingViewToScrollbar):
* rendering/RenderListBox.h:
* platform/win/PopupMenuWin.cpp:
(WebCore::RenderListBox::invalidateScrollbarRect):
* platform/win/PopupMenuWin.h:

Source/WebKit2:

* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
* WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
(WebKit::PDFPlugin::convertFromScrollbarToContainingView):
(WebKit::PDFPlugin::convertFromContainingViewToScrollbar):
(WebKit::PDFPlugin::invalidateScrollbarRect):

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

3 years agoVersioning.
bshafiei@apple.com [Wed, 30 Mar 2016 16:37:28 +0000 (16:37 +0000)]
Versioning.

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

3 years ago[JSC] Implement String.prototype.repeat in builtins JS
utatane.tea@gmail.com [Wed, 30 Mar 2016 16:34:30 +0000 (16:34 +0000)]
[JSC] Implement String.prototype.repeat in builtins JS
https://bugs.webkit.org/show_bug.cgi?id=155974

Reviewed by Darin Adler.

Source/JavaScriptCore:

This patch converts C++ String.prototype.repeat implementation into JS builtins.
|this| in strict mode is correctly inferred as String[1]. This fact encourages us
to write PrimitiveTypes.prototype.XXX methods in builtin JS.

LayoutTests/js/string-repeat.html already covers the tests for this change.

Note: String.prototype.repeat functionality is similar to Harmony's
String.prototype.{padStart, padEnd}. It's nice to port them to builtin JS in
the other patch.

The existing C++ code has the fast path for singleCharacterString repeating.
Since this use is important (e.g. generating N length spaces: ' '.repeat(N)),
we keep this fast path as @repeatCharacter().

The performance results show that, while the performance of the single character fast path
is neutral, other string repeating has significant speed up.
There are two reasons.

1. Not resolving string rope.

We added several tests postfixed "not-resolving". In that tests, we do not touch the content
of the generated string. As a result, the generated rope is not resolved.

2. O(log N) intermediate JSRopeStrings.

In the existing C++ implementation, we use JSString::RopeBuilder. We iterate N times and append
the given string to the builder.
In this case, the intermediate rope strings generated in JSString::RopeBuilder is O(N).
In JS builtin implementation, we only iterate log N times. As a result, the number of the
intermediate rope strings becomes O(log N).

[1]: http://trac.webkit.org/changeset/195938

* builtins/StringPrototype.js:
(repeatSlowPath):
(repeat):
* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
* bytecode/BytecodeIntrinsicRegistry.h:
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncRepeatCharacter):
(JSC::StringPrototype::finishCreation): Deleted.
(JSC::stringProtoFuncRepeat): Deleted.
* runtime/StringPrototype.h:
* tests/stress/string-repeat-edge-cases.js: Added.
(shouldBe):
(let.object.toString):
(valueOf):
(shouldThrow):

LayoutTests:

Update the error messages.

* js/regress/script-tests/string-repeat-not-resolving-fixed.js: Added.
(test):
* js/regress/script-tests/string-repeat-not-resolving-no-inline.js: Added.
(test):
* js/regress/script-tests/string-repeat-not-resolving.js: Added.
(test):
* js/regress/script-tests/string-repeat-resolving-fixed.js: Added.
(test):
* js/regress/script-tests/string-repeat-resolving-no-inline.js: Added.
(test):
* js/regress/script-tests/string-repeat-resolving.js: Added.
(test):
* js/regress/script-tests/string-repeat-single-not-resolving.js: Added.
(test):
* js/regress/script-tests/string-repeat-single-resolving.js: Added.
(test):
* js/regress/script-tests/string-repeat-small-not-resolving.js: Added.
(test):
* js/regress/script-tests/string-repeat-small-resolving.js: Added.
(test):
* js/regress/string-repeat-not-resolving-expected.txt: Added.
* js/regress/string-repeat-not-resolving-fixed-expected.txt: Added.
* js/regress/string-repeat-not-resolving-fixed.html: Added.
* js/regress/string-repeat-not-resolving-noinline-expected.txt: Added.
* js/regress/string-repeat-not-resolving-noinline.html: Added.
* js/regress/string-repeat-not-resolving.html: Added.
* js/regress/string-repeat-resolving-expected.txt: Added.
* js/regress/string-repeat-resolving-fixed-expected.txt: Added.
* js/regress/string-repeat-resolving-fixed.html: Added.
* js/regress/string-repeat-resolving-no-inline-expected.txt: Added.
* js/regress/string-repeat-resolving-no-inline.html: Added.
* js/regress/string-repeat-resolving.html: Added.
* js/regress/string-repeat-single-not-resolving-expected.txt: Added.
* js/regress/string-repeat-single-not-resolving.html: Added.
* js/regress/string-repeat-single-resolving-expected.txt: Added.
* js/regress/string-repeat-single-resolving.html: Added.
* js/regress/string-repeat-small-not-resolving-expected.txt: Added.
* js/regress/string-repeat-small-not-resolving.html: Added.
* js/regress/string-repeat-small-resolving-expected.txt: Added.
* js/regress/string-repeat-small-resolving.html: Added.
* js/script-tests/string-repeat.js:
* js/string-repeat-expected.txt:

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

3 years agoMake animation events non-cancelable
simon.fraser@apple.com [Wed, 30 Mar 2016 16:25:18 +0000 (16:25 +0000)]
Make animation events non-cancelable
https://bugs.webkit.org/show_bug.cgi?id=78110

Reviewed by Dan Bates.

Source/WebCore:

Make the animation events non-cancelable.

Test: animations/animation-events-not-cancelable.html

* dom/AnimationEvent.cpp:
(WebCore::AnimationEvent::AnimationEvent):

LayoutTests:

* animations/animation-events-not-cancelable-expected.txt: Added.
* animations/animation-events-not-cancelable.html: Added.

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

3 years agoUpdate the Twitter URLs for Twitter handles in blog post bylines.
jond@apple.com [Wed, 30 Mar 2016 14:37:29 +0000 (14:37 +0000)]
Update the Twitter URLs for Twitter handles in blog post bylines.

* wp-content/themes/webkit/single.php:

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

3 years ago[EFL] Mark svg zoom and pageoverlay tests to failure
gyuyoung.kim@webkit.org [Wed, 30 Mar 2016 13:58:25 +0000 (13:58 +0000)]
[EFL] Mark svg zoom and pageoverlay tests to failure

Unreviewed EFL gardening.

* platform/efl/TestExpectations: Assign new bugs to the failures.

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

3 years ago[css-grid] Refactor positioned children code
rego@igalia.com [Wed, 30 Mar 2016 11:45:38 +0000 (11:45 +0000)]
[css-grid] Refactor positioned children code
https://bugs.webkit.org/show_bug.cgi?id=155972

Reviewed by Sergio Villar Senin.

Source/WebCore:

This is a refactoring of RenderGrid::offsetAndBreadthForPositionedChild()
in order to calculate offset and breadth in a more clean way.
Hopefully making the code easier to follow.

Thanks to the refactoring, now positioned children in RTL
are working fine if they use the static inline position
(when "left" and "right" properties are both "auto").

The other case (not having a static inline position)
will be fixed in a separated patch.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):

LayoutTests:

Added RTL cases for most of the positioned tests,
which are now passing with this patch.

Pending to add RTL tests when "left" and "right" are not "auto"
(the item doesn't use the static inline position),
but that will be done in the other patch.

* fast/css-grid-layout/absolute-positioning-grid-container-containing-block-expected.txt:
* fast/css-grid-layout/absolute-positioning-grid-container-containing-block.html:
* fast/css-grid-layout/absolute-positioning-grid-container-parent-expected.txt:
* fast/css-grid-layout/absolute-positioning-grid-container-parent.html:
* fast/css-grid-layout/grid-positioned-items-background-expected.html:
* fast/css-grid-layout/grid-positioned-items-background.html:
Fix test setting transparent background as it couldn't fail before.
Also using a different width, to have different values when we create the RTL version.
* fast/css-grid-layout/grid-positioned-items-implicit-grid-expected.txt:
* fast/css-grid-layout/grid-positioned-items-implicit-grid-line-expected.txt:
* fast/css-grid-layout/grid-positioned-items-implicit-grid-line.html:
* fast/css-grid-layout/grid-positioned-items-implicit-grid.html:
* fast/css-grid-layout/grid-positioned-items-unknown-named-grid-line-expected.txt:
* fast/css-grid-layout/grid-positioned-items-unknown-named-grid-line.html:
* fast/css-grid-layout/grid-sizing-positioned-items-expected.txt:
* fast/css-grid-layout/grid-sizing-positioned-items.html:

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

3 years agoBinding generator should allow passing DOM objects parameters as references
youenn.fablet@crf.canon.fr [Wed, 30 Mar 2016 08:18:19 +0000 (08:18 +0000)]
Binding generator should allow passing DOM objects parameters as references
https://bugs.webkit.org/show_bug.cgi?id=155953

Reviewed by Alex Christensen.

Updating binding generator to pass DOM object parameters as references.
Introducing UsePointersEvenForNonNullableObjectArguments to disable that change.

Updating FetchRequest.idl and DOMWindowFetch.idl to pass parameters as references.

Updated other IDL interfaces to keep passing DOM object parameters as pointers.
This should not change the behavior for these interfaces.
UsePointersEvenForNonNullableObjectArguments should be progressively removed on those interfaces.

Binding generator tests covered by rebased binding tests.

* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/fetch/DOMWindowFetch.cpp:
(WebCore::DOMWindowFetch::fetch):
* Modules/fetch/DOMWindowFetch.h:
* Modules/fetch/DOMWindowFetch.idl:
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::create):
* Modules/fetch/FetchRequest.h:
* Modules/fetch/WorkerGlobalScopeFetch.cpp:
(WebCore::WorkerGlobalScopeFetch::fetch):
* Modules/fetch/WorkerGlobalScopeFetch.h:
* Modules/mediacontrols/MediaControlsHost.idl:
* Modules/mediasource/MediaSource.idl:
* Modules/mediasource/SourceBuffer.idl:
* Modules/mediastream/MediaStream.idl:
* Modules/speech/SpeechSynthesis.idl:
* Modules/webaudio/AudioContext.idl:
* Modules/webaudio/OscillatorNode.idl:
* Modules/websockets/WebSocket.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateParametersCheck):
(IsParameterPassedByReference):
(GenerateConstructorDefinition):
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
(WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
(WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
(WebCore::jsTestObjPrototypeFunctionConvert1):
(WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
(WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
(WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
(WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
(WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
(WebCore::jsTestObjPrototypeFunctionStrictFunction):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::constructJSTestOverloadedConstructors1):
(WebCore::constructJSTestOverloadedConstructors3):
* css/FontFaceSet.idl:
* css/WebKitCSSMatrix.idl:
* dom/CompositionEvent.idl:
* dom/DataTransfer.idl:
* dom/Document.idl:
* dom/Element.idl:
* dom/EventTarget.idl:
* dom/KeyboardEvent.idl:
* dom/MouseEvent.idl:
* dom/MutationEvent.idl:
* dom/MutationObserver.idl:
* dom/NamedNodeMap.idl:
* dom/Node.idl:
* dom/Range.idl:
* dom/TextEvent.idl:
* dom/TouchEvent.idl:
* dom/UIEvent.idl:
* dom/WebKitNamedFlow.idl:
* dom/WheelEvent.idl:
* fileapi/FileReader.idl:
* fileapi/FileReaderSync.idl:
* html/DOMURL.idl:
* html/HTMLElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLOptionsCollection.idl:
* html/HTMLSelectElement.idl:
* html/canvas/CanvasRenderingContext2D.idl:
* html/canvas/DOMPath.idl:
* html/canvas/OESVertexArrayObject.idl:
* html/canvas/WebGLDebugShaders.idl:
* html/canvas/WebGLRenderingContext.idl:
* html/canvas/WebGLRenderingContextBase.idl:
* html/track/TextTrack.idl:
* inspector/InspectorFrontendHost.idl:
* page/DOMSelection.idl:
* storage/StorageEvent.idl:
* svg/SVGGraphicsElement.idl:
* svg/SVGLengthList.idl:
* svg/SVGNumberList.idl:
* svg/SVGPathSegList.idl:
* svg/SVGPointList.idl:
* svg/SVGSVGElement.idl:
* svg/SVGTransformList.idl:
* testing/Internals.idl:
* xml/XMLSerializer.idl:
* xml/XPathEvaluator.idl:
* xml/XPathExpression.idl:
* xml/XSLTProcessor.idl:

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

3 years ago[JSC] Update udis86
benjamin@webkit.org [Wed, 30 Mar 2016 07:17:14 +0000 (07:17 +0000)]
[JSC] Update udis86
https://bugs.webkit.org/show_bug.cgi?id=156005

Reviewed by Geoffrey Garen.

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* disassembler/udis86/differences.txt:
* disassembler/udis86/itab.py: Removed.
* disassembler/udis86/optable.xml:
* disassembler/udis86/ud_itab.py: Added.
* disassembler/udis86/ud_opcode.py:
* disassembler/udis86/ud_optable.py: Removed.
* disassembler/udis86/udis86.c:
* disassembler/udis86/udis86_decode.c:
* disassembler/udis86/udis86_decode.h:
* disassembler/udis86/udis86_extern.h:
* disassembler/udis86/udis86_input.c: Removed.
* disassembler/udis86/udis86_input.h: Removed.
* disassembler/udis86/udis86_syn-att.c:
* disassembler/udis86/udis86_syn.h:
* disassembler/udis86/udis86_types.h:
* disassembler/udis86/udis86_udint.h:

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

3 years ago[JSC] Get rid of operationInitGlobalConst(), it is useless
commit-queue@webkit.org [Wed, 30 Mar 2016 07:14:10 +0000 (07:14 +0000)]
[JSC] Get rid of operationInitGlobalConst(), it is useless
https://bugs.webkit.org/show_bug.cgi?id=156010

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-03-30
Reviewed by Geoffrey Garen.

* jit/JITOperations.cpp:
* jit/JITOperations.h:

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

3 years ago[EFL] Fix build break since r198800. Unreviewed.
jh718.park@samsung.com [Wed, 30 Mar 2016 06:58:45 +0000 (06:58 +0000)]
[EFL] Fix build break since r198800. Unreviewed.
https://bugs.webkit.org/show_bug.cgi?id=156011

Currently libWebCoreDerivedSources.a cannot see the symbol located in WebCore Source files.
This patch let the library can see the symbols of WebCore Sources.

* PlatformEfl.cmake:

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

3 years agobmalloc: support physical page sizes that don't match the virtual page size (take 2)
ggaren@apple.com [Wed, 30 Mar 2016 06:42:36 +0000 (06:42 +0000)]
bmalloc: support physical page sizes that don't match the virtual page size (take 2)
https://bugs.webkit.org/show_bug.cgi?id=156003

Reviewed by Andreas Kling.

This is a memory savings on iOS devices where the virtual page size
is 16kB but the physical page size is 4kB.

Take 1 was a memory regression on 16kB virtual / 16kB physical systems
because it used a 4kB page size within a 16kB page size, allowing up to
4 different object types to mix within a physical page. Because objects
of the same type tend to deallocate at the same time, mixing objects of
different types made pages less likely to become completely empty.

(Take 1 also had a bug where it used a platform #ifdef that didn't exist.
Oops.)

Take 2 allocates units of SmallPages equal to the physical page size.

* bmalloc/Heap.cpp:
(bmalloc::Heap::Heap):
(bmalloc::Heap::initializeLineMetadata):
(bmalloc::Heap::allocateSmallBumpRanges):
(bmalloc::Heap::allocateSmallPage):
(bmalloc::Heap::allocateLarge):
(bmalloc::Heap::splitAndAllocate):
(bmalloc::Heap::tryAllocateXLarge):
(bmalloc::Heap::shrinkXLarge):
* bmalloc/Heap.h: Use the physical page size for our VM operations because
we're only concerned with returning physical pages to the OS.

* bmalloc/VMAllocate.h:
(bmalloc::vmPageSize):
(bmalloc::vmPageShift):
(bmalloc::vmSize):
(bmalloc::vmValidate):
(bmalloc::vmPageSizePhysical):
(bmalloc::vmValidatePhysical):
(bmalloc::tryVMAllocate):
(bmalloc::vmDeallocatePhysicalPages):
(bmalloc::vmAllocatePhysicalPages):
(bmalloc::vmDeallocatePhysicalPagesSloppy):
(bmalloc::vmAllocatePhysicalPagesSloppy): Use the physical page size.

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

3 years agoSeparate render tree updating from style resolve
antti@apple.com [Wed, 30 Mar 2016 06:00:22 +0000 (06:00 +0000)]
Separate render tree updating from style resolve
https://bugs.webkit.org/show_bug.cgi?id=155298

Reviewed by Andreas Kling.

Source/WebCore:

This patch splits computing document style and applying the results into two distinct steps:

Style::TreeResolver::resolve()
        |
        | Style::Update
        V
RenderTreeUpdater::commit()

Style::TreeResolver::resolve() returns a Style::Update object that contains all the changes to be made
for the whole composed tree. RenderTreeUpdater then applies the changes updating, building or tearing
down portions of the render tree as needed.

Style::Update consists of a map that contains new style for each newly resolved element along with some
metadata. A separate map contains text nodes that require reconstruction. It also tracks change roots so
RenderTreeUpdater needs to traverse the changed subtrees only.

The patch eliminates the recursive render tree build code path replacing it with iterative functions.

This will enable future optimizations. For example we won't need to commit to immediate rendering
changes simply because some script or internal function requires up-to-date style.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::State):
(WebCore::StyleResolver::styleForElement):
* css/StyleResolver.h:
(WebCore::StyleResolver::setOverrideDocumentElementStyle):
(WebCore::StyleResolver::State::State):

    Root element style is needed for resolving other elements. Add a way to provide it without looking
    into active document style.

* dom/Document.cpp:
(WebCore::Document::recalcStyle):

    Resolve the document style and commit it immediately (for now).

(WebCore::Document::styleForElementIgnoringPendingStylesheets):
* dom/Document.h:
(WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet):
(WebCore::Document::inStyleRecalc):
(WebCore::Document::inRenderTreeUpdate):
* dom/Element.cpp:
(WebCore::Element::setChildIndex):

    Setting the unique bit is now done by style relations update code.

* dom/Node.cpp:
(WebCore::Node::setNeedsStyleRecalc):

    Prevent spurious style invalidation during render tree updating.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):

    Capturing body element color for color:-webkit-text is now done by TreeResolver.

* rendering/RenderElement.h:
(WebCore::RenderElement::setAnimatableStyle): Deleted.

    No longer used.

* style/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::nextSiblingRenderer):

    Skip over non-rendered slot elements.

* style/RenderTreeUpdater.cpp: Added.
(WebCore::RenderTreeUpdater::Parent::Parent):
(WebCore::RenderTreeUpdater::RenderTreeUpdater):
(WebCore::hasDisplayContents):
(WebCore::findRenderingRoot):
(WebCore::RenderTreeUpdater::commit):

    Call updateRenderTree for each change root.

(WebCore::shouldCreateRenderer):
(WebCore::RenderTreeUpdater::updateRenderTree):

    Iteratively traverse the composed tree starting for a change root.
    Apply the changes calling updateElementRenderer and updateTextRenderer as needed.
    Enter subtrees that haves changes to apply.

(WebCore::RenderTreeUpdater::renderTreePosition):

    We may not create renderers for all elements (<slot> or more generally display:contents) that
    have rendered descendants. Search the parent stack to find the valid position.

(WebCore::RenderTreeUpdater::pushParent):
(WebCore::RenderTreeUpdater::popParent):
(WebCore::RenderTreeUpdater::popParentsToDepth):

    Maintain parent stack.

(WebCore::pseudoStyleCacheIsInvalid):
(WebCore::RenderTreeUpdater::updateElementRenderer):

    Create, delete or update the renderer.

(WebCore::moveToFlowThreadIfNeeded):
(WebCore::RenderTreeUpdater::createRenderer):
(WebCore::textRendererIsNeeded):
(WebCore::createTextRenderer):
(WebCore::RenderTreeUpdater::updateTextRenderer):
(WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):

    This is moved from TreeResolver.

(WebCore::needsPseudoElement):
(WebCore::RenderTreeUpdater::updateBeforeOrAfterPseudoElement):

    Pseudo elements are handled entirely during render tree construction. Compute their style and
    create or delete them as needed.

* style/RenderTreeUpdater.h: Added.
(WebCore::RenderTreeUpdater::parent):
* style/StyleRelations.cpp:
(WebCore::Style::commitRelationsToRenderStyle):
(WebCore::Style::commitRelations):

    Commit to Style::Update instead of the document if needed.

(WebCore::Style::commitRelationsToDocument): Deleted.
* style/StyleRelations.h:
* style/StyleSharingResolver.cpp:
(WebCore::Style::elementHasDirectionAuto):
(WebCore::Style::SharingResolver::resolve):

    Fetch the shareable style from Style::Update instead of the active document style.

(WebCore::Style::SharingResolver::findSibling):
(WebCore::Style::SharingResolver::canShareStyleWithElement):
* style/StyleSharingResolver.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Parent::Parent):

    No need for render tree position anymore.

(WebCore::Style::TreeResolver::popScope):
(WebCore::Style::TreeResolver::styleForElement):
(WebCore::Style::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded):
(WebCore::Style::createTextRendererIfNeeded):
(WebCore::Style::updateTextRendererAfterContentChange):
(WebCore::Style::resetStyleForNonRenderedDescendants):
(WebCore::Style::detachChildren):
(WebCore::Style::detachSlotAssignees):
(WebCore::Style::detachRenderTree):
(WebCore::Style::TreeResolver::resolveElement):

    Just resolve the style and return it, no more applying or entering render tree construction code paths.

(WebCore::Style::resolveTextNode):
(WebCore::Style::elementImplicitVisibility):
(WebCore::Style::TreeResolver::pushParent):
(WebCore::Style::TreeResolver::popParent):
(WebCore::Style::TreeResolver::popParentsToDepth):
(WebCore::Style::shouldResolvePseudoElement):
(WebCore::Style::TreeResolver::resolveComposedTree):

    Add style changes to Style::Update.

(WebCore::Style::TreeResolver::resolve):

    Return Style::Update object if non-empty.

(WebCore::Style::postResolutionCallbackQueue):
(WebCore::Style::shouldCreateRenderer): Deleted.
(WebCore::Style::moveToFlowThreadIfNeeded): Deleted.
(WebCore::Style::TreeResolver::createRenderer): Deleted.
(WebCore::Style::TreeResolver::createRenderTreeForChildren): Deleted.
(WebCore::Style::TreeResolver::createRenderTreeForShadowRoot): Deleted.
(WebCore::Style::beforeOrAfterPseudoElement): Deleted.
(WebCore::Style::setBeforeOrAfterPseudoElement): Deleted.
(WebCore::Style::clearBeforeOrAfterPseudoElement): Deleted.
(WebCore::Style::needsPseudoElement): Deleted.
(WebCore::Style::TreeResolver::createRenderTreeForBeforeOrAfterPseudoElement): Deleted.
(WebCore::Style::TreeResolver::createRenderTreeForSlotAssignees): Deleted.
(WebCore::Style::TreeResolver::createRenderTreeRecursively): Deleted.
(WebCore::Style::pseudoStyleCacheIsInvalid): Deleted.
(WebCore::Style::TreeResolver::resolveBeforeOrAfterPseudoElement): Deleted.

    Remove the recursive render tree building code path.

* style/StyleTreeResolver.h:
(WebCore::Style::TreeResolver::scope):
* style/StyleUpdate.cpp: Added.
(WebCore::Style::Update::Update):
(WebCore::Style::Update::elementUpdate):
(WebCore::Style::Update::textUpdate):
(WebCore::Style::Update::elementStyle):
(WebCore::Style::Update::addElement):
(WebCore::Style::Update::addText):
(WebCore::Style::Update::addPossibleRoot):
* style/StyleUpdate.h: Added.
(WebCore::Style::Update::roots):
(WebCore::Style::Update::document):
* svg/SVGElement.h:
(WebCore::SVGElement::updateRelativeLengthsInformation):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::svgAttributeChanged):
(WebCore::SVGUseElement::willRecalcStyle):
(WebCore::SVGUseElement::willAttachRenderers): Deleted.

    Switch willAttachRenderers to willRecalcStyle as the former is now called too late.

* svg/SVGUseElement.h:

LayoutTests:

* TestExpectations:

    Skip mathml/presentation/menclose-notation-attribute-change-value.html. It will be fixed by upcoming MathML refactoring.

* css3/blending/repaint/blend-mode-isolate-stacking-context-expected.txt:
* css3/viewport-percentage-lengths/viewport-percentage-lengths-resize-expected.txt:

    This is a progression.

* editing/mac/spelling/autocorrection-contraction-expected.txt:
* editing/mac/spelling/autocorrection-removing-underline-after-paste-expected.txt:
* editing/mac/spelling/autocorrection-removing-underline-expected.txt:
* editing/mac/spelling/autocorrection-simple-expected.txt:
* editing/style/remove-underline-from-stylesheet-expected.txt:
* editing/style/typing-style-003-expected.txt:

    Non-rendered whitespace related changes.

* platform/ios-simulator/TestExpectations:

    Skip fast/regions/position-writing-modes-in-variable-width-regions.html on iOS. Similar tests are mostly already skipped.

* platform/ios-simulator/editing/style/typing-style-003-expected.txt: Added.
* platform/mac-wk2/editing/mac/spelling/autocorrection-contraction-expected.txt:
* platform/mac/editing/inserting/editable-html-element-expected.txt:
* platform/mac/editing/inserting/editing-empty-divs-expected.txt:
* platform/mac/editing/inserting/insert-at-end-02-expected.txt:
* platform/mac/editing/pasteboard/4989774-expected.txt:
* platform/mac/editing/selection/4983858-expected.txt:

    Non-rendered whitespace related changes.

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

3 years ago[WTF] Removing a smart pointer from HashTable issues two stores to the same location
commit-queue@webkit.org [Wed, 30 Mar 2016 05:13:04 +0000 (05:13 +0000)]
[WTF] Removing a smart pointer from HashTable issues two stores to the same location
https://bugs.webkit.org/show_bug.cgi?id=155676

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-03-29
Reviewed by Darin Adler.

Source/WTF:

While working on the hot loop of r198376, I noticed something
weird...
Every time we removed a smart pointer from the hash table,
the code generated was something like:
    Load([bucket]) -> Tmp
    Store(0 -> [bucket])
    JumpIfZero(Tmp, ->End)
    Call fastFree()
    Store(-1 -> [bucket])
    -> End:

The useless store before the branch is annoying, especially on ARM.

Here is what happens:
    1) The destructor of the smart pointer swaps its internal value with nullptr.
    2) Since the smart pointer is not a local in-register value, that nullptr
       is stored in memory because it could be observable from fastFree().
    3) The destructor destroy the value if not zero (or deref for RefPtr).
       The "if-not-zero" may or may not be eliminated depending on what
       is between getting the iterator and the call to remove().
    4) fastFree() is called.
    5) The deleted value is set in the bucket.

This patch adds custom deletion for those cases to avoid the useless
store. The useless null check is still eliminated when we are lucky.

I went this path instead of changing the destructor of RefPtr for two reasons:
-I need this to work in unique_ptr for JSC.
-Nulling the memory may have security advantages in the cases where we do not immediately
 write over that memory again.

This patch removes 13kb out of x86_64 WebCore.

* wtf/HashTable.h:
(WTF::HashTable::deleteBucket):
(WTF::KeyTraits>::removeIf):
* wtf/HashTraits.h:
(WTF::HashTraits<RefPtr<P>>::customDeleteBucket):
(WTF::hashTraitsDeleteBucket):
(WTF::KeyValuePairHashTraits::customDeleteBucket):
* wtf/text/AtomicStringHash.h:
(WTF::HashTraits<WTF::AtomicString>::isEmptyValue):
(WTF::HashTraits<WTF::AtomicString>::customDeleteBucket):
* wtf/text/StringHash.h:
(WTF::HashTraits<String>::customDeleteBucket):

Tools:

* TestWebKitAPI/Tests/WTF/HashMap.cpp:
* TestWebKitAPI/Tests/WTF/HashSet.cpp:

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

3 years agoMake dependency injection in unit tests more explicit
rniwa@webkit.org [Wed, 30 Mar 2016 04:16:48 +0000 (04:16 +0000)]
Make dependency injection in unit tests more explicit
https://bugs.webkit.org/show_bug.cgi?id=156006

Reviewed by Joseph Pecoraro.

Make the dependency injection of model objects in unit tests explicit so that server tests that create
"real" model objects won't create these mock objects. Now each test that uses mock model objects would call
MockModels.inject() to inject before / beforeEach and access each object using a property on MockModels
instead of them being implicitly defined on the global object.

Similarly, MockRemoteAPI now only replaces global.RemoteAPI during each test so that server tests can use
real RemoteAPI to access the test Apache server.

* unit-tests/analysis-task-tests.js:
* unit-tests/buildbot-syncer-tests.js:
(createSampleBuildRequest):
* unit-tests/measurement-adaptor-tests.js:
* unit-tests/measurement-set-tests.js:
* unit-tests/resources/mock-remote-api.js:
(MockRemoteAPI.getJSONWithStatus):
(MockRemoteAPI.inject): Added. Override RemoteAPI on the global object during each test.
* unit-tests/resources/mock-v3-models.js:
(MockModels.inject): Added. Create mock model objects before each test, and clear all static maps of
various v3 model classes (to remove all singleton objects for those model classes).
* unit-tests/test-groups-tests.js:

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

3 years agoUnreviewed fixes for search errors on WebKit Nightly Archives page; fixed date displa...
jond@apple.com [Wed, 30 Mar 2016 03:34:15 +0000 (03:34 +0000)]
Unreviewed fixes for search errors on WebKit Nightly Archives page; fixed date display on WebKit Nightly page
https://bugs.webkit.org/show_bug.cgi?id=155989

* wp-content/plugins/sync-nightly-builds.php:
* wp-content/themes/webkit/nightly.php:
* wp-content/themes/webkit/scripts/searchbuilds.js:
(initsearch.displayError):

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