Convert a couple of loops over to range-based for
https://bugs.webkit.org/show_bug.cgi?id=133287

Reviewed by Simon Fraser.

* UIProcess/Plugins/PluginInfoStore.cpp:
(WebKit::PluginInfoStore::findPluginForMIMEType):
(WebKit::PluginInfoStore::findPluginForExtension):
(WebKit::PluginInfoStore::infoForPluginWithPath):
* UIProcess/Plugins/mac/PluginProcessManagerMac.mm:
(WebKit::PluginProcessManager::setProcessSuppressionEnabled):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Latest emscripten life benchmark is 4x slower because the DFG doesn't realize that arithmetic on booleans is a thing
https://bugs.webkit.org/show_bug.cgi?id=133136

Reviewed by Oliver Hunt.

Source/JavaScriptCore: 
        
Some key concepts:

- Except for the prediction propagation and type fixup phases, which are super early in
  the pipeline, nobody has to know about the fact that booleans may flow into numerical
  operations because there will just be a BooleanToNumber node that will take a value
  and, if that value is a boolean, will convert it to the equivalent numerical value. It
  will have a BooleanUse mode where it will also speculate that the input is a boolean
  but it can also do UntypedUse in which case it will pass through any non-booleans.
  This operation is very easy to model in all of the compiler tiers.

- No changes to the baseline JIT. The Baseline JIT will still believe that boolean
  inputs require taking the slow path and it will still report that it took slow path
  for any such operations.  The DFG will now be smart enough to ignore baseline JIT slow
  path profiling on operations that were known to have had boolean inputs.  That's a
  little quirky, but it's probably easier than modifying the baseline JIT to track
  booleans correctly.
        
4.1x speed-up on the emscripten "life" benchmark. Up to 10x speed-up on microbenchmarks.

