[EFL] Accessibility gardening
https://bugs.webkit.org/show_bug.cgi?id=122751

Unreviewed EFL gardening.

Patch by Krzysztof Czech <k.czech@samsung.com> on 2013-10-14

* platform/efl-wk2/TestExpectations: Add bug numbers and marked missing tests.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Shape-Margin should be animatable
https://bugs.webkit.org/show_bug.cgi?id=122524

Reviewed by Darin Adler.

Source/WebCore:

Mark content for relayout after shape-margin changes, and add shape-margin
to the list of animatable properties.

Tests: fast/shapes/shape-outside-floats/shape-outside-dynamic-shape-margin.html
       fast/shapes/shape-outside-floats/shape-outside-shape-margin-animation.html

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Add
shape-margin to the map of animatable CSS properties.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateShapeOutsideInfoAfterStyleChange): Compare shape-margins,
and mark dependent content for relayout if they have changed.

LayoutTests:

Test that shape-margin can be set dynamically and content lays out correctly.
Also test that shape-margin can be manipulated through CSS Animations.

* fast/shapes/shape-outside-floats/shape-outside-dynamic-shape-margin-expected.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-dynamic-shape-margin.html: Added.
* fast/shapes/shape-outside-floats/shape-outside-shape-margin-animation-expected.txt: Added.
* fast/shapes/shape-outside-floats/shape-outside-shape-margin-animation.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reintroduce PassRefPtr<Event> copy in ScopedEventQueue::dispatchEvent
https://bugs.webkit.org/show_bug.cgi?id=122742

Reviewed by Alexey Proskuryakov.

This is a follow-up to r157219 which introduced a workaround for the GCC's quirky behavior that
was resulting in crashes due to the PassRefPtr<Event> object passed to EventDispatcher::dispatchEvent
being copied and nullified first before retrieving the EventTarget of the Event object wrapped in that
PassRefPtr.

The implementation is now adjusted to first retrieve the pointer to the Event's EventTarget and store
it in a local variable. That variable is then passed as the first parameter to EventDispatcher::dispatchEvent,
and the PassRefPtr<Event> passed directly as the second parameter. Previously the pointer of that PassRefPtr
object was passed in, with a new PassRefPtr being created which would increase the reference count of the
ref-counted object. Passing in the original PassRefPtr avoids the unnecessary reference count increase by creating
a copy. That still nullifies the original PassRefPtr, but that's not a problem anymore.

* dom/ScopedEventQueue.cpp:
(WebCore::ScopedEventQueue::dispatchEvent):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Static assertions in WTF::adoptPtr should point to using adoptRef for ref-counted objects
https://bugs.webkit.org/show_bug.cgi?id=122745

Reviewed by Anders Carlsson.

* wtf/PassOwnPtr.h:
(WTF::adoptPtr): When the object's type is convertible to the RefCountedBase or ThreadSafeRefCountedBase type,
the static assertion should note that adoptRef should be used instead.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed EFL gardening

Added new baselines for tests marked as skipped.

