UserContentController should keep track of user scripts
https://bugs.webkit.org/show_bug.cgi?id=127317
<rdar://problem/15861296>

Reviewed by Andreas Kling.

Move handling of user scripts from PageGroup to UserContentController.

* page/Frame.cpp:
(WebCore::Frame::injectUserScripts):
* page/PageGroup.cpp:
(WebCore::PageGroup::addUserScriptToWorld):
(WebCore::PageGroup::removeUserScriptFromWorld):
(WebCore::PageGroup::removeUserScriptsFromWorld):
(WebCore::PageGroup::removeAllUserContent):
* page/PageGroup.h:
* page/UserContentController.cpp:
(WebCore::UserContentController::addUserScript):
(WebCore::UserContentController::removeUserScript):
(WebCore::UserContentController::removeUserScripts):
(WebCore::UserContentController::removeAllUserContent):
* page/UserContentController.h:
(WebCore::UserContentController::userScripts):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Do refactor in collectGradientAttributes() and renderStyleForLengthResolve()
https://bugs.webkit.org/show_bug.cgi?id=126869

Reviewed by Dirk Schulze.

Some SVG functions have done a first iteration by using a boolean flag. This is
one of poor implementations. This patch fix it by extracting a logic into a new method.
Additionally it would be good to use do-while() loop instead of using while() in
renderStyleForLengthResolving() because a first condition is always true.

Merge r165358 from blink.

* svg/SVGLengthContext.cpp:
(WebCore::renderStyleForLengthResolving):
* svg/SVGLinearGradientElement.cpp:
(WebCore::setGradientAttributes):
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* svg/SVGRadialGradientElement.cpp:
(WebCore::setGradientAttributes):
(WebCore::SVGRadialGradientElement::collectGradientAttributes):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Amount of scrolling is different from movement of touch when device pixel ratio is not 1.
https://bugs.webkit.org/show_bug.cgi?id=127268

Reviewed by Gyuyoung Kim.

Amount of scrolling should be same with movement of touch even though
device pixel ratio is not 1, so apply device pixel ratio to the new
position of scrollBy().

* UIProcess/API/efl/EwkView.cpp:
(EwkView::scrollBy):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162386 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix an erroneous paste in TestExpectations.

* platform/mac-wk2/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Removing CodeBlock::opDebugBytecodeOffsetForLineAndColumn() and friends.
<https://webkit.org/b/127321>

Reviewed by Geoffrey Garen.

We're changing plans and will be going with CodeBlock level breakpoints
instead of bytecode level breakpoints. As a result, we no longer need
the services of CodeBlock::opDebugBytecodeOffsetForLineAndColumn() (and
friends). This patch will remove that unused code.

* GNUmakefile.list.am:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
* bytecode/CodeBlock.h:
* bytecode/LineColumnInfo.h: Removed.
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::dumpExpressionRangeInfo):
* bytecode/UnlinkedCodeBlock.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
op_captured_mov and op_new_captured_func in UnlinkedCodeBlocks should use the IdentifierMap instead of the strings directly
https://bugs.webkit.org/show_bug.cgi?id=127311
<rdar://problem/15853958>

Reviewed by Andreas Kling.
        
This makes UnlinkedCodeBlocks use 32-bit instruction streams again.

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::CodeBlock):
* bytecode/UnlinkedCodeBlock.h:
(JSC::UnlinkedInstruction::UnlinkedInstruction):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::addVar):
(JSC::BytecodeGenerator::emitInitLazyRegister):
(JSC::BytecodeGenerator::createArgumentsIfNecessary):
* bytecompiler/BytecodeGenerator.h:
(JSC::BytecodeGenerator::watchableVariable):
(JSC::BytecodeGenerator::hasWatchableVariable):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Force float division when calculating CSS px value.

Reviewed by Simon Fraser.

Note that in Python 3, this is the default behavior.

* lldb/lldb_webkit.py:
(WebCoreLayoutUnitProvider.to_string):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
platform/mac/accessibility/iframe-aria-hidden.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=127323

* platform/mac-wk2/TestExpectations: Marked as such.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSC Parser: Shrink BindingNode.
<https://webkit.org/b/127253>

The "divot" and "end" source locations are always identical for
BindingNodes, so store only "start" and "end" instead.

1.19 MB progression on Membuster3.

Reviewed by Geoff Garen.