* bytecode/SpeculatedType.h:
(JSC::isInt32OrBooleanSpeculation):
(JSC::isInt32SpeculationForArithmetic):
(JSC::isInt32OrBooleanSpeculationForArithmetic):
(JSC::isInt32OrBooleanSpeculationExpectingDefined):
(JSC::isInt52Speculation):
(JSC::isMachineIntSpeculation):
(JSC::isFullNumberOrBooleanSpeculation):
(JSC::isFullNumberOrBooleanSpeculationExpectingDefined):
(JSC::isInt32SpeculationExpectingDefined): Deleted.
(JSC::isMachineIntSpeculationExpectingDefined): Deleted.
(JSC::isMachineIntSpeculationForArithmetic): Deleted.
(JSC::isBytecodeNumberSpeculationExpectingDefined): Deleted.
(JSC::isFullNumberSpeculationExpectingDefined): Deleted.
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGAllocator.h:
(JSC::DFG::Allocator<T>::indexOf):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::makeSafe):
(JSC::DFG::ByteCodeParser::makeDivSafe):
(JSC::DFG::ByteCodeParser::handleIntrinsic):
* dfg/DFGCSEPhase.cpp:
(JSC::DFG::CSEPhase::performNodeCSE):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGCommon.h:
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixIntConvertingEdge):
(JSC::DFG::FixupPhase::fixIntOrBooleanEdge):
(JSC::DFG::FixupPhase::fixDoubleOrBooleanEdge):
(JSC::DFG::FixupPhase::attemptToMakeIntegerAdd):
(JSC::DFG::FixupPhase::fixIntEdge): Deleted.
* dfg/DFGGraph.h:
(JSC::DFG::Graph::addSpeculationMode):
(JSC::DFG::Graph::valueAddSpeculationMode):
(JSC::DFG::Graph::arithAddSpeculationMode):
(JSC::DFG::Graph::addShouldSpeculateInt32):
(JSC::DFG::Graph::mulShouldSpeculateInt32):
(JSC::DFG::Graph::mulShouldSpeculateMachineInt):
(JSC::DFG::Graph::negateShouldSpeculateInt32):
(JSC::DFG::Graph::negateShouldSpeculateMachineInt):
(JSC::DFG::Graph::addImmediateShouldSpeculateInt32):
(JSC::DFG::Graph::mulImmediateShouldSpeculateInt32): Deleted.
* dfg/DFGNode.h:
(JSC::DFG::Node::sawBooleans):
(JSC::DFG::Node::shouldSpeculateInt32OrBoolean):
(JSC::DFG::Node::shouldSpeculateInt32ForArithmetic):
(JSC::DFG::Node::shouldSpeculateInt32OrBooleanForArithmetic):
(JSC::DFG::Node::shouldSpeculateInt32OrBooleanExpectingDefined):
(JSC::DFG::Node::shouldSpeculateMachineInt):
(JSC::DFG::Node::shouldSpeculateDouble):
(JSC::DFG::Node::shouldSpeculateNumberOrBoolean):
(JSC::DFG::Node::shouldSpeculateNumberOrBooleanExpectingDefined):
(JSC::DFG::Node::shouldSpeculateNumber):
(JSC::DFG::Node::canSpeculateInt32):
(JSC::DFG::Node::canSpeculateInt52):
(JSC::DFG::Node::sourceFor):
(JSC::DFG::Node::shouldSpeculateInt32ExpectingDefined): Deleted.
(JSC::DFG::Node::shouldSpeculateMachineIntForArithmetic): Deleted.
(JSC::DFG::Node::shouldSpeculateMachineIntExpectingDefined): Deleted.
(JSC::DFG::Node::shouldSpeculateDoubleForArithmetic): Deleted.
(JSC::DFG::Node::shouldSpeculateNumberExpectingDefined): Deleted.
* dfg/DFGNodeFlags.cpp:
(JSC::DFG::dumpNodeFlags):
* dfg/DFGNodeFlags.h:
(JSC::DFG::nodeMayOverflow):
(JSC::DFG::nodeMayNegZero):
(JSC::DFG::nodeCanSpeculateInt32):
(JSC::DFG::nodeCanSpeculateInt52):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::run):
(JSC::DFG::PredictionPropagationPhase::propagateToFixpoint):
(JSC::DFG::PredictionPropagationPhase::speculatedDoubleTypeForPrediction):
(JSC::DFG::PredictionPropagationPhase::propagate):
(JSC::DFG::PredictionPropagationPhase::doDoubleVoting):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileValueToInt32):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileValueToInt32):
(JSC::FTL::LowerDFGToLLVM::compileBooleanToNumber):
* runtime/JSCJSValue.h:
* runtime/JSCJSValueInlines.h:
(JSC::JSValue::asInt32ForArithmetic):
* tests/stress/max-boolean-exit.js: Added.
(foo):
(test):
* tests/stress/mul-boolean-exit.js: Added.
(foo):
(test):
* tests/stress/plus-boolean-exit.js: Added.
(foo):
(test):
* tests/stress/plus-boolean-or-double.js: Added.
(foo):
(test):
* tests/stress/plus-boolean-or-int.js: Added.
(foo):
(test):

LayoutTests: 