* platform/efl-wk1/TestExpectations:
* platform/efl/TestExpectations:
* platform/efl/compositing/overflow/nested-scrolling-expected.txt: Added.
* platform/efl/compositing/overflow/remove-overflow-crash2-expected.png: Added.
* platform/efl/compositing/overflow/remove-overflow-crash2-expected.txt: Added.
* platform/efl/editing/spelling/inline-spelling-markers-hidpi-expected.png: Added.
* platform/efl/editing/unsupported-content/list-delete-001-expected.png:
* platform/efl/editing/unsupported-content/list-delete-001-expected.txt: Added.
* platform/efl/editing/unsupported-content/list-delete-003-expected.png:
* platform/efl/editing/unsupported-content/list-delete-003-expected.txt: Added.
* platform/efl/editing/unsupported-content/list-type-after-expected.png:
* platform/efl/editing/unsupported-content/list-type-after-expected.txt: Added.
* platform/efl/editing/unsupported-content/table-delete-002-expected.png:
* platform/efl/editing/unsupported-content/table-delete-002-expected.txt: Added.
* platform/efl/fast/canvas/fill-stroke-clip-reset-path-expected.png: Added.
* platform/efl/fast/table/click-near-anonymous-table-expected.png: Added.
* platform/efl/fast/table/click-near-anonymous-table-expected.txt: Added.
* platform/efl/fast/text/international/arabic-justify-expected.png: Added.
* platform/efl/fast/text/international/arabic-justify-expected.txt: Added.
* platform/efl/fast/text/international/bidi-linebreak-001-expected.png: Added.
* platform/efl/fast/text/international/bidi-linebreak-001-expected.txt: Added.
* platform/efl/fast/text/international/bidi-linebreak-002-expected.png: Added.
* platform/efl/fast/text/international/bidi-linebreak-002-expected.txt: Added.
* platform/efl/fast/text/international/bidi-linebreak-003-expected.png: Added.
* platform/efl/fast/text/international/bidi-linebreak-003-expected.txt: Added.
* platform/efl/fast/text/unicode-variation-selector-expected.png: Added.
* platform/efl/fast/text/unicode-variation-selector-expected.txt: Added.
* platform/efl/media/video-colorspace-yuv420-expected.png: Added.
* platform/efl/media/video-colorspace-yuv420-expected.txt: Added.
* platform/efl/media/video-colorspace-yuv422-expected.png: Added.
* platform/efl/media/video-colorspace-yuv422-expected.txt: Added.
* platform/efl/svg/as-image/image-respects-deviceScaleFactor-expected.png: Added.
* platform/efl/svg/as-image/image-respects-deviceScaleFactor-expected.txt: Added.
* platform/efl/svg/hixie/data-types/002-expected.png: Added.
* platform/efl/svg/hixie/data-types/002-expected.txt:
* platform/efl/svg/text/non-bmp-positioning-lists-expected.png: Added.
* platform/efl/svg/text/non-bmp-positioning-lists-expected.txt: Added.
* platform/efl/svg/zoom/text/zoom-hixie-mixed-009-expected.png: Added.
* platform/efl/svg/zoom/text/zoom-hixie-mixed-009-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Transition misc cti_op_* JITStubs to JIT operations.
https://bugs.webkit.org/show_bug.cgi?id=122645.

Reviewed by Michael Saboff.

Stubs converted:
    cti_op_check_has_instance
    cti_op_create_arguments
    cti_op_del_by_id
    cti_op_instanceof
    cti_to_object
    cti_op_push_activation
    cti_op_get_pnames
    cti_op_load_varargs

* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsWithExecState):
* jit/JIT.h:
(JSC::JIT::emitStoreCell):
* jit/JITCall.cpp:
(JSC::JIT::compileLoadVarargs):
* jit/JITCall32_64.cpp:
(JSC::JIT::compileLoadVarargs):
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_get_pnames):
(JSC::JIT::emit_op_create_activation):
(JSC::JIT::emit_op_create_arguments):
(JSC::JIT::emitSlow_op_check_has_instance):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_get_argument_by_val):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emitSlow_op_check_has_instance):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emit_op_get_pnames):
(JSC::JIT::emit_op_create_activation):
(JSC::JIT::emit_op_create_arguments):
(JSC::JIT::emitSlow_op_get_argument_by_val):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_del_by_id):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_del_by_id):
* jit/JITStubs.cpp:
* jit/JITStubs.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CTTE: Add more node conversion helpers
https://bugs.webkit.org/show_bug.cgi?id=122737

Reviewed by Darin Adler.

- Factor NODE_TYPE_CASTS into TYPE_CASTS_BASE(ToClassName, FromClassName)
  to allow for DOCUMENT_TYPE_CASTS.
- Replace more static_casts<>.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][Efl][Soup] Make NetworkProcessMainUnix handle proxy settings.
https://bugs.webkit.org/show_bug.cgi?id=118388

Reviewed by Carlos Garcia Campos.

Original patch by Kwang Yul Seo <skyul@company100.net> .

Proxy configuration should honor the no_proxy environment variable
same to WebProcess. It is necessary not to change the current behaviour.
See https://bugs.webkit.org/show_bug.cgi?id=91747 for details.

The following things were fixed by Csaba Osztrogonác:
- moved session variable before #if not to have conflict with https://bugs.webkit.org/show_bug.cgi?id=118343
- added GRefPtr.h include
- fixed ifdef guards

* NetworkProcess/unix/NetworkProcessMainUnix.cpp:
(WebKit::NetworkProcessMain):
Copied from WebProcessMainEfl.cpp.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions] Move style-scoped* tests into fast/regions/style-scoped
https://bugs.webkit.org/show_bug.cgi?id=122741

Reviewed by Darin Adler.

Move files, adjust TestExpectations.

