Remove URL decoding in srcset handling
https://bugs.webkit.org/show_bug.cgi?id=121609

Followup to <http://trac.webkit.org/changeset/156161> - that change renamed expected
results, but the new test wasn't landed.

* fast/loader/image-src-encoded.html: Copied from LayoutTests/fast/loader/image-src-question-mark.html.
* fast/loader/image-src-question-mark.html: Removed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156179 268f45cc-cd09-0410-ab3c-d52691b4dbfc
renderStyleOfEnclosingTextNode should update style before using a renderer
https://bugs.webkit.org/show_bug.cgi?id=121690

Reviewed by Enrica Casucci.

Merge https://chromium.googlesource.com/chromium/blink/+/65f089545e8c18cb268dfcbe56cba1cd8045527a

When accessing a renderer editing should always make sure that the style has been updated for the node.
Editing calls splitTextNode in a number of places and then accesses the renderer later. This patch is
the first of many to make sure editing always updates the style before attempting to access the renderer
(or style) of a node after calling a mutation method.

* editing/ApplyBlockElementCommand.cpp:
(WebCore::ApplyBlockElementCommand::renderStyleOfEnclosingTextNode):
* editing/ApplyBlockElementCommand.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156180 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the build after r156144

* html/canvas/CanvasRenderingContext2D.cpp: Added missing include.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156181 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Clean up the Skip* functions in the GObject DOM bindings code generator
https://bugs.webkit.org/show_bug.cgi?id=121633

Reviewed by Gustavo Noronha Silva.

* bindings/scripts/CodeGeneratorGObject.pm:
(SkipAttribute): Fold in some skipping checks that are used by all callers.
(SkipFunction): Ditto.
(GenerateProperties): Rely on SkipAttribute more thoroughly.
(GenerateFunction): Rely on SkipFunction more thoroughly.
(GenerateFunctions): Rely on SkipAttribute more thoroughly.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156182 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r156140): Srcset tests are frequently crashing
https://bugs.webkit.org/show_bug.cgi?id=121695

Reviewed by Dean Jackson.

Returning a string created without copying bytes is not safe. It used to be OK
because a new string was immediately created by decodeURLEscapeSequences().
But even that was not great, because decodeURLEscapeSequences() could potentially
return the same string, not a deep copy, if we decided to optimize it like that.

Also made a number of drive-by style fixes.
- It's URL, not Url.
- It's srcset, not srcSet.
-  We don't add ".0" in floating point value initializers. It's particularly misleading
to initialize a float with 1.0, which is a double value.
- Renamed srcSetLength to srcsetAttributeLength to match srcsetAttribute variable
whose length it caches.

* html/parser/HTMLParserIdioms.cpp:
(WebCore::parseImagesWithScaleFromSrcsetAttribute):
(WebCore::bestFitSourceForImageAttributes):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156183 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move CCallHelpers and AssemblyHelpers into jit/ and have JSInterfaceJIT use them
https://bugs.webkit.org/show_bug.cgi?id=121637

Rubber stamped by Michael Saboff.
        
Also moved GPRInfo/FPRInfo into jit/. Rolling back in after fixing JIT-only build
and tests.