* js/regress/abs-boolean-expected.txt: Added.
* js/regress/abs-boolean.html: Added.
* js/regress/div-boolean-double-expected.txt: Added.
* js/regress/div-boolean-double.html: Added.
* js/regress/div-boolean-expected.txt: Added.
* js/regress/div-boolean.html: Added.
* js/regress/max-boolean-expected.txt: Added.
* js/regress/max-boolean.html: Added.
* js/regress/min-boolean-expected.txt: Added.
* js/regress/min-boolean.html: Added.
* js/regress/minus-boolean-double-expected.txt: Added.
* js/regress/minus-boolean-double.html: Added.
* js/regress/minus-boolean-expected.txt: Added.
* js/regress/minus-boolean.html: Added.
* js/regress/mod-boolean-double-expected.txt: Added.
* js/regress/mod-boolean-double.html: Added.
* js/regress/mod-boolean-expected.txt: Added.
* js/regress/mod-boolean.html: Added.
* js/regress/mul-boolean-double-expected.txt: Added.
* js/regress/mul-boolean-double.html: Added.
* js/regress/mul-boolean-expected.txt: Added.
* js/regress/mul-boolean.html: Added.
* js/regress/neg-boolean-expected.txt: Added.
* js/regress/neg-boolean.html: Added.
* js/regress/plus-boolean-arith-expected.txt: Added.
* js/regress/plus-boolean-arith.html: Added.
* js/regress/plus-boolean-double-expected.txt: Added.
* js/regress/plus-boolean-double.html: Added.
* js/regress/plus-boolean-expected.txt: Added.
* js/regress/plus-boolean.html: Added.
* js/regress/script-tests/abs-boolean.js: Added.
* js/regress/script-tests/div-boolean-double.js: Added.
* js/regress/script-tests/div-boolean.js: Added.
* js/regress/script-tests/max-boolean.js: Added.
* js/regress/script-tests/min-boolean.js: Added.
* js/regress/script-tests/minus-boolean-double.js: Added.
* js/regress/script-tests/minus-boolean.js: Added.
* js/regress/script-tests/mod-boolean-double.js: Added.
* js/regress/script-tests/mod-boolean.js: Added.
* js/regress/script-tests/mul-boolean-double.js: Added.
* js/regress/script-tests/mul-boolean.js: Added.
* js/regress/script-tests/neg-boolean.js: Added.
* js/regress/script-tests/plus-boolean-arith.js: Added.
* js/regress/script-tests/plus-boolean-double.js: Added.
* js/regress/script-tests/plus-boolean.js: Added.
* js/regress/script-tests/sin-boolean.js: Added.
* js/regress/sin-boolean-expected.txt: Added.
* js/regress/sin-boolean.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r169122.
https://bugs.webkit.org/show_bug.cgi?id=133288

Broke CJK font fallback (Requested by ap on #webkit).

Reverted changeset:

"[Mac] WebProcess doesn't follow localization of UI process
when run as a service"
https://bugs.webkit.org/show_bug.cgi?id=133126
http://trac.webkit.org/changeset/169122

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169355 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Cocoa] Rewrite WK_DESIGNATED_INITIALIZER in installed headers
https://bugs.webkit.org/show_bug.cgi?id=133290

Reviewed by Anders Carlsson.

* Shared/API/Cocoa/WKFoundation.h: When WK_API_AVAILABILITY_ENABLED is defined, don’t
provide definitions of WK_DESIGNATED_INITIALIZER and WK_UNAVAILABLE, since those macros will
be rewritten out of the headers. When WK_API_AVAILABILITY_ENABLED isn’t defined, provide
definitions of the other two macros as appropriate for the target OS.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Removed WK_DESIGNATED_INITIALIZER from a
category method declaration.
* UIProcess/API/Cocoa/WKWebView.h: Mark the superclass designated initializer
-initWithCoder: as unavailable.
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithCoder:]): Override this designated initializer of the superclass by
returning nil.
* mac/rewrite-availability-macros.sh: Rewrite WK_DESIGNATED_INITIALIZER to
NS_DESIGNATED_INITIALIZER and WK_UNAVAILABLE to NS_UNAVAILABLE. Also make sure to process
all headers if the script has changed since the last time it was run.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169356 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebKit2] Add better default preferences while keeping backward compatibility for the C-SPI
https://bugs.webkit.org/show_bug.cgi?id=133289

Reviewed by Anders Carlsson.

* Shared/WebPreferencesStore.h:
Change a few defaults:
- PluginsEnabled -> false
- JavaEnabled -> false
- JavaEnabledForLocalFiles -> false
- StorageBlockingPolicy -> BlockThirdPartyStorage

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesCreate):
(WKPreferencesCreateWithIdentifier):
* UIProcess/WebPageGroup.cpp:
(WebKit::WebPageGroup::WebPageGroup):
Switch to using WebPreferences::createWithLegacyDefaults().

* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::create):
(WebKit::WebPreferences::createWithLegacyDefaults):
* UIProcess/WebPreferences.h:
Move create functions to the cpp file and add createWithLegacyDefaults() which keeps
the old defaults;