* fast/regions/style-scoped/style-scoped-in-flow-expected.html: Renamed from LayoutTests/fast/regions/style-scoped-in-flow-expected.html.
* fast/regions/style-scoped/style-scoped-in-flow-override-container-style-expected.html: Renamed from LayoutTests/fast/regions/style-scoped-in-flow-override-container-style-expected.html.
* fast/regions/style-scoped/style-scoped-in-flow-override-container-style.html: Renamed from LayoutTests/fast/regions/style-scoped-in-flow-override-container-style.html.
* fast/regions/style-scoped/style-scoped-in-flow-override-region-styling-expected.html: Renamed from LayoutTests/fast/regions/style-scoped-in-flow-override-region-styling-expected.html.
* fast/regions/style-scoped/style-scoped-in-flow-override-region-styling-multiple-regions-expected.html: Renamed from LayoutTests/fast/regions/style-scoped-in-flow-override-region-styling-multiple-regions-expected.html.
* fast/regions/style-scoped/style-scoped-in-flow-override-region-styling-multiple-regions.html: Renamed from LayoutTests/fast/regions/style-scoped-in-flow-override-region-styling-multiple-regions.html.
* fast/regions/style-scoped/style-scoped-in-flow-override-region-styling.html: Renamed from LayoutTests/fast/regions/style-scoped-in-flow-override-region-styling.html.
* fast/regions/style-scoped/style-scoped-in-flow.html: Renamed from LayoutTests/fast/regions/style-scoped-in-flow.html.
* platform/efl/TestExpectations:
* platform/gtk-wk2/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Pass Document directly to anonymous renderer constructors.
<https://webkit.org/b/122752>

Reviewed by Antti Koivisto.

Added separate constructors for creating anonymous renderers that
take a Document& instead of a null Element*/Text*.

Removed setDocumentForAnonymous() and all createAnonymous() helpers.
...and RenderObject::m_node is now a Node&, wohoo!

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FTL should have an inefficient but correct implementation of GetById
https://bugs.webkit.org/show_bug.cgi?id=122740

Reviewed by Mark Hahnenberg.
        
It took some effort to realize that the node->prediction() check in the DFG backends
are completely unnecessary since the ByteCodeParser will always insert a ForceOSRExit
if !prediction.
        
But other than that this was an easy patch.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetById):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileGetById):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] Build fix after r122737.

* dom/Node.h: Add explicit WebCore namespace to macro definition to work around
Visual Studio bug.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Baseline JIT should use the DFG's PutById IC
https://bugs.webkit.org/show_bug.cgi?id=122704

Source/JavaScriptCore: 

Reviewed by Mark Hahnenberg.
        
Mostly no big deal, just removing the old Baseline JIT's put_by_id IC support and forcing
that JIT to use the DFG's (i.e. JITOperations) PutById IC.
        
The only complicated part was that the PutById operations assumed that we first did a
cell speculation, which the baseline JIT obviously won't do. So I changed all of those
slow paths to deal with EncodedJSValue's.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::resetStubInternal):
* bytecode/PutByIdStatus.cpp:
(JSC::PutByIdStatus::computeFor):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::cachedPutById):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::cachedPutById):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsWithExecState):
* jit/JIT.cpp:
(JSC::PropertyStubCompilationInfo::copyToStubInfo):
* jit/JIT.h:
(JSC::PropertyStubCompilationInfo::PropertyStubCompilationInfo):
(JSC::PropertyStubCompilationInfo::slowCaseInfo):
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOperationWrappers.h:
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::compileGetByIdHotPath):
(JSC::JIT::compileGetByIdSlowCase):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitSlow_op_put_by_id):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::compileGetByIdSlowCase):
(JSC::JIT::emit_op_put_by_id):
(JSC::JIT::emitSlow_op_put_by_id):
* jit/JITStubs.cpp:
* jit/JITStubs.h:
* jit/Repatch.cpp:
(JSC::appropriateGenericPutByIdFunction):
(JSC::appropriateListBuildingPutByIdFunction):
(JSC::resetPutByID):

LayoutTests: 

Reviewed by Mark Hahnenberg.

* js/regress/put-by-id-expected.txt: Added.
* js/regress/put-by-id.html: Added.
* js/regress/script-tests/put-by-id.js: Added.
(foo):
(bar):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove some silly null checks in Element/NamedNodeMap.
<https://webkit.org/b/122767>

Reviewed by Darin Adler.

Make shouldIgnoreAttributeCase() take a const Element&, exposing
some unnecessary null checks.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157412 268f45cc-cd09-0410-ab3c-d52691b4dbfc
llint_slow_path_put_by_id can deadlock on a ConcurrentJITLock
https://bugs.webkit.org/show_bug.cgi?id=122667

Reviewed by Filip Pizlo.

The issue this patch is attempting to fix is that there are places in our codebase
where we acquire the ConcurrentJITLock for a particular CodeBlock, then we do some
operations that can initiate a garbage collection. Garbage collection then calls 
some methods of CodeBlock that also take the ConcurrentJITLock (because they don't
always necessarily run during garbage collection). This causes a deadlock.