* bytecompiler/NodesCodegen.cpp:
(JSC::BindingNode::bindValue):
* parser/ASTBuilder.h:
(JSC::ASTBuilder::createBindingLocation):
* parser/NodeConstructors.h:
(JSC::BindingNode::create):
(JSC::BindingNode::BindingNode):
* parser/Nodes.h:
(JSC::BindingNode::divotStart):
(JSC::BindingNode::divotEnd):
* parser/Parser.cpp:
(JSC::Parser<LexerType>::createBindingPattern):
* parser/SyntaxChecker.h:
(JSC::SyntaxChecker::operatorStackPop):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a nicer way to iterate over all the attributes of an element
https://bugs.webkit.org/show_bug.cgi?id=127266

Reviewed by Geoffrey Garen.

When using Element::attributeAt() in a loop, the compiler had to generate two kinds of
accessor:
-If the element data is unique, the length and data comes from the attribute Vector.
-If the element data is shared, the data comes from the tail of elementData itself.

The choice was done for every access, which caused the assembly to be a little
hard to follow.
This patch unify the data access by doing everything as a array pointer with offset (getting
that data from Vector when necessary).

To make it easier to do the right thing, a new iterator was added so that range-based loops
can replace all the faulty cases.

* css/SelectorChecker.cpp:
(WebCore::anyAttributeMatches):
* css/SelectorChecker.h:
(WebCore::SelectorChecker::checkExactAttribute):
* dom/DatasetDOMStringMap.cpp:
(WebCore::DatasetDOMStringMap::getNames):
(WebCore::DatasetDOMStringMap::item):
(WebCore::DatasetDOMStringMap::contains):
* dom/Element.cpp:
(WebCore::Element::normalizeAttributes):
(WebCore::Element::detachAllAttrNodesFromElement):
(WebCore::Element::cloneAttributesFromElement):
* dom/Element.h:
(WebCore::Element::attributesIterator):
* dom/ElementData.cpp:
(WebCore::ElementData::isEquivalent):
(WebCore::ElementData::findAttributeIndexByNameSlowCase):
* dom/ElementData.h:
(WebCore::AttributeConstIterator::AttributeConstIterator):
(WebCore::AttributeConstIterator::operator*):
(WebCore::AttributeConstIterator::operator->):
(WebCore::AttributeConstIterator::operator++):
(WebCore::AttributeConstIterator::operator==):
(WebCore::AttributeConstIterator::operator!=):
(WebCore::AttributeIteratorAccessor::AttributeIteratorAccessor):
(WebCore::AttributeIteratorAccessor::begin):
(WebCore::AttributeIteratorAccessor::end):
(WebCore::ElementData::attributesIterator):
* dom/Node.cpp:
(WebCore::Node::isDefaultNamespace):
(WebCore::Node::lookupNamespaceURI):
(WebCore::Node::lookupNamespacePrefix):
(WebCore::Node::compareDocumentPosition):
* dom/StyledElement.cpp:
(WebCore::StyledElement::makePresentationAttributeCacheKey):
(WebCore::StyledElement::rebuildPresentationAttributeStyle):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendElement):
* editing/markup.cpp:
(WebCore::completeURLs):
(WebCore::StyledMarkupAccumulator::appendElement):
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::parametersForPlugin):
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parametersForPlugin):
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::innerPatchNode):
(WebCore::DOMPatchSupport::createDigest):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setAttributesAsText):
(WebCore::InspectorDOMAgent::buildArrayForElementAttributes):
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::matchesElement):
* page/PageSerializer.cpp:
(WebCore::isCharsetSpecifyingNode):
* xml/XPathNodeSet.cpp:
(WebCore::XPath::NodeSet::traversalSort):
* xml/XPathStep.cpp:
(WebCore::XPath::Step::nodesInAxis):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::XMLDocumentParser):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move user style sheet handling to UserContentController
https://bugs.webkit.org/show_bug.cgi?id=127322
<rdar://problem/15861296>

Reviewed by Andreas Kling.

* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::updateInjectedStyleSheetCache):
* page/PageGroup.cpp:
(WebCore::PageGroup::addUserStyleSheetToWorld):
(WebCore::PageGroup::removeUserStyleSheetFromWorld):
(WebCore::PageGroup::removeUserStyleSheetsFromWorld):
(WebCore::PageGroup::removeAllUserContent):
* page/PageGroup.h:
* page/UserContentController.cpp:
(WebCore::UserContentController::addUserStyleSheet):
(WebCore::UserContentController::removeUserStyleSheet):
(WebCore::UserContentController::removeUserStyleSheets):
(WebCore::UserContentController::removeAllUserContent):
(WebCore::UserContentController::invalidateInjectedStyleSheetCacheInAllFrames):
* page/UserContentController.h:
(WebCore::UserContentController::userStyleSheets):

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