* UIProcess/API/C/WKPreferencesRef.h:
Fix the comment.

* UIProcess/API/Cocoa/WKPreferences.h:
Update the comment to reflect the new defaults.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):
Unconditionally set setShouldDispatchJavaScriptWindowOnErrorEvents() to true. This setting only
exists for legacy WebKit.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Class name matching should use ASCII case-insensitive matching, not Unicode case folding
https://bugs.webkit.org/show_bug.cgi?id=133292

Reviewed by Anders Carlsson.

Source/WebCore:
Tests: fast/dom/getElementsByClassName/ASCII-case-insensitive.html
       fast/dom/getElementsByClassName/case-sensitive.html

* dom/SpaceSplitString.cpp:
(WebCore::hasNonASCIIOrUpper): Deleted.
(WebCore::tokenizeSpaceSplitString): Use a for loop instead of while.
(WebCore::spaceSplitStringTable): Renamed from sharedDataMap; the new name is supposed
to help us see the analogy with the atomic string table.
(WebCore::SpaceSplitString::set): Removed unneeded special case for null and preflight
since AtomicString::convertToASCIILowercase now handles both of those. Changed to call
convertToASCIILowercase instead of foldCase, since we don't want to fold non-ASCII.
(WebCore::SpaceSplitString::spaceSplitStringContainsValue): Ditto.
(WebCore::SpaceSplitStringData::create): Marked this inline since it's only called in
one place and that place is in this file. Also used auto a bit and used get instead of
find since the value type is a simple pointer.
(WebCore::SpaceSplitStringData::destroy): Removed unneeded check for null. We never
create any SpaceSplitStringData with empty strings, and a null is a kind of empty string.

* dom/SpaceSplitString.h: Removed some unneeded includes and some unneeded uses of the
inline keyword. Changed types from size_t to unsigned in a couple places; we had a mix
of the types and there was no reason to use size_t there.

Source/WTF:
* wtf/text/AtomicString.cpp:
(WTF::AtomicString::addSlowCase): Change to take references instead of pointers since these
arguments can never be null.
(WTF::AtomicString::lower): Rearranged slightly to use PassRef in a more efficient but
slightly uglier way.
(WTF::AtomicString::convertToASCIILowercase): Added.
* wtf/text/AtomicString.h: Updated for above changes.

* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertToASCIILowercase): Added.
* wtf/text/StringImpl.h: Updated for above.

* wtf/text/WTFString.cpp:
(WTF::String::convertToASCIILowercase): Added.
* wtf/text/WTFString.h: Updated for above.

LayoutTests:
* fast/dom/getElementsByClassName/ASCII-case-insensitive-expected.txt: Added.
* fast/dom/getElementsByClassName/ASCII-case-insensitive.html: Added.
* fast/dom/getElementsByClassName/case-sensitive-expected.txt: Added.
* fast/dom/getElementsByClassName/case-sensitive.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169358 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Split the call to adjustForLocalZoom out into a separate expression.
https://bugs.webkit.org/show_bug.cgi?id=133286

Reviewed by Darin Adler.

This patch ensures that adjustForLocalZoom() always gets called before we look at
zoomFactor's value. (and not rely on the undefined behavior of the order of function argument evaluation)

* dom/Element.cpp:
(WebCore::Element::offsetLeft):
(WebCore::Element::offsetTop):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169359 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the quirks mode selector matching of the pseudo classes :hover and :active
https://bugs.webkit.org/show_bug.cgi?id=133063

Reviewed by Antti Koivisto.


Source/WebCore: 
Our implementation of the quirks mode of :active and :hover was very wrong. The only
thing it was doing is verify the pseudo class is not the first selector of a fragment
(which was conveniently the only thing that was tested :)).

Since those pseudo class were only checking for the order of the filters, something like
    #target:hover
would succeed because :hover is not the first simple selector, while
    :hover#target
would fail.