To fix this issue, this patch adds a new RAII-style object (DisallowGC) that stores 
into a thread-local field that indicates that it is unsafe to perform any operation 
that could trigger garbage collection on the current thread. In debug builds, 
ConcurrentJITLocker contains one of these DisallowGC objects so that we can eagerly 
detect deadlocks.

This patch also adds a new type of ConcurrentJITLocker, GCSafeConcurrentJITLocker,
which uses the DeferGC mechanism to prevent collections from occurring while the 
lock is held.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* heap/DeferGC.cpp: Added.
* heap/DeferGC.h:
(JSC::DisallowGC::DisallowGC):
(JSC::DisallowGC::~DisallowGC):
(JSC::DisallowGC::isGCDisallowedOnCurrentThread):
(JSC::DisallowGC::initialize):
* jit/JITStubs.cpp:
(JSC::tryCachePutByID):
(JSC::tryCacheGetByID):
(JSC::DEFINE_STUB_FUNCTION):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/ConcurrentJITLock.h:
(JSC::ConcurrentJITLockerBase::ConcurrentJITLockerBase):
(JSC::ConcurrentJITLockerBase::~ConcurrentJITLockerBase):
(JSC::ConcurrentJITLockerBase::unlockEarly):
(JSC::GCSafeConcurrentJITLocker::GCSafeConcurrentJITLocker):
(JSC::ConcurrentJITLocker::ConcurrentJITLocker):
* runtime/InitializeThreading.cpp:
(JSC::initializeThreadingOnce):
* runtime/JSCellInlines.h:
(JSC::allocateCell):
* runtime/Structure.cpp:
(JSC::Structure::materializePropertyMap):
(JSC::Structure::putSpecificValue):
(JSC::Structure::createPropertyMap):
* runtime/Structure.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157413 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Image valued shape-outside shapes should update the layout after the image has been loaded
https://bugs.webkit.org/show_bug.cgi?id=122340

Reviewed by Simon Fraser.

Source/WebCore:

Ensure that the an image-valued shape-outside layout is updated after the image has
been loaded.

Test: http/tests/css/css-image-valued-shape.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::imageChanged): Added code for the shape-outside case.
(WebCore::RenderBlock::updateShapeInsideInfoAfterStyleChange): Ditto.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::~RenderElement): Ditto.
(WebCore::RenderElement::setStyle): Ditto.

LayoutTests:

Verify that an image-valued shape-outside layout is updated after the image has been loaded.

* http/tests/css/css-image-valued-shape-expected.txt: Added.
* http/tests/css/css-image-valued-shape.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r157408): Crashes in RenderFullScreen::wrapRenderer().

Unreviewed crash fix for these two tests:

- fullscreen/full-screen-restrictions.html
- fullscreen/empty-anonymous-block-continuation-crash.html

* rendering/RenderFullScreen.cpp:
(RenderFullScreen::wrapRenderer):

    Get the RenderArena from Document like we did before this patch.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CTTE: NamedNodeMap always has a corresponding Element.
<https://webkit.org/b/122769>

Reviewed by Anders Carlsson.

Made NamedNodeMap::m_element a reference and remove an assertion
that it's never null.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157416 268f45cc-cd09-0410-ab3c-d52691b4dbfc
window.crypto doesn't preserve custom properties
https://bugs.webkit.org/show_bug.cgi?id=122770

Reviewed by Mark Hahnenberg.

Source/WebCore: 

Test: security/crypto-gc.html

Generate isReachableFromOpaqueRoots that makes Crypto live as long as the document
lives (because that's when it's observable through window object).

* page/Crypto.cpp:
(WebCore::Crypto::Crypto):
(WebCore::Crypto::~Crypto):
(WebCore::Crypto::document):
* page/Crypto.h:
(WebCore::Crypto::create):
Made Crypto a ContextDestructionObserver, so that it can report its document to bindings.
Removed ScriptWrappable, because it seems to have served no purpose in this class.

* page/Crypto.idl: Added GenerateIsReachable. Removed ImplementationLacksVTable,
because the class now has a vtable, and can be checked for bindings integrity.

* page/DOMWindow.cpp: (WebCore::DOMWindow::crypto): Pass a document when creating
crypto.

LayoutTests: 

* security/crypto-gc-expected.txt: Added.
* security/crypto-gc.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@157417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[cmake] MediaControlsApple is used only by Efl port and is on CMakeLists.txt
https://bugs.webkit.org/show_bug.cgi?id=122772

Reviewed by Anders Carlsson.

* CMakeLists.txt: Removed MediaControlsApple.cpp
* PlatformEfl.cmake: Added MediaControlsApple.cpp


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