* CMakeLists.txt:
* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* Target.pri:
* bytecode/ValueRecovery.h:
(JSC::ValueRecovery::dumpInContext):
* dfg/DFGAssemblyHelpers.cpp: Removed.
* dfg/DFGAssemblyHelpers.h: Removed.
* dfg/DFGBinarySwitch.h:
* dfg/DFGByteCodeParser.cpp:
* dfg/DFGCCallHelpers.h: Removed.
* dfg/DFGDisassembler.cpp:
* dfg/DFGFPRInfo.h: Removed.
* dfg/DFGGPRInfo.h: Removed.
* dfg/DFGGraph.cpp:
* dfg/DFGGraph.h:
* dfg/DFGJITCompiler.h:
* dfg/DFGOSRExit.cpp:
* dfg/DFGOSRExit.h:
* dfg/DFGOSRExitCompiler.h:
* dfg/DFGOSRExitCompilerCommon.h:
* dfg/DFGRegisterBank.h:
* dfg/DFGRegisterSet.h:
* dfg/DFGRepatch.cpp:
* dfg/DFGSilentRegisterSavePlan.h:
* dfg/DFGThunks.cpp:
* dfg/DFGVariableEvent.cpp:
* ftl/FTLCArgumentGetter.h:
(JSC::FTL::CArgumentGetter::CArgumentGetter):
(JSC::FTL::CArgumentGetter::loadNext8):
(JSC::FTL::CArgumentGetter::loadNext32):
(JSC::FTL::CArgumentGetter::loadNext64):
(JSC::FTL::CArgumentGetter::loadNextPtr):
(JSC::FTL::CArgumentGetter::loadNextDouble):
* ftl/FTLCompile.cpp:
* ftl/FTLExitThunkGenerator.h:
* ftl/FTLLink.cpp:
* ftl/FTLThunks.cpp:
* jit/AssemblyHelpers.cpp: Copied from Source/JavaScriptCore/dfg/DFGAssemblyHelpers.cpp.
* jit/AssemblyHelpers.h: Copied from Source/JavaScriptCore/dfg/DFGAssemblyHelpers.h.
(JSC::AssemblyHelpers::AssemblyHelpers):
(JSC::AssemblyHelpers::debugCall):
* jit/CCallHelpers.h: Copied from Source/JavaScriptCore/dfg/DFGCCallHelpers.h.
* jit/FPRInfo.h: Copied from Source/JavaScriptCore/dfg/DFGFPRInfo.h.
(WTF::printInternal):
* jit/GPRInfo.h: Copied from Source/JavaScriptCore/dfg/DFGGPRInfo.h.
(WTF::printInternal):
* jit/JIT.cpp:
(JSC::JIT::JIT):
* jit/JIT.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::stringGetByValStubGenerator):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::stringGetByValStubGenerator):
* jit/JSInterfaceJIT.h:
(JSC::JSInterfaceJIT::JSInterfaceJIT):
* jit/SpecializedThunkJIT.h:
(JSC::SpecializedThunkJIT::SpecializedThunkJIT):
(JSC::SpecializedThunkJIT::finalize):
* jit/ThunkGenerators.cpp:
(JSC::linkForGenerator):
(JSC::virtualForGenerator):
(JSC::stringLengthTrampolineGenerator):
(JSC::nativeForGenerator):
(JSC::arityFixup):
(JSC::charCodeAtThunkGenerator):
(JSC::charAtThunkGenerator):
(JSC::fromCharCodeThunkGenerator):
(JSC::sqrtThunkGenerator):
(JSC::floorThunkGenerator):
(JSC::ceilThunkGenerator):
(JSC::roundThunkGenerator):
(JSC::expThunkGenerator):
(JSC::logThunkGenerator):
(JSC::absThunkGenerator):
(JSC::powThunkGenerator):
(JSC::imulThunkGenerator):
* llint/LLIntThunks.cpp:
(JSC::LLInt::generateThunkWithJumpTo):
* runtime/JSCJSValue.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156184 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Hiding a focused element should unfocus it and fire a blur event
https://bugs.webkit.org/show_bug.cgi?id=29241

Patch by Arunprasad Rajkumar <ararunprasad@gmail.com> on 2013-09-20
Reviewed by Darin Adler.

Source/WebCore:

Test: fast/dom/HTMLDocument/active-element-gets-unfocusable.html

We check whether the current focus element is really focusable after
the style recalculation and layout change. If it is not focusable then schedule a
timer to reset it asynchronously.

* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::recalcStyle): Check isFocusable() on the focus element after
style recalculation.
(WebCore::Document::updateLayout): Check isFocusable() on the focus element after
layout.
(WebCore::Document::resetHiddenFocusElementSoon):
(WebCore::Document::resetHiddenFocusElementTimer):
* dom/Document.h:

LayoutTests:

* fast/dom/HTMLDocument/active-element-gets-unfocusable-expected.txt: Added.
* fast/dom/HTMLDocument/active-element-gets-unfocusable.html: Added.

LayoutTest reused from https://chromium.googlesource.com/chromium/blink/+/c58f636fd18fc27944c42e27d6a92a36867c57e1
with little modification.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixed img src URLS with multiple spaces
https://bugs.webkit.org/show_bug.cgi?id=121592

Patch by Yoav Weiss <yoav@yoav.ws> on 2013-09-20
Reviewed by Darin Adler.

Source/WebCore:

Test: fast/loader/image-src-multiple-space.html

I've removed the simplifyWhiteSpace step from HTMLImageElement's src attribute during the srcset selection algorithm.
That step prevented URLs with multiple spaces from being loaded as images, minimizing the multiple spaces into a single one.

* html/parser/HTMLParserIdioms.cpp:
(WebCore::bestFitSourceForImageAttributes):

LayoutTests:

This test verifies that URLs with multiple spaces can be loaded as an image resource.

* fast/loader/image-src-multiple-space-expected.txt: Added.
* fast/loader/image-src-multiple-space.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move the SharingRules mode outside of SelectorChecker
https://bugs.webkit.org/show_bug.cgi?id=121652

Reviewed by Antti Koivisto.

The SharingRules handling inside SelectorChecker is a weird hack
to hit a specific branch of ElementRuleCollector.

This patch moves the exception to ElementRuleCollector, where it is easier
to understand what it is for.

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::doCollectMatchingRulesForList):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::match):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156187 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove SelectorChecker's CrossesBoundary boundary mode
https://bugs.webkit.org/show_bug.cgi?id=121653

Reviewed by Antti Koivisto.

This mode is an ancient vestige of shadow dom.

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::match):
(WebCore::SelectorChecker::checkOne):
* css/SelectorChecker.h:


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