That behavior is also a problem for the CSS JIT as it is an implementation detail of SelectorChecker
and compiling something like that with our out-of-order matching would be nonsense.

This patch update the implementation to follow http://quirks.spec.whatwg.org/#the-:active-and-:hover-quirk
Basically, the only cases that do not work in quirks mode are selectors composed only of "*, :hover and :active".

To implement this behavior, I needed to be able to inspect a complete selector fragment, including
what is before and after :hover/:active.
To do that, I replaced the boolean isSubSelector by a pointer to the first selector of the fragment.
When we need to match :active/:hover in quirks mode, we just go over all the selectors in the fragment
to find one of the qualifying match type.

Tests: fast/selectors/active-hover-quirks.html
       fast/selectors/active-quirks.html
       fast/selectors/hover-quirks.html

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
(WebCore::canMatchHoverOrActiveInQuirksMode):
(WebCore::SelectorChecker::checkOne):
* css/SelectorChecker.h:
(WebCore::SelectorChecker::SelectorCheckingContext::SelectorCheckingContext):

LayoutTests: 
The test coverage of :hover and :active was extremly poor.
Those new tests add coverage for the cases fixed by this patch.

* fast/selectors/active-hover-quirks-expected.txt: Added.
* fast/selectors/active-hover-quirks.html: Added.
* fast/selectors/active-hover-strict-expected.txt: Added.
* fast/selectors/active-hover-strict.html: Added.
* fast/selectors/active-quirks-expected.txt: Added.
* fast/selectors/active-quirks.html: Added.
* fast/selectors/active-strict-expected.txt: Added.
* fast/selectors/active-strict.html: Added.
* fast/selectors/hover-quirks-expected.txt: Added.
* fast/selectors/hover-quirks.html: Added.
* fast/selectors/hover-strict-expected.txt: Added.
* fast/selectors/hover-strict.html: Added.
* fast/selectors/resources/hover-active-quirks-utility.js: Added.
* selectors/resources/hover-active-strict-utility.js: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169360 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] GObject DOM bindings API break test fails in the tests bots
https://bugs.webkit.org/show_bug.cgi?id=133211

Patch by Carlos Alberto Lopez Perez <clopez@igalia.com> on 2014-05-26
Reviewed by Martin Robinson.

When generating the built product archive on platform GTK, we need
to copy also the file gtkdoc-webkitdom.cfg and the directory
DerivedSources/webkitdom.

* BuildSlaveSupport/built-product-archive:
(archiveBuiltProduct):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169361 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add UI process watchdog on iOS to ensure WebProcess connections close
https://bugs.webkit.org/show_bug.cgi?id=133200
<rdar://problem/16997983>

Reviewed by Darin Adler.

When the WebProcessProxy wants to disconnect from a WebContent process it just drops the connection,
and hopes the connection closes. There is a watchdog thread in the ChildProcess to try to ensure this
happens.

On iOS the process may not be runnable at the time, preventing termination. Instead add a watchdog in
the UI process to make the process runnable, and to terminate if it doesn't quit in a timely fashion.

* Platform/IPC/Connection.h:
    - added terminateSoon.
* Platform/IPC/mac/ConnectionMac.mm:
(IPC::ConnectionTerminationWatchdog::ConnectionTerminationWatchdog):
    - take an assertion to make the process runnable, and start a watchdog timer.
(IPC::ConnectionTerminationWatchdog::watchdogTimerFired):
    - if the process hasn't quit by the timer the watchdog fires, kill it.
(IPC::Connection::terminateSoon):
    - create a ConnectionTerminationWatchdog.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::removeWebPage):
    - when disconnecting from a process, first tell it to terminateSoon.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169362 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS JIT: Fix build error raised when CSS_SELECTOR_JIT_DEBUGGING is 1
https://bugs.webkit.org/show_bug.cgi?id=133266

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2014-05-26
Reviewed by Benjamin Poulain.

When CSS_SELECTOR_JIT_DEBUGGING is 1, build erros occur on x86_64.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generatePrologue):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateEpilogue):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169363 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Move navigator content utils's to own directory
https://bugs.webkit.org/show_bug.cgi?id=133275

Reviewed by Darin Adler.

Expected results need to be maintained by own directory because navigator content utils have been maintained by
own directory as well.

* platform/efl/fast/dom/NavigatorContentUtils/register-protocol-handler-expected.txt: Renamed from LayoutTests/platform/efl/fast/dom/register-protocol-handler-expected.txt.
* platform/efl/fast/dom/NavigatorContentUtils/unregister-protocol-handler-expected.txt: Renamed from LayoutTests/platform/efl/fast/dom/unregister-protocol-handler-expected.txt.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169364 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix wrong inclusion depth of js-test-pre.js in is-protocol-handler-registered.html
https://bugs.webkit.org/show_bug.cgi?id=133273

Reviewed by Darin Adler.

Can't use debug() due to wrong inclusion path.

* fast/dom/NavigatorContentUtils/is-protocol-handler-registered.html:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Fix code style check errors in EFL API tests.
https://bugs.webkit.org/show_bug.cgi?id=133170

Patch by Shivakumar JM <shiva.jm@samsung.com> on 2014-05-26
Reviewed by Gyuyoung Kim.

Omit int when using unsigned modifier, as per coding style rules.

* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp:
(EWK2UnitTest::EWK2UnitTestBase::SetUp):
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h:
(EWK2UnitTest::EWK2UnitTestEnvironment::defaultWidth):
(EWK2UnitTest::EWK2UnitTestEnvironment::defaultHeight):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169366 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Fix EWK2BackForwardListTest test fails.
https://bugs.webkit.org/show_bug.cgi?id=133171

Patch by Shivakumar JM <shiva.jm@samsung.com> on 2014-05-26
Reviewed by Gyuyoung Kim.

Use local test html pages instead of EWK2UnitTestServer, call ewk_view_url_set() to load test html pages.
Since even after setting no_proxy="localhost,127.0.0.1", still test server was unable to load the test
html pages for ewk2_back_forward_list tests, so changed to use local html pages.

* UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp:
(TEST_F):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169367 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove special case for transparent SVG root layers
https://bugs.webkit.org/show_bug.cgi?id=116856

Reviewed by Dirk Schulze.

This patch removes a special case from RenderLayer for root SVG layers
with opacity. Instead of checking whether a composited layer exists in
SVGRenderingContext::prepareToRenderSVGContent we now exclude the root
SVG renderobject from the opacity checks in prepareToRenderSVGContent.

This is a merge of https://src.chromium.org/viewvc/blink?view=rev&revision=174102
by Philip Rogers <pdr@chromium.org>.

No new tests as this is covered by svg/custom/composited-svg-with-opacity.html.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::isTransparent): Deleted.
* rendering/RenderLayer.h:
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::prepareToRenderSVGContent):
    The opacity case for root svg renderers is now handled by
    RenderLayer.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169368 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix test failures on python test
https://bugs.webkit.org/show_bug.cgi?id=133297

Reviewed by Dirk Schulze.

2 tests are failing because of unbounded local variable reference in test_importer.py.

* Scripts/webkitpy/w3c/test_importer.py: Move local variable declaration to top.
(TestImporter.import_tests):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] RemoteLayerBackingStore front buffers should be purgeable when unparented
https://bugs.webkit.org/show_bug.cgi?id=133020
<rdar://problem/16521736>

Reviewed by Simon Fraser.

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::display):
Let the context know whenever a RemoteLayerBackingStore is displayed, so that
RemoteLayerBackingStoreCollection can (if needed) note that the backing store
is active once again (because we only display parented backing store).

(WebKit::RemoteLayerBackingStore::setBufferVolatility):
Ensure that we never have live contexts attached to any buffers when
marking them volatile, because checking isInUse() with live contexts is futile.

* Shared/mac/RemoteLayerBackingStoreCollection.h:
* Shared/mac/RemoteLayerBackingStoreCollection.mm:
(WebKit::RemoteLayerBackingStoreCollection::RemoteLayerBackingStoreCollection):
(WebKit::RemoteLayerBackingStoreCollection::willFlushLayers):
(WebKit::RemoteLayerBackingStoreCollection::willCommitLayerTree):
(WebKit::RemoteLayerBackingStoreCollection::didFlushLayers):
(WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDestroyed):
(WebKit::RemoteLayerBackingStoreCollection::backingStoreWillBeDisplayed):
(WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatileImmediately):
(WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatile):
(WebKit::RemoteLayerBackingStoreCollection::backingStoreBecameUnreachable):
(WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired):
(WebKit::RemoteLayerBackingStoreCollection::scheduleVolatilityTimer):
(WebKit::RemoteLayerBackingStoreCollection::purgeabilityTimerFired): Deleted.
(WebKit::RemoteLayerBackingStoreCollection::schedulePurgeabilityTimer): Deleted.
Rename purgeable->volatile for accuracy.
Keep track of two sets of backing store: those which are active/parented, and
those which are not. Backing store is moved to the inactive set after building
the transaction in which its owning layer is unparented.
When backing store is unparented, try to mark it volatile immediately. Also,
mark the backing store property as dirty on the owning layer so that when
said layer is reparented, we encode the backing store in the commit that reparents it,
as the UI process will throw away its reference to the backing store when
the layer is unparented. Mark the front buffers of unparented layers as volatile,
in addition to the others.

* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::layerIDsWithNewlyUnreachableBackingStore):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
(WebKit::RemoteLayerTreeTransaction::setLayerIDsWithNewlyUnreachableBackingStore):
Include the list of layers (by ID) with backing store which just became unreachable in the transaction.

* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
Clear the contents of layers which now have unreachable backing store.
Otherwise, the UI process would hold a 'use' on the IOSurface, and prevent
the Web process from marking it volatile.

* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::backingStoreWillBeDisplayed):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
Give RemoteLayerBackingStoreCollection a shot at the RemoteLayerTreeTransaction,
so that it can fill in layerIDsWithNewlyUnreachableBackingStore.
Also, let it know when the flush begins and ends, so that it can keep track
of which layers were reached in the flush.

* WebCore.exp.in:
* platform/graphics/cg/IOSurfacePool.cpp:
(WebCore::IOSurfacePool::willAddSurface):
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(IOSurface::releaseGraphicsContext):
Rename clearGraphicsContext to releaseGraphicsContext for clarity.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169370 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Add LLVM as optional jhbuild module for FTL developers
https://bugs.webkit.org/show_bug.cgi?id=133216

Patch by Tibor Meszaros <tmeszaros.u-szeged@partner.samsung.com> on 2014-05-26
Reviewed by Gyuyoung Kim.

* efl/jhbuild.modules:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@169371 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Setting up OrderIterator shouldn't require an extra Vector
https://bugs.webkit.org/show_bug.cgi?id=119061

Reviewed by Darin Adler.

From Blink r153971 by <jchaffraix@chromium.org>

This patches reuse the OrderIterator's Vector. It provides a helper class OrderIteratorPopulator, used for
manipulating the Vector directly. Which allows to consolidate the code into a single implementation across
flexbox and grid.

No new tests, already covered by current tests.

* rendering/OrderIterator.cpp:
(WebCore::OrderIteratorPopulator::~OrderIteratorPopulator): Reset OrderIterator and call
removeDuplicatedOrderValues().
(WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Sorts the Vector and removes the duplicated
order values.
(WebCore::OrderIteratorPopulator::collectChild): Collect order value information from child.
(WebCore::OrderIterator::setOrderValues): Deleted.
* rendering/OrderIterator.h:
(WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Add helper class to manipulate OrderValues Vector.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::layoutBlock): Remove unneeded code related to old OrderValues vector.
(WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins): Populate OrderIterator using collectChild().
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Deleted.
* rendering/RenderFlexibleBox.h: Rename computeMainAxisPreferredSizes() to prepareOrderIteratorAndMargins().
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator): Populate OrderIterator using collectChild().


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