1. 05 Apr, 2013 1 commit
    • kangil.han@samsung.com's avatar
      Prefer prefix ++/-- operators for non-primitive types · d97b4ea1
      kangil.han@samsung.com authored
      https://bugs.webkit.org/show_bug.cgi?id=114033
      
      Reviewed by Alexey Proskuryakov.
      
      Post ++/-- creates a copy of current value and it is not necessary, so use prefix instead.
      
      * bindings/js/Dictionary.cpp:
      (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
      (WebCore::Dictionary::getOwnPropertyNames):
      * bindings/js/ScriptCallStackFactory.cpp:
      (WebCore::createScriptCallStack):
      * dom/ContainerNode.cpp:
      (WebCore::willRemoveChildren):
      * dom/Range.cpp:
      (WebCore::Range::processAncestorsAndTheirSiblings):
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::detachChildren):
      * platform/graphics/gpu/LoopBlinnPathProcessor.cpp:
      (WebCore):
      (WebCore::LoopBlinnPathProcessor::subdivideCurvesSlow):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paintDocumentMarkers):
      * xml/XPathFunctions.cpp:
      (WebCore::XPath::Function::setArguments):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d97b4ea1
  2. 14 Mar, 2013 1 commit
    • inferno@chromium.org's avatar
      Replace static_casts with to* helper functions. · 9aa9e8d7
      inferno@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=112296
      
      Reviewed by Kentaro Hara.
      
      to* helper functions are preferred over static_cast calls since they
      help to catch bad casts easily on the testing infrastructure.
      
      Source/WebCore:
      
      * accessibility/AXObjectCache.cpp:
      (WebCore::nodeHasRole):
      * accessibility/AccessibilityObject.cpp:
      (WebCore::AccessibilityObject::hasAttribute):
      (WebCore::AccessibilityObject::getAttribute):
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::anchorElement):
      (WebCore::AccessibilityRenderObject::helpText):
      (WebCore::AccessibilityRenderObject::checkboxOrRadioRect):
      (WebCore::AccessibilityRenderObject::titleUIElement):
      (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
      (WebCore::AccessibilityRenderObject::accessKey):
      (WebCore::AccessibilityRenderObject::setElementAttributeValue):
      (WebCore::AccessibilityRenderObject::setValue):
      (WebCore::AccessibilityRenderObject::activeDescendant):
      (WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
      (WebCore::AccessibilityRenderObject::correspondingLabelForControlElement):
      (WebCore::AccessibilityRenderObject::inheritsPresentationalRole):
      (WebCore::AccessibilityRenderObject::setAccessibleName):
      (WebCore::AccessibilityRenderObject::stringRoleForMSAA):
      * bindings/gobject/WebKitDOMBinding.cpp:
      (WebKit::createWrapper):
      * bindings/js/JSClipboardCustom.cpp:
      (WebCore::JSClipboard::setDragImage):
      * bindings/js/JSElementCustom.cpp:
      (WebCore::toJSNewlyCreated):
      * bindings/js/JSNodeCustom.cpp:
      (WebCore::createWrapperInline):
      * bindings/v8/custom/V8ClipboardCustom.cpp:
      (WebCore::V8Clipboard::setDragImageMethodCustom):
      * bindings/v8/custom/V8ElementCustom.cpp:
      (WebCore::wrap):
      * bindings/v8/custom/V8NodeCustom.cpp:
      (WebCore::wrap):
      * dom/Document.cpp:
      (WebCore::Document::importNode):
      (WebCore::Document::recalcStyle):
      (WebCore::Document::setFocusedNode):
      (WebCore::Document::updateFocusAppearanceTimerFired):
      * dom/DocumentStyleSheetCollection.cpp:
      (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
      * dom/Element.cpp:
      (WebCore::Element::offsetParent):
      (WebCore::Element::boundsInRootViewSpace):
      (WebCore::Element::getBoundingClientRect):
      (WebCore::Element::recalcStyle):
      (WebCore::Element::computeInheritedLanguage):
      (WebCore::Element::lastElementChild):
      * dom/LiveNodeList.cpp:
      (WebCore::LiveNodeList::namedItem):
      * dom/Node.cpp:
      (WebCore::Node::dumpStatistics):
      (WebCore::Node::normalize):
      (WebCore::Node::rootEditableElement):
      (WebCore::Node::isDefaultNamespace):
      (WebCore::Node::ancestorElement):
      (WebCore::appendAttributeDesc):
      * dom/Position.cpp:
      (WebCore::Position::element):
      * dom/Range.cpp:
      (WebCore::Range::getBorderAndTextQuads):
      * dom/SelectorQuery.cpp:
      (WebCore::SelectorDataList::queryFirst):
      (WebCore::SelectorDataList::execute):
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::recalcStyle):
      * dom/StaticHashSetNodeList.cpp:
      (WebCore::StaticHashSetNodeList::namedItem):
      * editing/ApplyStyleCommand.cpp:
      (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
      (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
      (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
      (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
      * editing/Editor.cpp:
      (WebCore::Editor::applyEditingStyleToBodyElement):
      * editing/FrameSelection.cpp:
      (WebCore::removingNodeRemovesPosition):
      * editing/IndentOutdentCommand.cpp:
      (WebCore::IndentOutdentCommand::outdentParagraph):
      * editing/MarkupAccumulator.cpp:
      (WebCore::MarkupAccumulator::entityMaskForText):
      (WebCore::MarkupAccumulator::appendStartMarkup):
      (WebCore::MarkupAccumulator::appendEndMarkup):
      * editing/ModifySelectionListLevel.cpp:
      (WebCore::IncreaseSelectionListLevelCommand::doApply):
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::haveSameTagName):
      (WebCore::handleStyleSpansBeforeInsertion):
      (WebCore::ReplaceSelectionCommand::doApply):
      * editing/SplitTextNodeContainingElementCommand.cpp:
      (WebCore::SplitTextNodeContainingElementCommand::doApply):
      * editing/TextIterator.cpp:
      (WebCore::TextIterator::advance):
      * editing/htmlediting.cpp:
      (WebCore::unsplittableElementForPosition):
      (WebCore::enclosingTableCell):
      * editing/markup.cpp:
      (WebCore::StyledMarkupAccumulator::wrapWithNode):
      (WebCore::createMarkupInternal):
      (WebCore::createFragmentFromMarkupWithContext):
      (WebCore::isPlainTextMarkup):
      (WebCore::createFragmentFromText):
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::insertAdjacentElement):
      (WebCore::contextElementForInsertion):
      * html/HTMLFormControlElement.cpp:
      (WebCore::focusPostAttach):
      (WebCore::updateFromElementCallback):
      * html/HTMLFormElement.cpp:
      (WebCore::submitElementFromEvent):
      * html/HTMLObjectElement.cpp:
      (WebCore::HTMLObjectElement::updateDocNamedItem):
      * html/HTMLPlugInImageElement.cpp:
      (WebCore::HTMLPlugInImageElement::updateSnapshotInfo):
      * html/HTMLViewSourceDocument.cpp:
      (WebCore::HTMLViewSourceDocument::addRange):
      * html/parser/HTMLTreeBuilder.cpp:
      (WebCore::closestFormAncestor):
      * html/shadow/MediaControlElementTypes.cpp:
      (WebCore::toParentMediaElement):
      * html/shadow/TextFieldDecorationElement.h:
      (WebCore::toTextFieldDecorationElement):
      * inspector/DOMPatchSupport.cpp:
      (WebCore::DOMPatchSupport::createDigest):
      * inspector/InspectorDOMAgent.cpp:
      (WebCore::InspectorDOMAgent::buildObjectForNode):
      (WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
      * inspector/InspectorStyleSheet.cpp:
      (WebCore::InspectorStyleSheet::inlineStyleSheetText):
      * mathml/MathMLElement.h:
      (WebCore::toMathMLElement):
      * page/ContextMenuController.cpp:
      (WebCore::ContextMenuController::populate):
      * page/DragController.cpp:
      (WebCore::elementUnderMouse):
      (WebCore::DragController::startDrag):
      * page/FocusController.cpp:
      (WebCore::FocusController::advanceFocusInDocumentOrder):
      * page/Frame.cpp:
      (WebCore::Frame::searchForLabelsBeforeElement):
      * page/FrameView.cpp:
      (WebCore::FrameView::updateWidget):
      * page/SpatialNavigation.cpp:
      (WebCore::rectToAbsoluteCoordinates):
      * page/animation/ImplicitAnimation.cpp:
      (WebCore::ImplicitAnimation::sendTransitionEvent):
      * page/animation/KeyframeAnimation.cpp:
      (WebCore::KeyframeAnimation::KeyframeAnimation):
      (WebCore::KeyframeAnimation::sendAnimationEvent):
      * platform/efl/RenderThemeEfl.cpp:
      (WebCore::RenderThemeEfl::paintMediaFullscreenButton):
      (WebCore::RenderThemeEfl::paintMediaMuteButton):
      * rendering/FilterEffectRenderer.cpp:
      (WebCore::FilterEffectRenderer::buildReferenceFilter):
      * rendering/svg/RenderSVGViewportContainer.cpp:
      (WebCore::RenderSVGViewportContainer::calcViewport):
      * svg/SVGSVGElement.cpp:
      (WebCore::SVGSVGElement::getElementById):
      * svg/SVGUseElement.cpp:
      (WebCore::isDisallowedElement):
      * svg/animation/SVGSMILElement.cpp:
      (WebCore::SVGSMILElement::buildPendingResource):
      * xml/XPathStep.cpp:
      (WebCore::XPath::nodeMatchesBasicTest):
      * xml/parser/XMLDocumentParserQt.cpp:
      (WebCore::XMLDocumentParser::XMLDocumentParser):
      (WebCore::XMLDocumentParser::parseEndElement):
      
      Source/WebKit/blackberry:
      
      * Api/WebPage.cpp:
      (BlackBerry::WebKit::WebPagePrivate::webContext):
      (BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
      (BlackBerry::WebKit::WebPage::setNodeFocus):
      (BlackBerry::WebKit::WebPagePrivate::adjustFullScreenElementDimensionsIfNeeded):
      * WebCoreSupport/EditorClientBlackBerry.cpp:
      (WebCore::EditorClientBlackBerry::shouldSpellCheckFocusedField):
      (WebCore::EditorClientBlackBerry::shouldChangeSelectedRange):
      * WebKitSupport/BackingStoreClient.cpp:
      (BlackBerry::WebKit::BackingStoreClient::absoluteRect):
      * WebKitSupport/DOMSupport.cpp:
      (BlackBerry::WebKit::DOMSupport::toTextControlElement):
      (BlackBerry::WebKit::DOMSupport::selectionContainerElement):
      * WebKitSupport/FatFingers.cpp:
      (BlackBerry::WebKit::FatFingers::getRelevantInfoFromCachedHitTest):
      (BlackBerry::WebKit::FatFingers::setSuccessfulFatFingersResult):
      * WebKitSupport/InputHandler.cpp:
      (BlackBerry::WebKit::InputHandler::focusedNodeChanged):
      (BlackBerry::WebKit::InputHandler::willOpenPopupForNode):
      * WebKitSupport/SelectionHandler.cpp:
      (BlackBerry::WebKit::SelectionHandler::inputNodeOverridesTouch):
      * WebKitSupport/TouchEventHandler.cpp:
      (BlackBerry::WebKit::elementForTapHighlight):
      
      Source/WebKit/chromium:
      
      * src/WebDocument.cpp:
      (WebKit::WebDocument::images):
      * src/WebElement.cpp:
      (WebKit::WebElement::operator PassRefPtr<Element>):
      * src/WebPageSerializer.cpp:
      (WebCore::retrieveResourcesForFrame):
      * src/WebViewImpl.cpp:
      (WebKit::WebViewImpl::setFocus):
      (WebKit::WebViewImpl::clearFocusedNode):
      (WebKit::WebViewImpl::scrollFocusedNodeIntoView):
      (WebKit::WebViewImpl::scrollFocusedNodeIntoRect):
      
      Source/WebKit/gtk:
      
      * webkit/webkitwebview.cpp:
      (webkit_web_view_query_tooltip):
      
      Source/WebKit/mac:
      
      * WebCoreSupport/WebFrameLoaderClient.mm:
      (applyAppleDictionaryApplicationQuirkNonInlinePart):
      * WebView/WebHTMLRepresentation.mm:
      (searchForLabelsBeforeElement):
      
      Source/WebKit/qt:
      
      * Api/qwebelement.cpp:
      (QWebElement::firstChild):
      (QWebElement::lastChild):
      (QWebElement::nextSibling):
      (QWebElement::previousSibling):
      (QWebElementCollection::at):
      (QWebElementCollection::toList):
      * WebCoreSupport/QWebFrameAdapter.cpp:
      (QWebHitTestResultPrivate::elementForInnerNode):
      
      Source/WebKit/win:
      
      * WebView.cpp:
      (WebView::enterFullscreenForNode):
      
      Source/WebKit2:
      
      * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
      (WebKit::InjectedBundleNodeHandle::elementBounds):
      * WebProcess/WebPage/WebFrame.cpp:
      (WebKit::WebFrame::containsAnyFormElements):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@145818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9aa9e8d7
  3. 06 Mar, 2013 1 commit
    • tkent@chromium.org's avatar
      Rename WebCore/editing/visible_units.* to VisibleUnits.* · 8c35c12b
      tkent@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=111426
      
      Reviewed by Alexey Proskuryakov.
      
      Source/WebCore: 
      
      No new tests. Just a refactoring.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.vcxproj/WebCore.vcxproj:
      * WebCore.vcxproj/WebCore.vcxproj.filters:
      * WebCore.xcodeproj/project.pbxproj:
      * accessibility/AccessibilityNodeObject.cpp:
      * accessibility/AccessibilityObject.cpp:
      * accessibility/AccessibilityRenderObject.cpp:
      * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
      * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
      * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
      * dom/Position.cpp:
      * dom/Range.cpp:
      * editing/AlternativeTextController.cpp:
      * editing/ApplyBlockElementCommand.cpp:
      * editing/ApplyStyleCommand.cpp:
      * editing/CompositeEditCommand.cpp:
      * editing/DeleteSelectionCommand.cpp:
      * editing/EditingAllInOne.cpp:
      * editing/EditingStyle.cpp:
      * editing/Editor.cpp:
      * editing/FormatBlockCommand.cpp:
      * editing/FrameSelection.cpp:
      * editing/IndentOutdentCommand.cpp:
      * editing/InsertLineBreakCommand.cpp:
      * editing/InsertListCommand.cpp:
      * editing/InsertParagraphSeparatorCommand.cpp:
      * editing/InsertTextCommand.cpp:
      * editing/ReplaceSelectionCommand.cpp:
      * editing/SurroundingText.cpp:
      * editing/TextCheckingHelper.cpp:
      * editing/TextIterator.cpp:
      * editing/TypingCommand.cpp:
      * editing/VisiblePosition.cpp:
      * editing/VisibleSelection.cpp:
      * editing/VisibleUnits.cpp: Copied from Source/WebCore/editing/visible_units.cpp.
      * editing/VisibleUnits.h: Copied from Source/WebCore/editing/visible_units.h.
      * editing/htmlediting.cpp:
      * editing/markup.cpp:
      * editing/visible_units.cpp: Removed.
      * editing/visible_units.h: Removed.
      * page/Frame.cpp:
      * page/mac/FrameMac.mm:
      * platform/win/EditorWin.cpp:
      
      Source/WebKit/mac: 
      
      * WebView/WebFrame.mm:
      
      Source/WebKit2: 
      
      * WebProcess/WebPage/mac/WebPageMac.mm:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@144911 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8c35c12b
  4. 10 Dec, 2012 1 commit
    • antti@apple.com's avatar
      Factor node traversal into standalone functions · 5d47b589
      antti@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=104507
      
      Source/WebCore: 
      
      Reviewed by Eric Seidel.
      
      Node traversal functions are currently Node and ContainerNode members. Their implementations
      are confusingly scattered over multiple header and source files. These functions have no particular
      reason to be members as they don't require non-public access. They should be made freestanding
      function instead and gathered together.
              
      This patch adds NodeTraversal namespace, defined in NodeTraversal.h. It contains freestanding
      functions for traversing Nodes. Most popular functions are inlined (as before) and
      there are ContainerNode specific specializations (as before).
              
      In client code
              
          node = node->traverseNextNode();
          node = node->traverseNextSibling();
              
      becomes
              
          node = NodeTraversal::next(node);
          node = NodeTraversal::nextSkippingChildren(node);
                  
      etc.
      
      * WebCore.exp.in:
      * WebCore.xcodeproj/project.pbxproj:
      * accessibility/AccessibilityNodeObject.cpp:
      (WebCore::AccessibilityNodeObject::accessibilityDescriptionForElements):
      * accessibility/AccessibilityObject.cpp:
      (WebCore::AccessibilityObject::firstAccessibleObjectFromNode):
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::addImageMapChildren):
      * bindings/js/JSDocumentCustom.cpp:
      (WebCore::toJS):
      * css/SelectorChecker.cpp:
      (WebCore::SelectorChecker::allVisitedStateChanged):
      (WebCore::SelectorChecker::visitedStateChanged):
      * css/StyleInvalidationAnalysis.cpp:
      (WebCore::StyleInvalidationAnalysis::invalidateStyle):
      * dom/ContainerNode.cpp:
      (WebCore::dispatchChildInsertionEvents):
      (WebCore::dispatchChildRemovalEvents):
      * dom/ContainerNode.h:
      (ContainerNode):
      (WebCore):
      * dom/ContainerNodeAlgorithms.h:
      (WebCore::ChildFrameDisconnector::collectDescendant):
      * dom/Document.cpp:
      (WebCore::Document::buildAccessKeyMap):
      (WebCore::Document::removeAllEventListeners):
      (WebCore::Document::updateBaseURL):
      (WebCore::Document::processBaseElement):
      (WebCore::Document::nodeAbsIndex):
      (WebCore::Document::nodeWithAbsIndex):
      (WebCore::Document::getFocusableNodes):
      * dom/DocumentMarkerController.cpp:
      (WebCore::DocumentMarkerController::markersInRange):
      (WebCore::DocumentMarkerController::setMarkersActive):
      (WebCore::DocumentMarkerController::hasMarkers):
      (WebCore::DocumentMarkerController::clearDescriptionOnMarkersIntersectingRange):
      * dom/DocumentOrderedMap.cpp:
      (WebCore::DocumentOrderedMap::get):
      * dom/ElementShadow.cpp:
      (WebCore::ElementShadow::collectSelectFeatureSetFrom):
      * dom/Node.cpp:
      (WebCore::Node::normalize):
      (WebCore::Node::lazyAttach):
      (WebCore):
      (WebCore::Node::detach):
      (WebCore::traverseTreeAndMark):
      * dom/Node.h:
      (Node):
      * dom/NodeIterator.cpp:
      (WebCore::NodeIterator::NodePointer::moveToNext):
      (WebCore::NodeIterator::NodePointer::moveToPrevious):
      (WebCore::NodeIterator::updateForNodeRemoval):
      * dom/NodeTraversal.h: Added.
      (WebCore):
      (NodeTraversal):
      (WebCore::NodeTraversal::traverseNextNodeTemplate):
      (WebCore::NodeTraversal::next):
      (WebCore::NodeTraversal::traverseNextSiblingTemplate):
      (WebCore::NodeTraversal::nextSibling):
      * dom/Range.cpp:
      (WebCore::Range::toString):
      (WebCore::Range::checkDeleteExtract):
      (WebCore::Range::firstNode):
      (WebCore::Range::pastLastNode):
      (WebCore::Range::textRects):
      (WebCore::Range::textQuads):
      (WebCore::Range::getBorderAndTextQuads):
      * dom/TreeScope.cpp:
      (WebCore::TreeScope::labelElementForId):
      (WebCore::TreeScope::findAnchor):
      * dom/TreeScopeAdopter.cpp:
      (WebCore::TreeScopeAdopter::moveTreeToNewScope):
      (WebCore::TreeScopeAdopter::moveTreeToNewDocument):
      * dom/TreeWalker.cpp:
      (WebCore::TreeWalker::nextNode):
      * editing/ApplyStyleCommand.cpp:
      (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
      (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
      (WebCore::containsNonEditableRegion):
      (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
      (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle):
      (WebCore::ApplyStyleCommand::removeInlineStyle):
      * editing/BreakBlockquoteCommand.cpp:
      (WebCore::BreakBlockquoteCommand::doApply):
      * editing/CompositeEditCommand.cpp:
      (WebCore::CompositeEditCommand::deleteInsignificantText):
      (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
      * editing/DeleteSelectionCommand.cpp:
      (WebCore::firstEditablePositionInNode):
      (WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
      (WebCore::DeleteSelectionCommand::handleGeneralDelete):
      * editing/EditCommand.cpp:
      (WebCore::SimpleEditCommand::addNodeAndDescendants):
      * editing/EditingStyle.cpp:
      (WebCore::EditingStyle::triStateOfStyle):
      (WebCore::EditingStyle::textDirectionForSelection):
      * editing/Editor.cpp:
      (WebCore::Editor::simplifyMarkup):
      * editing/FrameSelection.cpp:
      (WebCore::scanForForm):
      (WebCore::FrameSelection::setSelectionFromNone):
      * editing/InsertParagraphSeparatorCommand.cpp:
      (WebCore::InsertParagraphSeparatorCommand::doApply):
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::ReplacementFragment::removeUnrenderedNodes):
      (WebCore::ReplacementFragment::removeInterchangeNodes):
      (WebCore::ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren):
      (WebCore::ReplaceSelectionCommand::InsertedNodes::willRemoveNode):
      (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
      (WebCore::removeHeadContents):
      (WebCore::ReplaceSelectionCommand::handleStyleSpans):
      * editing/ReplaceSelectionCommand.h:
      (WebCore::ReplaceSelectionCommand::InsertedNodes::pastLastLeaf):
      * editing/SimplifyMarkupCommand.cpp:
      (WebCore::SimplifyMarkupCommand::doApply):
      * editing/TextIterator.cpp:
      (WebCore::TextIterator::advance):
      (WebCore::shouldEmitNewlineAfterNode):
      * editing/htmlediting.cpp:
      (WebCore::hasARenderedDescendant):
      * editing/mac/EditorMac.mm:
      (WebCore::Editor::fontForSelection):
      * editing/markup.cpp:
      (WebCore::completeURLs):
      (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
      (WebCore::findNodesSurroundingContext):
      (WebCore::trimFragment):
      * editing/visible_units.cpp:
      (WebCore::startOfParagraph):
      (WebCore::endOfParagraph):
      * html/HTMLCollection.cpp:
      (WebCore::nextNode):
      * html/HTMLElement.cpp:
      (WebCore::setHasDirAutoFlagRecursively):
      (WebCore::HTMLElement::directionality):
      (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged):
      (WebCore::HTMLElement::getItemRefElements):
      * html/HTMLFieldSetElement.cpp:
      (WebCore::HTMLFieldSetElement::invalidateDisabledStateUnder):
      (WebCore::HTMLFieldSetElement::refreshElementsIfNeeded):
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::formElementIndex):
      * html/HTMLLabelElement.cpp:
      (WebCore::HTMLLabelElement::control):
      * html/HTMLLegendElement.cpp:
      (WebCore::HTMLLegendElement::associatedControl):
      * html/HTMLMapElement.cpp:
      (WebCore::HTMLMapElement::mapMouseEvent):
      * html/HTMLNameCollection.cpp:
      (WebCore::HTMLNameCollection::virtualItemAfter):
      * html/HTMLOptionElement.cpp:
      (WebCore::HTMLOptionElement::collectOptionInnerText):
      * html/HTMLPropertiesCollection.cpp:
      (WebCore::nextNodeWithProperty):
      * html/HTMLSelectElement.cpp:
      (WebCore::HTMLSelectElement::recalcListItems):
      * html/HTMLTextFormControlElement.cpp:
      (WebCore::HTMLTextFormControlElement::selection):
      (WebCore::HTMLTextFormControlElement::innerTextValue):
      (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks):
      * html/RadioInputType.cpp:
      (WebCore::RadioInputType::handleKeydownEvent):
      * html/shadow/ContentDistributor.cpp:
      (WebCore::ShadowRootContentDistributionData::ensureInsertionPointList):
      * inspector/InspectorDOMAgent.cpp:
      (WebCore::InspectorDOMAgent::performSearch):
      * inspector/InspectorMemoryAgent.cpp:
      * page/FocusController.cpp:
      (WebCore::FocusController::findFocusCandidateInContainer):
      * page/Frame.cpp:
      (WebCore::Frame::searchForLabelsAboveCell):
      (WebCore::Frame::searchForLabelsBeforeElement):
      * rendering/RenderNamedFlowThread.cpp:
      (WebCore::RenderNamedFlowThread::getRanges):
      * svg/SVGSVGElement.cpp:
      (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
      (WebCore::SVGSVGElement::getElementById):
      * svg/SVGUseElement.cpp:
      (WebCore::removeDisallowedElementsFromSubtree):
      * svg/animation/SMILTimeContainer.cpp:
      (WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
      * xml/XPathNodeSet.cpp:
      (WebCore::XPath::NodeSet::traversalSort):
      * xml/XPathStep.cpp:
      (WebCore::XPath::Step::nodesInAxis):
      * xml/XPathUtil.cpp:
      (WebCore::XPath::stringValue):
      
      Source/WebKit/chromium: 
      
      Reviewed by Eric Seidel.
      
      * src/WebFrameImpl.cpp:
      (WebKit::WebFrameImpl::setFindEndstateFocusAndSelection):
      
      Source/WebKit/mac: 
      
      Reviewed by Eric Seidel.
          
      * WebView/WebHTMLRepresentation.mm:
      (searchForLabelsBeforeElement):
      
      Source/WebKit2: 
      
      Reviewed by Eric Seidel.
      
      * WebProcess/WebPage/WebFrame.cpp:
      (WebKit::WebFrame::containsAnyFormElements):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5d47b589
  5. 07 Dec, 2012 1 commit
    • morrita@google.com's avatar
      [Shadow DOM] Implement Element::shadowRoot with prefix · 3981fd79
      morrita@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=102912
      
      Reviewed by Dimitri Glazkov.
      
      - Added Element::shadowRoot() which return the youngest author shadow root.
      - Renamed existing Node::shadowRoot() to containingShadowRoot() to avoid name shadowing.
        The name shadowRoot() is confusing anyway so this is good opportunity to rename it.
      
      Test: fast/dom/shadow/shadow-aware-shadow-root.html
      
      * css/SelectorChecker.cpp:
      (WebCore::SelectorChecker::checkSelector):
      * css/StyleScopeResolver.cpp:
      (WebCore::StyleScopeResolver::scopeFor):
      (WebCore::StyleScopeResolver::addHostRule):
      * dom/Element.cpp:
      (WebCore::Element::shadowRoot):
      (WebCore):
      * dom/Element.h:
      (Element):
      * dom/Element.idl:
      * dom/ElementShadow.cpp:
      (WebCore::ElementShadow::setShouldCollectSelectFeatureSet):
      * dom/Node.cpp:
      (WebCore::Node::rendererIsEditable):
      (WebCore::Node::shadowHost):
      (WebCore::Node::shadowAncestorNode):
      (WebCore::Node::containingShadowRoot):
      * dom/Node.h:
      (Node):
      * dom/Range.cpp:
      (WebCore::Range::shadowRoot):
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::insertedInto):
      (WebCore::ShadowRoot::removedFrom):
      * dom/ShadowRoot.h:
      (WebCore::ShadowRoot::isAccessible):
      * editing/TextIterator.cpp:
      (WebCore::TextIterator::handleReplacedElement):
      * editing/htmlediting.cpp:
      (WebCore::indexForVisiblePosition):
      * html/HTMLStyleElement.cpp:
      (WebCore::HTMLStyleElement::scopedAttributeChanged):
      (WebCore::HTMLStyleElement::registerWithScopingNode):
      (WebCore::HTMLStyleElement::removedFrom):
      * html/shadow/ContentDistributor.cpp:
      (WebCore::ContentDistributor::distribute):
      * html/shadow/HTMLContentElement.cpp:
      (WebCore::HTMLContentElement::parseAttribute):
      (WebCore::HTMLContentElement::insertedInto):
      (WebCore::HTMLContentElement::removedFrom):
      * html/shadow/HTMLShadowElement.cpp:
      (WebCore::HTMLShadowElement::insertedInto):
      (WebCore::HTMLShadowElement::removedFrom):
      * html/shadow/InsertionPoint.cpp:
      (WebCore::InsertionPoint::attach):
      (WebCore::InsertionPoint::detach):
      (WebCore::InsertionPoint::isActive):
      (WebCore::InsertionPoint::childrenChanged):
      (WebCore::InsertionPoint::insertedInto):
      (WebCore::InsertionPoint::removedFrom):
      (WebCore::InsertionPoint::setResetStyleInheritance):
      * page/EventHandler.cpp:
      (WebCore::instanceAssociatedWithShadowTreeElement):
      * svg/SVGElement.cpp:
      (WebCore::SVGElement::correspondingElement):
      (WebCore::collectInstancesForSVGElement):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3981fd79
  6. 26 Nov, 2012 1 commit
  7. 09 Sep, 2012 1 commit
    • paroga@webkit.org's avatar
      Add StringBuilder::appendNumber() and use it · 4d255977
      paroga@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=96030
      
      Reviewed by Eric Seidel.
      
      Also fix a bunch of append() vs. appendLiteral() issues in the surrounding code.
      
      Source/JavaScriptCore:
      
      * API/JSContextRef.cpp:
      (JSContextCreateBacktrace):
      * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
      * interpreter/Interpreter.h:
      (JSC::StackFrame::toString):
      
      Source/WebCore:
      
      * Modules/websockets/WebSocketHandshake.cpp:
      (WebCore::hostName):
      * bindings/v8/ScriptController.cpp:
      (WebCore::resourceString):
      * css/FontFeatureValue.cpp:
      (WebCore::FontFeatureValue::customCssText):
      * dom/Position.cpp:
      (WebCore::Position::formatForDebugger):
      * dom/Range.cpp:
      (WebCore::Range::formatForDebugger):
      * html/FormController.cpp:
      (WebCore::FormKeyGenerator::formKey):
      * html/HTMLAnchorElement.cpp:
      (WebCore::appendServerMapMousePosition):
      * html/canvas/CanvasRenderingContext2D.cpp:
      (WebCore::CanvasRenderingContext2D::font):
      * inspector/IdentifiersFactory.cpp:
      (WebCore::IdentifiersFactory::addProcessIdPrefixTo):
      * page/FrameTree.cpp:
      (WebCore::FrameTree::uniqueChildName):
      * page/SecurityOrigin.cpp:
      (WebCore::SecurityOrigin::toRawString):
      * platform/Decimal.cpp:
      (WebCore::Decimal::toString):
      * platform/network/ProxyServer.cpp:
      (WebCore::appendProxyServerString):
      * platform/text/TextStream.cpp:
      (WebCore::TextStream::operator<<):
      * platform/text/TextStream.h:
      * rendering/RenderTreeAsText.cpp:
      (WebCore::nodePosition):
      * xml/XMLErrors.cpp:
      (WebCore::XMLErrors::appendErrorMessage):
      
      Source/WTF:
      
      * wtf/DateMath.cpp:
      (WTF::makeRFC2822DateString):
      * wtf/text/StringBuilder.cpp:
      (WTF::StringBuilder::appendNumber):
      * wtf/text/StringBuilder.h:
      (StringBuilder):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@128014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4d255977
  8. 06 Sep, 2012 1 commit
    • abarth@webkit.org's avatar
      More fixes for String::operator+=() in Debug mode · 0f5af050
      abarth@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=95888
      
      Patch by Patrick Gansterer <paroga@webkit.org> on 2012-09-06
      Reviewed by Adam Barth.
      
      Use StringBuilder to concatenate strings instead of operator+=().
      
      * dom/Element.cpp:
      (WebCore::Element::formatForDebugger):
      * dom/Node.cpp:
      (WebCore::appendAttributeDesc):
      (WebCore::Node::showNode):
      (WebCore::traverseTreeAndMark):
      (WebCore::Node::formatForDebugger):
      * dom/Position.cpp:
      (WebCore::Position::formatForDebugger):
      * dom/Range.cpp:
      (WebCore):
      (WebCore::Range::formatForDebugger):
      * dom/Text.cpp:
      (WebCore::Text::formatForDebugger):
      * editing/VisibleSelection.cpp:
      (WebCore::VisibleSelection::formatForDebugger):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127706 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0f5af050
  9. 20 Aug, 2012 1 commit
    • rniwa@webkit.org's avatar
      Move transformFriendlyBoundingBox out of Range · 6fdbe4a2
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=94366
      
      Source/WebCore: 
      
      Patch by Leandro Gracia Gil <leandrogracia@chromium.org> on 2012-08-20
      Reviewed by Simon Fraser and Ryosuke Niwa.
      
      Bug 93111 introduced a new method in Range called transformFriendlyBoundingBox.
      However, this method should not have been added there in order to reduce the
      dependencies between Range and the rendering code. This patch moves it to a
      static method in RenderObject.
      
      Tests: existing tests, no new feature added by this patch.
      
      * dom/Range.cpp:
      * dom/Range.h:
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::absoluteBoundingBoxRectForRange):
      (WebCore):
      * rendering/RenderObject.h:
      (RenderObject):
      
      Source/WebKit/chromium: 
      
      Patch by Leandro Gracia Gil <leandrogracia@chromium.org> on 2012-08-20
      Reviewed by Ryosuke Niwa.
      
      Update the WebKit code that makes use of transformFriendlyBoundingBox.
      
      * src/FindInPageCoordinates.cpp:
      (WebKit::findInPageRectFromRange):
      * src/WebFrameImpl.cpp:
      (WebKit::WebFrameImpl::find):
      (WebKit::WebFrameImpl::selectFindMatch):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126074 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6fdbe4a2
  10. 13 Aug, 2012 1 commit
  11. 12 Aug, 2012 1 commit
    • leandrogracia@chromium.org's avatar
      [Chromium] Implement the find-in-page match rects API · 5b94144f
      leandrogracia@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=93111
      
      Reviewed by Adam Barth.
      
      Source/WebCore:
      
      Introduce the find-in-page coordinate system. This system tries to solve
      the unintuitive tickmark results presented in pages with multiple frames
      and scrolled contents where the find results might not be in the visible
      area of a frame, which might lead to tickmarks below the container frame.
      
      To achieve this, this coordinate system goes up the render tree
      normalizing the coordinates by the actual contents size of its container.
      This leads to tickmarks scaled to the visible size of their frame
      independently of its scroll. This coordinate system supports also CSS
      scroll:overflow, transforms and the different positions.
      
      Also add an auxiliary method to Range in order to provide a transform
      friendly way to retrieve the absolute coordinates of the enclosing
      bounding box without the adjustment operations that the existing
      enclosingRect method does.
      
      Tested by WebFrameTest WebKit unit test.
      
      * dom/Range.cpp:
      (WebCore::Range::transformFriendlyBoundingBox): add a transform-friendly equivalent of boundingBox.
      (WebCore):
      * dom/Range.h: move boundingBox to the group of non-transform-friendly methods.
      (Range):
      
      Source/WebKit/chromium:
      
      Implement the funcionality of the find-in-page match rects API in WebFrame.
      These methods keep a cache of the match rects in a special coordinate system
      (find-in-page coordinates) and update them on size changes. They also allow
      to recover the match closest to a given point, therefore enabling to move
      to find matches when tapping on their corresponding tickmarks.
      
      * WebKit.gyp: add FindInPageCoordinates.h / cpp.
      * src/ChromeClientImpl.cpp:
      (WebKit::ChromeClientImpl::contentsSizeChanged): propagate didChangeContentsSize to WebFrameImpl.
      * src/FindInPageCoordinates.cpp: Added.
      (WebKit):
      (WebKit::toNormalizedRect): auxiliary internal function.
      (WebKit::findInPageRectFromAbsoluteRect): main coordinate conversion function.
      (WebKit::findInPageRectFromRange): convenience conversion function for Ranges.
      * src/FindInPageCoordinates.h: Added.
      (WebCore):
      (WebKit):
      * src/WebFrameImpl.cpp:
      (WebKit::WebFrameImpl::FindMatch::FindMatch): find matches cache constructor.
      (WebKit):
      (WebKit::WebFrameImpl::find): clear match cache when appropriate and zoom into results on the Android port.
      (WebKit::WebFrameImpl::stopFinding): clear matches cache.
      (WebKit::WebFrameImpl::scopeStringMatches): add new results to the matches cache.
      (WebKit::WebFrameImpl::increaseMatchCount): update the matches cache version.
      (WebKit::WebFrameImpl::resetMatchCount): update the matches cache version.
      (WebKit::WebFrameImpl::findMatchMarkersVersion): new API providing the matches cache version.
      (WebKit::WebFrameImpl::clearFindMatchesCache): internal utility method to reset the matches cache.
      (WebKit::WebFrameImpl::isActiveMatchFrameValid): internal utility method to check if the local frame is still in the frame tree.
      (WebKit::WebFrameImpl::updateFindMatchRects): internal utility method to update the match result rects if required.
      (WebKit::WebFrameImpl::activeFindMatchRect): new API providing the active find match rect in find-in-page coordinates.
      (WebKit::WebFrameImpl::findMatchRects): new API returning the valid match rects in find-in-page coordinates.
      (WebKit::WebFrameImpl::appendFindMatchRects): internal utility method to concatenate the match results of multiple frames.
      (WebKit::WebFrameImpl::selectNearestFindMatch): new API selecting the find match closer to a point in find-in-page coordinates.
      (WebKit::WebFrameImpl::nearestFindMatch): internal utility method to find the nearest find match to a point in a frame.
      (WebKit::WebFrameImpl::selectFindMatch): internal utility method to select a match in the cache.
      (WebKit::WebFrameImpl::WebFrameImpl): initialization of new variables.
      (WebKit::WebFrameImpl::didChangeContentsSize): invalidate the cached match rect coordinates on frame content size changes.
      * src/WebFrameImpl.h:
      (WebCore):
      (WebFrameImpl):
      (WebKit::WebFrameImpl::activeMatchFrame): remove unrequired const.
      (WebKit::WebFrameImpl::activeMatch): expose the range of the active match to allow testing.
      (FindMatch): cache structure for find matches.
      * tests/WebFrameTest.cpp: new test case for find-in-page match rects.
      * tests/data/find_in_page.html: Added. Test case layout.
      * tests/data/find_in_page_frame.html: Added. Test case layout.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@125379 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5b94144f
  12. 02 Aug, 2012 1 commit
    • eae@chromium.org's avatar
      Range::isPointInRange incorrectly throws WRONG_DOCUMENT_ERR · 1de3c0ad
      eae@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=93009
      
      Reviewed by Ojan Vafai.
      
      Source/WebCore: 
      
      The latest working draft of the DOM4 spec has all but killed the
      WRONG_DOCUMENT_ERR exception. Update isPointInRange to return false
      instead of throwing an exception when the range and point are in
      different documents. This matches the Mozilla behavior.
      
      Test: fast/html/range-point-in-range-for-different-documents.html
      
      * dom/Range.cpp:
      (WebCore::Range::isPointInRange):
      Return false instead of throwing WRONG_DOCUMENT_ERR when the point is in
      a different document.
      
      LayoutTests: 
      
      Add test for Range::isPointInRange where the point is in a different
      document than the range.
      
      * fast/dom/move-nodes-across-documents.html: Change expectations for isPointInRange
      * fast/html/range-point-in-range-for-different-documents-expected.txt: Added.
      * fast/html/range-point-in-range-for-different-documents.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@124506 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1de3c0ad
  13. 23 Jul, 2012 1 commit
    • thakis@chromium.org's avatar
      [chromium] Show search tickmarks on css-styled scrollbars · c7ae2b49
      thakis@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=91949
      
      Reviewed by Adrienne Walker.
      
      This is done by letting RenderScrollbarTheme::paintTickmarks()
      delegate to the native ScrollbarTheme. To make this possible,
      move paintTickmarks() from ScrollbarThemeComposite to the
      superclass ScrollbarTheme.
      
      For testing, add internals.addTextMatchMarker() and add a pixel test.
      
      * platform/ScrollbarTheme.h:
      (WebCore::ScrollbarTheme::paintTickmarks):
      Moved paintTickmarks() from ScrollbarThemeComposite to here.
      * platform/ScrollbarThemeComposite.h:
      Remove paintTickmarks().
      * platform/chromium/ScrollbarThemeChromium.cpp:
      (WebCore::ScrollbarThemeChromium::paintTickmarks):
      Switch to drawing tickmarks as vectors, so they can be arbitrarily wide.
      * platform/chromium/ScrollbarThemeChromiumMac.h:
      (ScrollbarThemeChromiumMac):
      Implement paintTickmarks(), so that css-styled scrollbars get tickmarks on mac.
      * platform/chromium/ScrollbarThemeChromiumMac.mm:
      (WebCore::ScrollbarThemeChromiumMac::paint):
      (WebCore::ScrollbarThemeChromiumMac::paintTickmarks):
      Implement paintTickmarks(), so that css-styled scrollbars get tickmarks on mac.
      * rendering/RenderScrollbarTheme.cpp:
      (WebCore::RenderScrollbarTheme::paintTickmarks):
      Delegate to the native ScrollbarTheme for tickmark drawing.
      (WebCore):
      * rendering/RenderScrollbarTheme.h:
      (RenderScrollbarTheme):
      Override paintTickmarks().
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c7ae2b49
  14. 12 Jul, 2012 1 commit
    • eric@webkit.org's avatar
      Incorrect behaviour calling Range setStart or setEnd with boundary in different document · 774f7d40
      eric@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=42517
      
      Reviewed by Ojan Vafai.
      
      Source/WebCore:
      
      Added a new static inline "checkForDifferentRootContainer" to share some code
      and made setStart/setEnd do the right thing in the x-document case.  I removed
      the bogus checks in set*After/set*Before functions, and since they just call
      through to setStart/setEnd, they also now do the right thing.
      
      Test: fast/dom/Range/set-wrong-document-err.html
      
      * dom/Range.cpp:
      (WebCore::checkForDifferentRootContainer):
      (WebCore):
      (WebCore::Range::setStart):
      (WebCore::Range::setEnd):
      (WebCore::Range::setStartAfter):
      (WebCore::Range::setEndBefore):
      (WebCore::Range::setEndAfter):
      (WebCore::Range::setStartBefore):
      
      LayoutTests:
      
      Add a new test to cover this changed behavior, and correct a FIXME in an old test
      which was documenting our incorrect behavior.
      
      * fast/dom/Range/set-wrong-document-err-expected.txt: Added.
      * fast/dom/Range/set-wrong-document-err.html: Added.
      * fast/dom/move-nodes-across-documents.html:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      774f7d40
  15. 07 Jun, 2012 1 commit
    • wangxianzhu@chromium.org's avatar
      Element.getBoundingClientRect() and Element.getClientRects() return incorrect... · 254f322b
      wangxianzhu@chromium.org authored
      Element.getBoundingClientRect() and Element.getClientRects() return incorrect values in frames in a scaled page
      https://bugs.webkit.org/show_bug.cgi?id=88430
      
      Source/WebCore:
      
      Element.getBoudingClientRect() and Element.getClientRects() should not scale back the rects
      if the element is in a frame because page scale only apply to elements in the main frame.
      
      Reviewed by James Robinson.
      
      Tests: fast/dom/Element/scale-page-bounding-client-rect-in-frame.html
             fast/dom/Element/scale-page-client-rects-in-frame.html
      
      * dom/Document.cpp:
      (WebCore):
      (WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale): Extracted from Element.cpp and Range.cpp and fixed issue of pageScale in frames.
      (WebCore::Document::adjustFloatRectForScrollAndAbsoluteZoomAndFrameScale): Extracted from Element.cpp and fixed issue of pageScale in frames.
      * dom/Document.h:
      (WebCore):
      (Document):
      * dom/Element.cpp:
      (WebCore::Element::getClientRects):
      (WebCore::Element::getBoundingClientRect):
      * dom/Range.cpp:
      (WebCore):
      (WebCore::adjustFloatQuadsForScrollAndAbsoluteZoomAndPageScale): Moved into Document and fixed issue of pageScale in frames.
      (WebCore::Range::getBorderAndTextQuads):
      * rendering/RenderObject.h: Removed adjustFloatQuadForPageScale and adjustFloatRectForPageScale because they seem unrelated to RenderObject.
      (WebCore):
      
      LayoutTests:
      
      Reviewed by James Robinson.
      
      * fast/dom/Element/resources/client-rect-frame.html: Added.
      * fast/dom/Element/scale-page-bounding-client-rect-in-frame-expected.txt: Added.
      * fast/dom/Element/scale-page-bounding-client-rect-in-frame.html: Added.
      * fast/dom/Element/scale-page-client-rects-in-frame-expected.txt: Added.
      * fast/dom/Element/scale-page-client-rects-in-frame.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      254f322b
  16. 25 May, 2012 1 commit
    • rniwa@webkit.org's avatar
      createContextualFragment and insertAdjacentHTML should throw syntax error · 77fea98c
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=87454
      
      Reviewed by Darin Adler.
      
      Source/WebCore: 
      
      Before this patch, createContextualFragment threw NOT_SUPPORTED_ERR and insertAdjacentHTML didn't throw any errors.
      Make them throw SYNTAX_ERR to be consistent with the spec and Firefox:
      http://html5.org/specs/dom-parsing.html#parsing
      http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#xml-fragment-parsing-algorithm
      
      Also reduced the code duplication.
      
      Test: fast/dom/xhtml-fragment-parsing-exceptions.xhtml
      
      * dom/Range.cpp:
      (WebCore::Range::createContextualFragment):
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::setInnerHTML): Explicitly pass AllowScriptingContent. 
      * editing/markup.cpp:
      (WebCore::createFragmentFromMarkup):
      (WebCore::createFragmentForInnerOuterHTML): Takes ExceptionCode now.
      (WebCore::createContextualFragment): Share code with createFragmentForInnerOuterHTML
      and propagate the exception code.
      * editing/markup.h:
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::setInnerHTML): Explicitly pass AllowScriptingContent.
      (WebCore::HTMLElement::setOuterHTML): Ditto.
      (WebCore::HTMLElement::insertAdjacentHTML): Ditto; also rename ignoredEc to ignoredEC
      per Darin's comment on the bug 87339.
      
      Source/WebKit/qt: 
      
      Pass an ExceptionCode to createContextualFragment.
      
      * Api/qwebelement.cpp:
      (QWebElement::appendInside):
      (QWebElement::prependInside):
      (QWebElement::prependOutside):
      (QWebElement::appendOutside):
      (QWebElement::encloseContentsWith):
      (QWebElement::encloseWith):
      
      LayoutTests: 
      
      Add a regression test, and rebaselined the existing tests since we throw
      DOMException.SYNTAX_ERR instead of DOMException.INVALID_STATE_ERR.
      
      * fast/dom/xhtml-fragment-parsing-exceptions-expected.txt: Added.
      * fast/dom/xhtml-fragment-parsing-exceptions.xhtml: Added.
      * fast/innerHTML/innerHTML-changing-document-properties-expected.txt:
      * fast/parser/xhtml-innerhtml-null-byte-first.xhtml:
      * fast/parser/xhtml-innerhtml-null-byte.xhtml:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      77fea98c
  17. 24 May, 2012 1 commit
    • rniwa@webkit.org's avatar
      There are too many poorly named functions to create a fragment from markup · 3976f1be
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=87339
      
      Reviewed by Eric Seidel.
      
      Source/WebCore:
      
      Moved all functions that create a fragment from markup to markup.h/cpp.
      There should be no behavioral change.
      
      * dom/Range.cpp:
      (WebCore::Range::createContextualFragment):
      * dom/Range.h: Removed createDocumentFragmentForElement.
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::setInnerHTML):
      * editing/markup.cpp:
      (WebCore::createFragmentFromMarkup):
      (WebCore::createFragmentForInnerOuterHTML): Renamed from createFragmentFromSource.
      (WebCore::createFragmentForTransformToFragment): Moved from XSLTProcessor.
      (WebCore::removeElementPreservingChildren): Moved from Range.
      (WebCore::createContextualFragment): Ditto.
      * editing/markup.h:
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::setInnerHTML):
      (WebCore::HTMLElement::setOuterHTML):
      (WebCore::HTMLElement::insertAdjacentHTML):
      * inspector/DOMPatchSupport.cpp:
      (WebCore::DOMPatchSupport::patchNode): Added a FIXME since this code should be using
      one of the functions listed in markup.h
      * xml/XSLTProcessor.cpp:
      (WebCore::XSLTProcessor::transformToFragment):
      
      Source/WebKit/qt:
      
      Replace calls to Range::createDocumentFragmentForElement by calls to
      createContextualDocumentFragment.
      
      * Api/qwebelement.cpp:
      (QWebElement::appendInside):
      (QWebElement::prependInside):
      (QWebElement::prependOutside):
      (QWebElement::appendOutside):
      (QWebElement::encloseContentsWith):
      (QWebElement::encloseWith):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@118414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3976f1be
  18. 21 May, 2012 1 commit
    • rniwa@webkit.org's avatar
      Using createContextualFragment to insert a <script> does not cause the script to execute · 354eec62
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=12234
      
      Reviewed by Adam Barth.
      
      Source/WebCore: 
      
      Renamed FragmentScriptingAllowed and FragmentScriptingNotAllowed to DisallowScriptingContent
      and AllowScriptingContent as these two flags are used in code for non-fragment cases and they
      indicate whether attributes and elements that can invoke scripting should be removed or not.
      
      To fix the bug, added a new value AllowScriptingContentAndDoNotMarkAlreadyStarted unset
      already-started and parser-inserted flags [1] on script elements in addition to allowing
      scripting contents.
      
      While the HTML5 specification and the DOM Parsing and Serialization specification [2] state that
      we should set these flags in the parser and later unset them, doing so would require traversing
      the parsed fragment to find relevant script elements. We short circuit this logic by simply not
      setting parser-inserted and already-started flags in createContextualFragment.
      
      [1] http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#already-started
      [2] http://html5.org/specs/dom-parsing.html#dom-range-createcontextualfragment
      
      Tests: fast/dom/Range/create-contextual-fragment-script-not-ran.html
             fast/dom/Range/create-contextual-fragment-script-unmark-already-started.html
      
      * dom/DocumentFragment.h:
      (DocumentFragment):
      * dom/Element.cpp:
      (WebCore::Element::parserSetAttributes):
      (WebCore::Element::setAttributeNS):
      * dom/Element.h:
      (Element):
      * dom/FragmentScriptingPermission.h:
      * dom/Range.cpp:
      (WebCore::Range::createContextualFragment): Removed FragmentScriptingPermission from the argument
      list since no one uses it. Always use AllowScriptingContentAndDoNotMarkAlreadyStarted instead.
      * dom/Range.h:
      * editing/markup.h:
      * html/parser/HTMLConstructionSite.cpp:
      (WebCore::HTMLConstructionSite::HTMLConstructionSite):
      (WebCore::HTMLConstructionSite::insertScriptElement): Pass false to both parserInserted and
      alreadyStarted when the scripting permission is AllowScriptingContentAndDoNotMarkAlreadyStarted.
      Also call parserSetAttributes when the scripting permission is either AllowScriptingContent or
      AllowScriptingContentAndDoNotMarkAlreadyStarted.
      * html/parser/HTMLDocumentParser.h:
      (HTMLDocumentParser):
      * html/parser/HTMLTreeBuilder.cpp:
      (WebCore::HTMLTreeBuilder::FragmentParsingContext::FragmentParsingContext):
      (WebCore::HTMLTreeBuilder::processEndTag):
      * html/parser/HTMLTreeBuilder.h:
      (FragmentParsingContext):
      * platform/blackberry/PasteboardBlackBerry.cpp:
      (WebCore::Pasteboard::documentFragment):
      * platform/chromium/DragDataChromium.cpp:
      (WebCore::DragData::asFragment):
      * platform/chromium/PasteboardChromium.cpp:
      (WebCore::Pasteboard::documentFragment):
      * platform/gtk/PasteboardGtk.cpp:
      (WebCore::Pasteboard::documentFragment):
      * platform/mac/PasteboardMac.mm:
      (WebCore::Pasteboard::documentFragment):
      * platform/qt/DragDataQt.cpp:
      (WebCore::DragData::asFragment):
      * platform/qt/PasteboardQt.cpp:
      (WebCore::Pasteboard::documentFragment):
      * platform/win/ClipboardUtilitiesWin.cpp:
      (WebCore::fragmentFromCFHTML):
      (WebCore::fragmentFromHTML):
      * xml/XMLErrors.cpp:
      (WebCore::createXHTMLParserErrorHeader):
      (WebCore::XMLErrors::insertErrorMessageBlock):
      * xml/parser/NewXMLDocumentParser.h:
      (NewXMLDocumentParser):
      * xml/parser/XMLDocumentParser.h:
      (XMLDocumentParser):
      * xml/parser/XMLDocumentParserLibxml2.cpp:
      (WebCore::XMLDocumentParser::XMLDocumentParser):
      (WebCore::XMLDocumentParser::endElementNs):
      * xml/parser/XMLDocumentParserQt.cpp:
      (WebCore::XMLDocumentParser::XMLDocumentParser):
      (WebCore::XMLDocumentParser::parseEndElement):
      
      Source/WebKit/mac: 
      
      Renamed FragmentScriptingNotAllowed to DisallowScriptingContent.
      
      * WebView/WebFrame.mm:
      (-[WebFrame _documentFragmentWithMarkupString:baseURLString:]):
      
      LayoutTests: 
      
      Added regressions tests to ensure createContextualFragment doesn't execute script elements
      immediately as they are parsed and it doesn't mark those script elements as already started.
      
      The behavior of innerHTML is tested elsewhere and this patch does not affect its behavior.
      
      * fast/dom/Range/create-contextual-fragment-script-not-ran-expected.txt: Added.
      * fast/dom/Range/create-contextual-fragment-script-not-ran.html: Added.
      * fast/dom/Range/create-contextual-fragment-script-unmark-already-started-expected.txt: Added.
      * fast/dom/Range/create-contextual-fragment-script-unmark-already-started.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      354eec62
  19. 15 May, 2012 2 commits
    • shinyak@chromium.org's avatar
      Rename Node::shadowTreeRootNode() to Node::shadowRoot() · 17c0dd86
      shinyak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=86449
      
      Reviewed by Darin Adler.
      
      Source/WebCore:
      
      Since Node::shadowTreeRootNode() returns always a ShadowRoot now, shadowRoot() is
      mure suitable than shadowTreeRootNode().
      
      This patch changes the method name.
      
      No new tests, no change in behavior.
      
      * WebCore.order:
      * dom/Node.cpp:
      (WebCore::Node::rendererIsEditable):
      (WebCore::Node::shadowAncestorNode):
      (WebCore::Node::shadowRoot):
      * dom/Node.h:
      (Node):
      * dom/NodeRenderingContext.cpp:
      (WebCore::NodeRenderingContext::NodeRenderingContext):
      * dom/Range.cpp:
      (WebCore::Range::shadowRoot):
      * dom/Range.h:
      (Range):
      * editing/Editor.cpp:
      (WebCore::Editor::nextVisibleRange):
      (WebCore::Editor::countMatchesForText):
      * editing/TextIterator.cpp:
      (WebCore::TextIterator::handleReplacedElement):
      * editing/htmlediting.cpp:
      (WebCore::indexForVisiblePosition):
      * html/shadow/ContentSelectorQuery.cpp:
      (WebCore::ContentSelectorQuery::matches):
      * html/shadow/HTMLContentElement.cpp:
      (WebCore::HTMLContentElement::parseAttribute):
      * html/shadow/InsertionPoint.cpp:
      (WebCore::InsertionPoint::detach):
      * page/EventHandler.cpp:
      (WebCore::instanceAssociatedWithShadowTreeElement):
      * svg/SVGElement.cpp:
      (WebCore::SVGElement::correspondingElement):
      (WebCore::collectInstancesForSVGElement):
      
      Source/WebKit/chromium:
      
      * src/WebFrameImpl.cpp:
      (WebKit::WebFrameImpl::scopeStringMatches):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      17c0dd86
    • shinyak@chromium.org's avatar
      Node::shadowTreeRootNode() should return ShadowRoot instead of Node. · 01261437
      shinyak@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=86428
      
      Reviewed by Hajime Morita.
      
      Source/WebCore:
      
      Since Node::shadowTreeRootNode() returns only ShadowRoot or 0 now, its return type should be ShadowRoot.
      This patch changes the return type and adds include directive to build.
      
      No new tests, no change in behavior.
      
      * dom/Node.cpp:
      (WebCore::Node::shadowAncestorNode):
      (WebCore::Node::shadowTreeRootNode):
      * dom/Node.h:
      (WebCore):
      (Node):
      * dom/NodeRenderingContext.cpp:
      (WebCore::NodeRenderingContext::NodeRenderingContext):
      * dom/Range.cpp:
      (WebCore::Range::shadowTreeRootNode):
      * dom/Range.h:
      (Range):
      * editing/Editor.cpp:
      * editing/TextIterator.cpp:
      * editing/htmlediting.cpp:
      * html/shadow/ContentSelectorQuery.cpp:
      * html/shadow/HTMLContentElement.cpp:
      (WebCore::HTMLContentElement::parseAttribute):
      * html/shadow/InsertionPoint.cpp:
      (WebCore::InsertionPoint::detach):
      * page/EventHandler.cpp:
      
      Source/WebKit/chromium:
      
      Adds include directive to build.
      
      * src/WebFrameImpl.cpp:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117036 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      01261437
  20. 12 Mar, 2012 1 commit
  21. 08 Mar, 2012 1 commit
    • leviw@chromium.org's avatar
      Switch absoluteRects, culledInlineAbsoluteRects, absoluteBoundingBoxRect, and... · e92ed537
      leviw@chromium.org authored
      Switch absoluteRects, culledInlineAbsoluteRects, absoluteBoundingBoxRect, and addFocusRingRects back to integers
      https://bugs.webkit.org/show_bug.cgi?id=80545
      
      Reviewed by Simon Fraser.
      
      Converting the above functions, all of which return rects that represent on-screen rects, to IntRects from
      LayoutRects.
      
      addFocusRingsRects generates a vector of rects that is handed off directly to the GraphicsContext to be
      drawn. Snapping the rects before adding them to the vector saves an extra pass through the vector.
      
      absoluteRects and culledInlineAbsoluteRects are only used by addFocusRingRects, hasNonEmptyBoundingBox (only
      to check if they're empty), and absoluteBoundingBoxRect, which is exposed from WebCore and thus should be an
      IntRect anyways.
      
      No new tests. No change in behavior.
      
      * dom/Node.cpp:
      (WebCore::Node::hasNonEmptyBoundingBox):
      * dom/Range.cpp:
      (WebCore::Range::boundingBox):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::absoluteRects):
      (WebCore::RenderBlock::addFocusRingRects):
      * rendering/RenderBlock.h:
      (RenderBlock):
      * rendering/RenderInline.cpp:
      (WebCore::RenderInline::absoluteRects):
      (WebCore::RenderInline::culledInlineAbsoluteRects):
      (WebCore::RenderInline::addFocusRingRects):
      * rendering/RenderInline.h:
      (RenderInline):
      * rendering/RenderListBox.cpp:
      (WebCore::RenderListBox::addFocusRingRects):
      * rendering/RenderListBox.h:
      (RenderListBox):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::paintFocusRing):
      (WebCore::RenderObject::absoluteBoundingBoxRect):
      (WebCore::RenderObject::absoluteFocusRingQuads):
      * rendering/RenderObject.h:
      (WebCore::RenderObject::absoluteRects):
      (RenderObject):
      (WebCore::RenderObject::absoluteBoundingBoxRectIgnoringTransforms):
      (WebCore::RenderObject::addFocusRingRects):
      * rendering/RenderText.cpp:
      (WebCore::RenderText::absoluteRects):
      (WebCore::RenderText::absoluteRectsForRange):
      * rendering/RenderText.h:
      (RenderText):
      * rendering/RenderTextControl.cpp:
      (WebCore::RenderTextControl::addFocusRingRects):
      * rendering/RenderTextControl.h:
      (RenderTextControl):
      * rendering/RenderView.cpp:
      (WebCore::RenderView::absoluteRects):
      * rendering/RenderView.h:
      (RenderView):
      * rendering/svg/RenderSVGBlock.cpp:
      (WebCore::RenderSVGBlock::absoluteRects):
      * rendering/svg/RenderSVGBlock.h:
      (RenderSVGBlock):
      * rendering/svg/RenderSVGContainer.cpp:
      (WebCore::RenderSVGContainer::addFocusRingRects):
      * rendering/svg/RenderSVGContainer.h:
      (RenderSVGContainer):
      * rendering/svg/RenderSVGImage.cpp:
      (WebCore::RenderSVGImage::addFocusRingRects):
      * rendering/svg/RenderSVGImage.h:
      (RenderSVGImage):
      * rendering/svg/RenderSVGModelObject.cpp:
      (WebCore::RenderSVGModelObject::absoluteRects):
      * rendering/svg/RenderSVGModelObject.h:
      (RenderSVGModelObject):
      * rendering/svg/RenderSVGShape.cpp:
      (WebCore::RenderSVGShape::addFocusRingRects):
      * rendering/svg/RenderSVGShape.h:
      (RenderSVGShape):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e92ed537
  22. 28 Feb, 2012 1 commit
    • zimmermann@webkit.org's avatar
      Integrate SVGUseElement within the new shadow root concept · b418e382
      zimmermann@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=78902
      
      Reviewed by Zoltan Herczeg.
      
      Source/WebCore:
      
      Replace SVG shadow tree implementation with the new, modern #shadow-root implementation.
      
      Current situation in trunk:
      SVGUseElement doesn't create/hold the shadow tree, unlike its expected in
      the modern #shadow-root concept, but its renderer RenderSVGShadowTreeRootContainer.
      That creates a cycle, as the actual DOM tree is stored as RefPtr<SVGGElement> inside
      a renderer - that's weak conceptually, and has lead to sublte security bugs in the past.
      
      Whenever a target element of a <use> element changed, invalidateShadowTree() is called
      which calls setNeedsStyleRecalc(), and sets m_needsShadodwTreeRecreation to true.
      Once style recalculation happens, the RenderSVGShadowTreeRootContainer then eventually
      built the shadow tree, by cloning the target node, building the SVGElementInstance tree
      etc, -- all within the render tree.
      
      To easy reviewing, here's a dump of the current render tree for a simple <use> example:
      <defs><rect id="rect"/></defs><use xlink:href="#rect"/>
      
      Dump of render tree:
      RenderSVGHiddenContainer {defs}        // <defs> (SVGDefsElement)
          RenderSVGRect {rect}               // <rect> (SVGRectElement)
      RenderSVGShadowTreeRootContainer {use} // <use> (SVGUseElement)
          RenderSVGContainer {g}             // <g> (SVGShadowTreeRootElement)
              RenderSVGRect {rect}           // <rect> (SVGRectElement, clone of <rect> in <defs>)
      
      The SVGShadowTreeRootElement is created & stored by RenderSVGShadowTreeRootContainer,
      the renderer of the <use> element. The RenderSVGTransformableContainer renderer created
      for the SVGShadowTreeRootElement stores the x/y translation induced by the <use> attributes.
      
      There are lots of places all over WebCore that assume the existance of a <g> renderer
      as first child of the <use> element, representing the "SVG shadow tree root".
      
      Summary of this patch:
      Let SVGUseElement create&maintain a #shadow-root, and append the cloned target elements
      into this shadow root. We no longer have to take care of attachment/detachment, style
      recalculation, etc. - that's handled transparenly by ShadowRoot(List) now.
      
      This makes SVGShadowTreeElements & RenderSVGShadowTreeRootContainer obsolete. Switch
      SVGUseElement to create a RenderSVGTransformableContainer as its renderer, and make
      it respect the translation induced by the x/y attributes, given for a <use> element.
      
      Remove all occourences of SVGShadowRoot, remove all special cases it induced.
      
      It's all covered by existing tests, took a while to make them all pass again.
      
      * CMakeLists.txt: Remove SVGShadowTreeElements/RenderSVGShadowTreeRootContainer from build.
      * GNUmakefile.list.am: Ditto.
      * Target.pri: Ditto.
      * WebCore.gypi: Ditto.
      * WebCore.vcproj/WebCore.vcproj: Ditto.
      * WebCore.xcodeproj/project.pbxproj: Ditto.
      * css/CSSStyleSelector.cpp:
      (WebCore::CSSStyleSelector::collectMatchingRulesForList): Enable fast path for selector checking, now that special shadow tree rules are gone.
      * css/SelectorChecker.cpp:
      (WebCore::linkAttribute): No need to guard this code with ENABLE(SVG).
      (WebCore::SelectorChecker::checkSelector): Remove obsolete SVG shadow root special case.
      * dom/EventDispatcher.cpp:
      (WebCore::eventTargetRespectingSVGTargetRules): Remove loop, simplify & cleanup this code.
      (WebCore::EventDispatcher::adjustToShadowBoundaries): s/isShadowRootOrSVGShadowRoot/isShadowRoot/.
      (WebCore::EventDispatcher::adjustRelatedTarget): Ditto.
      (WebCore::EventDispatcher::ensureEventAncestors): Simplify logic for SVG, fixed a FIXME.
      * dom/Node.cpp: Remove obsolete svgShadowHost().
      (WebCore::Node::shadowTreeRootNode): Remove obsolete isSVGShadowRoot() checks.
      (WebCore::Node::nonBoundaryShadowTreeRootNode): Ditto.
      (WebCore::Node::isInShadowTree): Make it const.
      * dom/Node.h: Remove isSVGShadowRoot/svgShadowHost.
      (WebCore::Node::isShadowRoot): s/IsShadowRootOrSVGShadowRootFlag/isShadowRoot/.
      (WebCore::Node::parentNode): Augment comments.
      (WebCore::Node::parentNodeGuaranteedHostFree): Ditto.
      * dom/Range.cpp:
      (WebCore::Range::checkNodeBA): Remove obsolete SVG shadow root special case.
      * dom/ScriptElement.cpp:
      (WebCore::ScriptElement::prepareScript): Ditto.
      * rendering/RenderObject.h: Remove isSVGShadowTreeRootContainer.
      (WebCore::RenderObject::isSVGTransformableContainer): Added.
      * rendering/svg/RenderSVGAllInOne.cpp: Remove SVGShadowTreeElements/RenderSVGShadowTreeRootContainer from build.
      * rendering/svg/RenderSVGModelObject.cpp:
      (WebCore::isGraphicsElement): To check for <use>, a tag name comparision is needed now, as it no longer has a special renderer.
      * rendering/svg/RenderSVGResourceClipper.cpp:
      (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage): Ditto.
      (WebCore::RenderSVGResourceClipper::calculateClipContentRepaintRect): Ditto.
      (WebCore::RenderSVGResourceClipper::hitTestClipContent): Ditto.
      * rendering/svg/RenderSVGResourceContainer.cpp: Remove RenderSVGShadowTreeRootContainer.h include.
      * rendering/svg/RenderSVGShadowTreeRootContainer.cpp: Removed.
      * rendering/svg/RenderSVGShadowTreeRootContainer.h: Removed.
      * rendering/svg/RenderSVGTransformableContainer.cpp: Keep track of last used additional x/y translation.
      (WebCore::RenderSVGTransformableContainer::calculateLocalTransform): Handle x/y translation for <use> contains here, instead of storing it in the SVGShadowTreeRootElement.
      * rendering/svg/RenderSVGTransformableContainer.h: Store last used x/y translation.
      (WebCore::RenderSVGTransformableContainer::isSVGTransformableContainer): Return true.
      (WebCore::toRenderSVGTransformableContainer): Add conversion helpers.
      * rendering/svg/RenderSVGViewportContainer.cpp: Ditto.
      (WebCore::RenderSVGViewportContainer::calcViewport): Handle width/height attributes inheritance from the <use> element, if we're a <svg> or <symbol> replacement in the shadow tree.
      * rendering/svg/RenderSVGViewportContainer.h: Remove isSVGContainer() override which is not needed here (already present in RenderSVGContainer).
      * rendering/svg/SVGShadowTreeElements.cpp: Removed.
      * rendering/svg/SVGShadowTreeElements.h: Removed.
      * svg/SVGAElement.cpp:
      (WebCore::SVGAElement::createRenderer): Check if parentNode is really a SVGElement, before casting.
      * svg/SVGElement.cpp:
      (WebCore::SVGElement::isOutermostSVGSVGElement): Early exit if tag name isn't <svg>, or if we're in a shadow tree (can't be an outermost <svg> element then).
      (WebCore::hasLoadListener): Deploy parentOrHostElement() usage to remove any special cases, related to shadow boundaries.
      (WebCore::SVGElement::sendSVGLoadEventIfPossible): Ditto.
      (WebCore::SVGElement::customStyleForRenderer): Ditto.
      * svg/SVGElementInstance.cpp:
      (WebCore::SVGElementInstance::invalidateAllInstancesOfElement): Call updateStyleIfNeeded() instead of updateLayoutIgnorePendingStylesheets().
      * svg/SVGGElement.cpp:
      (WebCore::SVGGElement::rendererIsNeeded): s/parentNode/parentOrHostElement/ - we need to cross shadow boundaries now.
      * svg/SVGGElement.h: Remove obsolete isShadowTreeContainerElement().
      * svg/SVGLocatable.cpp:
      (WebCore::SVGLocatable::nearestViewportElement): s/parentNode/parentOrHostElement/ - we need to cross shadow boundaries now.
      (WebCore::SVGLocatable::farthestViewportElement): Ditto.
      (WebCore::SVGLocatable::computeCTM): Ditto.
      * svg/SVGStyledElement.cpp:
      (WebCore::SVGStyledElement::title): Ditto. (+ simplify code a lot, no need to walk the shadow tree to find its root anymore, use isInShadowTree() helper.)
      (WebCore::SVGStyledElement::rendererIsNeeded): Ditto.
      * svg/SVGUseElement.cpp:
      (WebCore::SVGUseElement::SVGUseElement): Remove no longer needed m_updatesBlocked.
      (WebCore::SVGUseElement::create): Always call ensureShadowRoot(), to create a #shadow-root, upon creating a SVGUseElement.
      (WebCore::SVGUseElement::insertedIntoDocument): Align with SVGFEImageElement/SVGTRefElement - call buildPendingResource() from insertedIntoDocument(), finally! (no renderer needed anymore to update the SVG shadow subtree).
      (WebCore::SVGUseElement::removedFromDocument): Align with SVGFEImageElement/SVGTRefElement - immediately release the SVGElementInstance & shadow tree, once we're removed from the document.
      (WebCore::SVGUseElement::svgAttributeChanged): Simplify code a lot, no longer need to deal with x/y/width/height attributes, the renderes in the shadow tree grab these values from their corresponding <use> elements automatically now.
      (WebCore::SVGUseElement::willRecalcStyle):
          New main part of the logic. invalidateShadowTree() calls setNeedsStyleRecalc, and sets m_needsShadowTreeRecreation=true. If we encounter this case, force rebuilding the SVG shadow tree
          and the SVGElementInstance tree, immediately, before executing the actual style recalc. This allows us to lazily rebuild the SVG shadow tree for the <use> element. Consider:
          <defs><rect id="rect"></defs> <use xlink:href="#rect"/>. Now from a script we change the rect x/y/width/height attributes:
          rect.setAttribute("x", "10"); rect.setAttribute("y", "10")... each call will lead to a SVGUseElement::invalidateShadowTree() call by SVGElementInstance::invalidateAllInstancesOfElement, invoked after the <rect> element got parsed.
          This won't update the shadow tree four times, but only once upon the next style recalculation - otherwise performance is a nightmare.
          This will serve as future starting point, to explore partial SVG subtree re-clones, which should easily be doable now.
      (WebCore::dumpInstanceTree): Add a 'static' to allow DUMP_INSTANCE_TREE to be used in clang builds.
      (WebCore::SVGUseElement::clearResourceReferences): Added helper to release instance & shadow tree.
      (WebCore::SVGUseElement::buildPendingResource): Modeled exactly like SVGFEImageElement/SVGTRefElement. It's possible to share more code between these in future.
      (WebCore::SVGUseElement::buildShadowAndInstanceTree): Cleanup code, adapt to new shadow-root concept.
      (WebCore::SVGUseElement::createRenderer): Create a RenderSVGTransformableContainer, no longer a <use> specific renderer.
      (WebCore::removeDisallowedElementsFromSubtree): Use new replacedChild/appendChild variants, that don't require a ExceptionCode to be passed in.
      (WebCore::SVGUseElement::buildShadowTree): Ditto.
      (WebCore::SVGUseElement::expandUseElementsInShadowTree): Ditto.
      (WebCore::SVGUseElement::expandSymbolElementsInShadowTree): Ditto.
      (WebCore::SVGUseElement::invalidateShadowTree): Only trigger style recalculations if needed.
      * svg/SVGUseElement.h: Remove lots of now unnecessary overrides: attach/detach/didRecalcStyle/updateContainerOffset/updateContainerSizes/etc..
      * svg/animation/SVGSMILElement.cpp:
      (WebCore::SVGSMILElement::insertedIntoDocument): No need to walk the shadow tree to find its root anymore, use isInShadowTree() helper.
      
      LayoutTests:
      
      Update results after the <use> rewrite. Lots of RendeSVGContainer lines are
      gone in the expected results, as the artifical <g> element representing the
      SVG shadow root is gone, replaced by a standar #shadow-root.
      
      * platform/chromium/test_expectations.txt:
      * platform/mac/svg/W3C-SVG-1.1-SE/struct-use-11-f-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-30-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-36-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-39-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-40-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-41-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-46-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-61-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-63-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-64-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-65-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-66-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-67-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-68-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-69-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-70-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-77-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-78-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/animate-elem-80-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/filters-gauss-01-b-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/filters-morph-01-f-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/fonts-elem-05-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/fonts-elem-06-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/fonts-kern-01-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/pservers-grad-13-b-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/struct-group-03-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/struct-image-02-b-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/struct-symbol-01-b-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/struct-use-01-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/struct-use-03-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/struct-use-05-b-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/text-path-01-b-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/text-text-04-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/text-text-05-t-expected.txt:
      * platform/mac/svg/W3C-SVG-1.1/text-text-06-t-expected.txt:
      * platform/mac/svg/batik/filters/feTile-expected.txt:
      * platform/mac/svg/batik/filters/filterRegions-expected.txt:
      * platform/mac/svg/batik/masking/maskRegions-expected.txt:
      * platform/mac/svg/batik/paints/gradientLimit-expected.txt:
      * platform/mac/svg/batik/paints/patternPreserveAspectRatioA-expected.txt:
      * platform/mac/svg/batik/paints/patternRegionA-expected.txt:
      * platform/mac/svg/batik/paints/patternRegions-expected.txt:
      * platform/mac/svg/batik/paints/patternRegions-positioned-objects-expected.txt:
      * platform/mac/svg/batik/text/longTextOnPath-expected.txt:
      * platform/mac/svg/batik/text/smallFonts-expected.txt:
      * platform/mac/svg/batik/text/textAnchor-expected.txt:
      * platform/mac/svg/batik/text/textDecoration-expected.txt:
      * platform/mac/svg/batik/text/textEffect-expected.txt:
      * platform/mac/svg/batik/text/textEffect2-expected.txt:
      * platform/mac/svg/batik/text/textEffect3-expected.txt:
      * platform/mac/svg/batik/text/textFeatures-expected.txt:
      * platform/mac/svg/batik/text/textGlyphOrientationHorizontal-expected.txt:
      * platform/mac/svg/batik/text/textLayout-expected.txt:
      * platform/mac/svg/batik/text/textLayout2-expected.txt:
      * platform/mac/svg/batik/text/textLength-expected.txt:
      * platform/mac/svg/batik/text/textOnPath-expected.txt:
      * platform/mac/svg/batik/text/textOnPath2-expected.txt:
      * platform/mac/svg/batik/text/textOnPath3-expected.txt:
      * platform/mac/svg/batik/text/textOnPathSpaces-expected.txt:
      * platform/mac/svg/batik/text/textPosition-expected.txt:
      * platform/mac/svg/batik/text/textPosition2-expected.txt:
      * platform/mac/svg/batik/text/textProperties-expected.txt:
      * platform/mac/svg/batik/text/textProperties2-expected.txt:
      * platform/mac/svg/batik/text/textStyles-expected.txt:
      * platform/mac/svg/batik/text/verticalText-expected.txt:
      * platform/mac/svg/batik/text/verticalTextOnPath-expected.txt:
      * platform/mac/svg/carto.net/button-expected.txt:
      * platform/mac/svg/carto.net/colourpicker-expected.txt:
      * platform/mac/svg/carto.net/slider-expected.txt:
      * platform/mac/svg/carto.net/window-expected.txt:
      * platform/mac/svg/clip-path/clip-path-child-clipped-expected.txt:
      * platform/mac/svg/clip-path/clip-path-clipped-no-content-expected.txt:
      * platform/mac/svg/clip-path/clip-path-evenodd-expected.txt:
      * platform/mac/svg/clip-path/clip-path-evenodd-nonzero-expected.txt:
      * platform/mac/svg/clip-path/clip-path-nonzero-evenodd-expected.txt:
      * platform/mac/svg/clip-path/clip-path-nonzero-expected.txt:
      * platform/mac/svg/clip-path/clip-path-text-and-shape-expected.txt:
      * platform/mac/svg/clip-path/clip-path-use-as-child2-expected.txt:
      * platform/mac/svg/clip-path/clip-path-use-as-child3-expected.txt:
      * platform/mac/svg/clip-path/clip-path-use-as-child4-expected.txt:
      * platform/mac/svg/clip-path/clip-path-use-as-child5-expected.txt:
      * platform/mac/svg/clip-path/clip-path-with-container-expected.txt:
      * platform/mac/svg/clip-path/clip-path-with-invisibile-child-expected.txt:
      * platform/mac/svg/clip-path/clip-path-with-text-clipped-expected.txt:
      * platform/mac/svg/clip-path/clipper-placement-issue-expected.txt:
      * platform/mac/svg/css/clippath-with-shadow-expected.txt:
      * platform/mac/svg/css/mask-with-shadow-expected.txt:
      * platform/mac/svg/custom/broken-internal-references-expected.txt:
      * platform/mac/svg/custom/clip-path-referencing-use-expected.txt:
      * platform/mac/svg/custom/clip-path-referencing-use2-expected.txt:
      * platform/mac/svg/custom/embedding-external-svgs-expected.txt:
      * platform/mac/svg/custom/path-textPath-simulation-expected.txt:
      * platform/mac/svg/custom/pattern-rotate-expected.txt:
      * platform/mac/svg/custom/recursive-clippath-expected.txt:
      * platform/mac/svg/custom/recursive-mask-expected.txt:
      * platform/mac/svg/custom/recursive-pattern-expected.txt:
      * platform/mac/svg/custom/relative-sized-deep-shadow-tree-content-expected.txt:
      * platform/mac/svg/custom/relative-sized-shadow-tree-content-expected.txt:
      * platform/mac/svg/custom/relative-sized-shadow-tree-content-with-symbol-expected.txt:
      * platform/mac/svg/custom/relative-sized-use-on-symbol-expected.txt:
      * platform/mac/svg/custom/relative-sized-use-without-attributes-on-symbol-expected.txt:
      * platform/mac/svg/custom/struct-use-09-b-expected.txt:
      * platform/mac/svg/custom/use-clipped-hit-expected.txt:
      * platform/mac/svg/custom/use-css-events-expected.txt:
      * platform/mac/svg/custom/use-detach-expected.txt:
      * platform/mac/svg/custom/use-disappears-after-style-update-expected.png:
      * platform/mac/svg/custom/use-disappears-after-style-update-expected.txt:
      * platform/mac/svg/custom/use-dynamic-append-expected.txt:
      * platform/mac/svg/custom/use-elementInstance-event-target-expected.txt:
      * platform/mac/svg/custom/use-elementInstance-methods-expected.txt:
      * platform/mac/svg/custom/use-empty-reference-expected.txt:
      * platform/mac/svg/custom/use-event-handler-on-referenced-element-expected.txt:
      * platform/mac/svg/custom/use-event-handler-on-use-element-expected.txt:
      * platform/mac/svg/custom/use-events-crash-expected.txt:
      * platform/mac/svg/custom/use-font-face-crash-expected.txt:
      * platform/mac/svg/custom/use-instanceRoot-event-bubbling-expected.png:
      * platform/mac/svg/custom/use-instanceRoot-event-listeners-expected.png:
      * platform/mac/svg/custom/use-instanceRoot-modifications-expected.txt:
      * platform/mac/svg/custom/use-modify-container-in-target-expected.txt:
      * platform/mac/svg/custom/use-modify-target-container-expected.txt:
      * platform/mac/svg/custom/use-modify-target-symbol-expected.txt:
      * platform/mac/svg/custom/use-nested-transform-expected.txt:
      * platform/mac/svg/custom/use-on-disallowed-foreign-object-1-expected.txt:
      * platform/mac/svg/custom/use-on-disallowed-foreign-object-2-expected.txt:
      * platform/mac/svg/custom/use-on-disallowed-foreign-object-3-expected.txt:
      * platform/mac/svg/custom/use-on-disallowed-foreign-object-4-expected.txt:
      * platform/mac/svg/custom/use-on-disallowed-foreign-object-5-expected.txt:
      * platform/mac/svg/custom/use-on-disallowed-foreign-object-6-expected.txt:
      * platform/mac/svg/custom/use-on-g-containing-symbol-expected.txt:
      * platform/mac/svg/custom/use-on-g-containing-use-expected.txt:
      * platform/mac/svg/custom/use-on-g-expected.txt:
      * platform/mac/svg/custom/use-on-non-svg-namespaced-element-expected.txt:
      * platform/mac/svg/custom/use-on-rect-expected.txt:
      * platform/mac/svg/custom/use-on-symbol-expected.txt:
      * platform/mac/svg/custom/use-on-symbol-inside-pattern-expected.txt:
      * platform/mac/svg/custom/use-on-text-expected.txt:
      * platform/mac/svg/custom/use-on-use-expected.txt:
      * platform/mac/svg/custom/use-property-changes-through-dom-expected.txt:
      * platform/mac/svg/custom/use-property-changes-through-svg-dom-expected.txt:
      * platform/mac/svg/custom/use-property-synchronization-crash-expected.txt:
      * platform/mac/svg/custom/use-recalcStyle-crash-expected.txt:
      * platform/mac/svg/custom/use-recursion-1-expected.txt:
      * platform/mac/svg/custom/use-recursion-2-expected.txt:
      * platform/mac/svg/custom/use-recursion-3-expected.txt:
      * platform/mac/svg/custom/use-recursion-4-expected.png:
      * platform/mac/svg/custom/use-recursion-4-expected.txt:
      * platform/mac/svg/custom/use-referencing-nonexisting-symbol-expected.txt:
      * platform/mac/svg/custom/use-symbol-overflow-expected.txt:
      * platform/mac/svg/custom/use-transform-expected.txt:
      * platform/mac/svg/filters/feImage-target-attribute-change-with-use-indirection-2-expected.txt:
      * platform/mac/svg/filters/feImage-target-attribute-change-with-use-indirection-expected.txt:
      * platform/mac/svg/filters/filter-placement-issue-expected.txt:
      * platform/mac/svg/filters/filter-refresh-expected.txt:
      * platform/mac/svg/filters/filter-source-position-expected.txt:
      * platform/mac/svg/hixie/error/014-expected.txt:
      * platform/mac/svg/hixie/error/017-expected.txt:
      * platform/mac/svg/hixie/use/001-expected.txt:
      * platform/mac/svg/hixie/use/002-expected.txt:
      * platform/mac/svg/overflow/overflow-on-inner-svg-element-expected.txt:
      * platform/mac/svg/stroke/zero-length-arc-linecaps-rendering-expected.txt:
      * platform/mac/svg/stroke/zero-length-path-linecap-rendering-expected.txt:
      * platform/mac/svg/stroke/zero-length-subpaths-linecap-rendering-expected.txt:
      * platform/mac/svg/text/text-gradient-positioning-expected.txt:
      * platform/mac/svg/text/text-path-01-b-expected.txt:
      * platform/mac/svg/text/text-text-04-t-expected.txt:
      * platform/mac/svg/text/text-text-05-t-expected.txt:
      * platform/mac/svg/text/text-text-06-t-expected.txt:
      * platform/mac/svg/transforms/svg-css-transforms-clip-path-expected.txt:
      * platform/mac/svg/zoom/page/zoom-mask-with-percentages-expected.txt:
      * svg/W3C-SVG-1.1-SE/struct-use-14-f-expected.txt:
      * svg/clip-path/clip-path-childs-clipped-expected.txt:
      * svg/clip-path/clip-path-clipped-evenodd-twice-expected.txt:
      * svg/clip-path/clip-path-clipped-expected.txt:
      * svg/clip-path/clip-path-clipped-nonzero-expected.txt:
      * svg/clip-path/clip-path-on-clipped-use-expected.txt:
      * svg/clip-path/clip-path-use-as-child-expected.txt:
      * svg/css/circle-in-mask-with-shadow-expected.txt:
      * svg/custom/deep-dynamic-updates-expected.txt:
      * svg/custom/non-scaling-stroke-expected.txt:
      * svg/custom/resource-client-removal-expected.txt:
      * svg/custom/use-clipped-transform-expected.txt:
      * svg/custom/use-css-no-effect-on-shadow-tree-expected.txt:
      * svg/custom/use-forward-refs-expected.txt:
      * svg/custom/use-image-in-g-expected.txt:
      * svg/custom/use-in-symbol-with-offset-expected.txt:
      * svg/custom/use-inherit-style-expected.txt:
      * svg/custom/use-move-to-offset-expected.txt:
      * svg/custom/use-multiple-on-nested-disallowed-font-expected.txt:
      * svg/custom/use-on-clip-path-with-transformation-expected.txt:
      * svg/custom/use-on-g-containing-foreignObject-and-image-expected.txt:
      * svg/custom/use-setAttribute-crash-expected.txt:
      * svg/custom/use-transfer-width-height-properties-to-svg-expected.txt:
      * svg/custom/use-transfer-width-height-properties-to-svg1-expected.txt:
      * svg/custom/use-transfer-width-height-properties-to-svg2-expected.txt:
      * svg/custom/use-transfer-width-height-properties-to-symbol-expected.txt:
      * svg/custom/use-transfer-width-height-properties-to-symbol1-expected.txt:
      * svg/custom/use-transfer-width-height-properties-to-symbol2-expected.txt:
      * svg/repaint/inner-svg-change-viewPort-relative-expected.txt:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@109097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b418e382
  23. 14 Feb, 2012 2 commits
    • hayato@chromium.org's avatar
      Make ShadowRoot.nodeType return DOCUMENT_FRAGMENT_NODE. · 14993e0b
      hayato@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=77514
      
      Reviewed by Dimitri Glazkov.
      
      NodeType.SHADOW_ROOT_NODE type is finally gone.
      
      Source/WebCore:
      
      * bindings/js/JSNodeCustom.cpp:
      (WebCore::createWrapperInline):
      * bindings/objc/DOM.mm:
      (kitClass):
      * bindings/v8/custom/V8NodeCustom.cpp:
      (WebCore::toV8Slow):
      * dom/ContainerNode.cpp:
      (WebCore::collectTargetNodes):
      (WebCore::ContainerNode::replaceChild):
      * dom/Document.cpp:
      (WebCore::Document::importNode):
      (WebCore::Document::childTypeAllowed):
      (WebCore::Document::canReplaceChild):
      * dom/Node.cpp:
      (WebCore::Node::dumpStatistics):
      (WebCore::Node::isDefaultNamespace):
      (WebCore::Node::lookupPrefix):
      (WebCore::Node::lookupNamespaceURI):
      (WebCore::appendTextContent):
      (WebCore::Node::setTextContent):
      * dom/Node.h:
      * dom/Range.cpp:
      (WebCore::lengthOfContentsInNode):
      (WebCore::Range::processContentsBetweenOffsets):
      (WebCore::Range::insertNode):
      (WebCore::Range::checkNodeWOffset):
      (WebCore::Range::checkNodeBA):
      (WebCore::Range::selectNode):
      (WebCore::Range::selectNodeContents):
      (WebCore::Range::surroundContents):
      * dom/ShadowRoot.cpp:
      * dom/ShadowRoot.h:
      (ShadowRoot):
      (WebCore::toShadowRoot):
      * editing/FrameSelection.cpp:
      (WebCore::nodeIsDetachedFromDocument):
      (WebCore):
      (WebCore::FrameSelection::textWillBeReplaced):
      * editing/MarkupAccumulator.cpp:
      (WebCore::MarkupAccumulator::appendStartMarkup):
      * html/parser/HTMLElementStack.cpp:
      (WebCore::HTMLNames::isRootNode):
      (WebCore::HTMLElementStack::pushRootNode):
      * html/parser/HTMLElementStack.h:
      (WebCore::isInHTMLNamespace):
      * inspector/InspectorDOMAgent.cpp:
      (WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
      (WebCore::InspectorDOMAgent::buildObjectForNode):
      * xml/XPathUtil.cpp:
      (WebCore::XPath::isValidContextNode):
      
      Source/WebKit/chromium:
      
      * src/WebPageSerializerImpl.cpp:
      (WebKit::WebPageSerializerImpl::buildContentForNode):
      
      LayoutTests:
      
      * fast/dom/shadow/nodetype-expected.txt:
      * fast/dom/shadow/nodetype.html:
      * resources/dump-as-markup.js:
      (Markup._get):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107700 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      14993e0b
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r107661. · c38205f7
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/107661
      https://bugs.webkit.org/show_bug.cgi?id=78591
      
      crash on lion/qt bots (Requested by hayato on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-02-14
      
      Source/WebCore:
      
      * bindings/js/JSNodeCustom.cpp:
      (WebCore::createWrapperInline):
      * bindings/objc/DOM.mm:
      (kitClass):
      * bindings/v8/custom/V8NodeCustom.cpp:
      (WebCore::toV8Slow):
      * dom/ContainerNode.cpp:
      (WebCore::collectTargetNodes):
      (WebCore::ContainerNode::replaceChild):
      * dom/Document.cpp:
      (WebCore::Document::importNode):
      (WebCore::Document::childTypeAllowed):
      (WebCore::Document::canReplaceChild):
      * dom/Node.cpp:
      (WebCore::Node::dumpStatistics):
      (WebCore::Node::isDefaultNamespace):
      (WebCore::Node::lookupPrefix):
      (WebCore::Node::lookupNamespaceURI):
      (WebCore::appendTextContent):
      (WebCore::Node::setTextContent):
      * dom/Node.h:
      * dom/Range.cpp:
      (WebCore::lengthOfContentsInNode):
      (WebCore::Range::processContentsBetweenOffsets):
      (WebCore::Range::insertNode):
      (WebCore::Range::checkNodeWOffset):
      (WebCore::Range::checkNodeBA):
      (WebCore::Range::selectNode):
      (WebCore::Range::selectNodeContents):
      (WebCore::Range::surroundContents):
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::nodeType):
      (WebCore):
      * dom/ShadowRoot.h:
      (ShadowRoot):
      (WebCore::toShadowRoot):
      * editing/FrameSelection.cpp:
      (WebCore::FrameSelection::textWillBeReplaced):
      * editing/MarkupAccumulator.cpp:
      (WebCore::MarkupAccumulator::appendStartMarkup):
      * html/parser/HTMLElementStack.cpp:
      (WebCore::HTMLNames::isRootNode):
      (WebCore::HTMLElementStack::pushRootNode):
      * html/parser/HTMLElementStack.h:
      (WebCore::isInHTMLNamespace):
      * inspector/InspectorDOMAgent.cpp:
      (WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
      (WebCore::InspectorDOMAgent::buildObjectForNode):
      * xml/XPathUtil.cpp:
      (WebCore::XPath::isValidContextNode):
      
      Source/WebKit/chromium:
      
      * src/WebPageSerializerImpl.cpp:
      (WebKit::WebPageSerializerImpl::buildContentForNode):
      
      LayoutTests:
      
      * fast/dom/shadow/nodetype-expected.txt:
      * fast/dom/shadow/nodetype.html:
      * resources/dump-as-markup.js:
      (Markup._get):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107691 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c38205f7
  24. 13 Feb, 2012 1 commit
    • hayato@chromium.org's avatar
      Make ShadowRoot.nodeType return DOCUMENT_FRAGMENT_NODE. · 99e95281
      hayato@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=77514
      
      Reviewed by Dimitri Glazkov.
      
      NodeType.SHADOW_ROOT_NODE type is finally gone.
      
      Source/WebCore:
      
      * bindings/js/JSNodeCustom.cpp:
      (WebCore::createWrapperInline):
      * bindings/objc/DOM.mm:
      (kitClass):
      * bindings/v8/custom/V8NodeCustom.cpp:
      (WebCore::toV8Slow):
      * dom/ContainerNode.cpp:
      (WebCore::collectTargetNodes):
      (WebCore::ContainerNode::replaceChild):
      * dom/Document.cpp:
      (WebCore::Document::importNode):
      (WebCore::Document::childTypeAllowed):
      (WebCore::Document::canReplaceChild):
      * dom/Node.cpp:
      (WebCore::Node::dumpStatistics):
      (WebCore::Node::isDefaultNamespace):
      (WebCore::Node::lookupPrefix):
      (WebCore::Node::lookupNamespaceURI):
      (WebCore::appendTextContent):
      (WebCore::Node::setTextContent):
      * dom/Node.h:
      * dom/Range.cpp:
      (WebCore::lengthOfContentsInNode):
      (WebCore::Range::processContentsBetweenOffsets):
      (WebCore::Range::insertNode):
      (WebCore::Range::checkNodeWOffset):
      (WebCore::Range::checkNodeBA):
      (WebCore::Range::selectNode):
      (WebCore::Range::selectNodeContents):
      (WebCore::Range::surroundContents):
      * dom/ShadowRoot.cpp:
      * dom/ShadowRoot.h:
      (ShadowRoot):
      (WebCore::toShadowRoot):
      * editing/FrameSelection.cpp:
      (WebCore::nodeIsDetachedFromDocument):
      (WebCore):
      (WebCore::FrameSelection::textWillBeReplaced):
      * editing/MarkupAccumulator.cpp:
      (WebCore::MarkupAccumulator::appendStartMarkup):
      * html/parser/HTMLElementStack.cpp:
      (WebCore::HTMLNames::isRootNode):
      (WebCore::HTMLElementStack::pushRootNode):
      * html/parser/HTMLElementStack.h:
      (WebCore::isInHTMLNamespace):
      * inspector/InspectorDOMAgent.cpp:
      (WebCore::InspectorDOMAgent::pushChildNodesToFrontend):
      (WebCore::InspectorDOMAgent::buildObjectForNode):
      * xml/XPathUtil.cpp:
      (WebCore::XPath::isValidContextNode):
      
      Source/WebKit/chromium:
      
      * src/WebPageSerializerImpl.cpp:
      (WebKit::WebPageSerializerImpl::buildContentForNode):
      
      LayoutTests:
      
      * fast/dom/shadow/nodetype-expected.txt:
      * fast/dom/shadow/nodetype.html:
      * resources/dump-as-markup.js:
      (Markup._get):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      99e95281
  25. 12 Feb, 2012 1 commit
    • commit-queue@webkit.org's avatar
      Add toText and isTextNode helpers in Text class. · 9b335e4b
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=78140
      
      Source/WebCore:
      
      Added a new helper function toText() in dom/Text.h which does the type casting operation to Text object.
      Modified the code to make use of this helper function.
      
      Patch by Joe Thomas <joethomas@motorola.com> on 2012-02-12
      Reviewed by Adam Barth.
      
      No new tests.
      
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::accessibleNameForNode):
      * bindings/v8/custom/V8NodeCustom.cpp:
      (WebCore::toV8Slow):
      * css/SelectorChecker.cpp:
      (WebCore::SelectorChecker::checkOneSelector):
      * dom/Attr.cpp:
      (WebCore::Attr::childrenChanged):
      * dom/Element.cpp:
      (WebCore::Element::recalcStyle):
      * dom/Node.cpp:
      (WebCore::Node::normalize):
      * dom/Position.cpp:
      (WebCore::Position::containerText):
      (WebCore::Position::leadingWhitespacePosition):
      * dom/Range.cpp:
      (WebCore::Range::insertNode):
      (WebCore::Range::getBorderAndTextQuads):
      * dom/ScriptElement.cpp:
      (WebCore::ScriptElement::scriptContent):
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::recalcShadowTreeStyle):
      * dom/Text.h: Added new helper function toText.
      (WebCore::toText): new helper function which does the type casting operation to Text object.
      (WebCore):
      * editing/ApplyBlockElementCommand.cpp:
      (WebCore::isNewLineAtPosition):
      (WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded):
      * editing/ApplyStyleCommand.cpp:
      (WebCore::ApplyStyleCommand::splitTextAtEnd):
      (WebCore::ApplyStyleCommand::splitTextElementAtEnd):
      (WebCore::ApplyStyleCommand::joinChildTextNodes):
      * editing/BreakBlockquoteCommand.cpp:
      (WebCore::BreakBlockquoteCommand::doApply):
      * editing/CompositeEditCommand.cpp:
      (WebCore::CompositeEditCommand::insertNodeAt):
      (WebCore::CompositeEditCommand::positionOutsideTabSpan):
      (WebCore::CompositeEditCommand::canRebalance):
      (WebCore::CompositeEditCommand::rebalanceWhitespaceAt):
      (WebCore::CompositeEditCommand::prepareWhitespaceAtPositionForSplit):
      (WebCore::CompositeEditCommand::deleteInsignificantText):
      (WebCore::CompositeEditCommand::removePlaceholderAt):
      (WebCore::CompositeEditCommand::cleanupAfterDeletion):
      (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph):
      * editing/DeleteSelectionCommand.cpp:
      (WebCore::DeleteSelectionCommand::handleGeneralDelete):
      (WebCore::DeleteSelectionCommand::fixupWhitespace):
      * editing/Editor.cpp:
      (WebCore::Editor::setComposition):
      * editing/InsertLineBreakCommand.cpp:
      (WebCore::InsertLineBreakCommand::doApply):
      * editing/InsertParagraphSeparatorCommand.cpp:
      (WebCore::InsertParagraphSeparatorCommand::doApply):
      * editing/InsertTextCommand.cpp:
      (WebCore::InsertTextCommand::insertTab):
      * editing/MarkupAccumulator.cpp:
      (WebCore::MarkupAccumulator::appendStartMarkup):
      * editing/ReplaceSelectionCommand.cpp:
      (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
      (WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
      (WebCore::ReplaceSelectionCommand::insertAsListItems):
      (WebCore::ReplaceSelectionCommand::performTrivialReplace):
      * editing/htmlediting.cpp:
      (WebCore::lineBreakExistsAtPosition):
      * editing/visible_units.cpp:
      (WebCore::startPositionForLine):
      (WebCore::endPositionForLine):
      (WebCore::startOfParagraph):
      (WebCore::endOfParagraph):
      * html/HTMLElement.cpp:
      (WebCore::replaceChildrenWithFragment):
      (WebCore::replaceChildrenWithText):
      (WebCore::mergeWithNextTextNode):
      * html/HTMLObjectElement.cpp:
      (WebCore::HTMLObjectElement::hasFallbackContent):
      (WebCore::HTMLObjectElement::updateDocNamedItem):
      * html/HTMLOptionElement.cpp:
      (WebCore::HTMLOptionElement::setText):
      * html/HTMLScriptElement.cpp:
      (WebCore::HTMLScriptElement::setText):
      * html/HTMLTextAreaElement.cpp:
      (WebCore::HTMLTextAreaElement::defaultValue):
      * html/HTMLTextFormControlElement.cpp:
      (WebCore::HTMLTextFormControlElement::innerTextValue):
      (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks):
      * html/HTMLTitleElement.cpp:
      (WebCore::HTMLTitleElement::text):
      (WebCore::HTMLTitleElement::setText):
      * inspector/InspectorDOMAgent.cpp:
      (WebCore::InspectorDOMAgent::setNodeValue):
      * rendering/RenderText.cpp:
      (WebCore::RenderText::originalText):
      * rendering/RenderTextFragment.cpp:
      (WebCore::RenderTextFragment::originalText):
      (WebCore::RenderTextFragment::previousCharacter):
      
      Tools:
      
      Added a style checker to use toText rather than static_cast<Text*>.
      
      Patch by Joe Thomas <joethomas@motorola.com> on 2012-02-12
      Reviewed by Adam Barth.
      
      * Scripts/webkitpy/style/checkers/cpp.py:
      (check_language): Style checker for static_cast<Text*>.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9b335e4b
  26. 10 Feb, 2012 1 commit
    • leviw@chromium.org's avatar
      Add pixelSnappedIntRect method · 9b486cd2
      leviw@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=78054
      
      Reviewed by Eric Seidel.
      
      This patch introduces a pixelSnappedIntRect method that will snap a sub-pixel LayoutRect to
      pixel boundaries. These pixel snapped forms are what is used to communicate with the graphics
      engine (to paint at whole pixel boundaries) and the embedding app (so they don't need to 
      understand we're using sub-pixel units).
      
      No new tests. No change in behavior.
      
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::isOffScreen):
      (WebCore::AccessibilityRenderObject::boundsForVisiblePositionRange):
      * dom/Range.cpp:
      (WebCore::Range::boundingBox):
      * html/HTMLCanvasElement.cpp:
      (WebCore::HTMLCanvasElement::paint):
      * html/shadow/TextControlInnerElements.cpp:
      (WebCore::InputFieldSpeechButtonElement::startSpeechInput):
      * page/Frame.cpp:
      (WebCore::Frame::nodeImage):
      * page/FrameView.cpp:
      (WebCore::FrameView::repaintContentRectangle):
      (WebCore::FrameView::doDeferredRepaints):
      (WebCore::FrameView::windowClipRectForLayer):
      * platform/graphics/GraphicsLayer.cpp:
      (WebCore::GraphicsLayer::paintGraphicsLayerContents):
      * rendering/InlineFlowBox.cpp:
      (WebCore::InlineFlowBox::paint):
      * rendering/LayoutTypes.h:
      (WebCore::pixelSnappedIntRect):
      (WebCore):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::paintColumnContents):
      (WebCore::RenderBlock::selectionGaps):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::paintBoxDecorations):
      (WebCore::RenderBox::pushContentsClip):
      * rendering/RenderBoxModelObject.cpp:
      (WebCore::RenderBoxModelObject::paintFillLayerExtended):
      (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
      (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
      (WebCore::RenderBoxModelObject::paintBoxShadow):
      * rendering/RenderDetailsMarker.cpp:
      (WebCore::RenderDetailsMarker::paint):
      * rendering/RenderFlowThread.cpp:
      (WebCore::RenderFlowThread::paintIntoRegion):
      * rendering/RenderFrameSet.cpp:
      (WebCore::RenderFrameSet::paintColumnBorder):
      (WebCore::RenderFrameSet::paintRowBorder):
      (WebCore::RenderFrameSet::positionFramesWithFlattening):
      * rendering/RenderImage.cpp:
      (WebCore::RenderImage::paintReplaced):
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::scrollRectToVisible):
      (WebCore::RenderLayer::positionOverflowControls):
      (WebCore::RenderLayer::calculateRects):
      * rendering/RenderLayerBacking.cpp:
      (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
      (WebCore::paintScrollbar):
      * rendering/RenderLayerCompositor.cpp:
      (WebCore::RenderLayerCompositor::calculateCompositedBounds):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::drawLineForBoxSide):
      (WebCore::RenderObject::addPDFURLRect):
      * rendering/RenderTextControlSingleLine.cpp:
      (WebCore::RenderTextControlSingleLine::showPopup):
      (WebCore::RenderTextControlSingleLine::paint):
      * rendering/RenderWidget.cpp:
      (WebCore::RenderWidget::paint):
      * rendering/style/RenderStyle.cpp:
      (WebCore::RenderStyle::getRoundedBorderFor):
      (WebCore::RenderStyle::getRoundedInnerBorderFor):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107461 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9b486cd2
  27. 23 Jan, 2012 1 commit
    • commit-queue@webkit.org's avatar
      https://bugs.webkit.org/show_bug.cgi?id=75799 · 5f5c5f30
      commit-queue@webkit.org authored
      Calling intersectsNode on a detached range should throw.
      
      Source/WebCore:
      
      INVALID_STATE_ERR exception should be thrown if intersectsNode is called on a detached Range.
      
      Patch by Joe Thomas <joethomas@motorola.com> on 2012-01-23
      Reviewed by Darin Adler.
      
      Test: fast/dom/Range/range-intersectsNode-exception.html
      
      * dom/Range.cpp:
      (WebCore::Range::intersectsNode): Throwing INVALID_STATE_ERR exception if the range is detached.
      
      LayoutTests:
      
      Added test case to verify the exception thrown while calling intersectsNode on a detached range.
      
      Patch by Joe Thomas <joethomas@motorola.com> on 2012-01-23
      Reviewed by Darin Adler.
      
      * fast/dom/Range/range-intersectsNode-exception-expected.txt: Added.
      * fast/dom/Range/range-intersectsNode-exception.html: Added.
      * fast/dom/Range/range-intersectsNode-expected.txt:
      * fast/dom/Range/resources/intersectsNode.js:  Modified the test case to catch the exception.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@105649 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5f5c5f30
  28. 14 Oct, 2011 1 commit
    • rniwa@webkit.org's avatar
      Move selectionStartStyle and selectionHasStyle to EditingStyle · d65bdd27
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=69882
      
      Reviewed by Enrica Casucci.
      
      Moved selectionHasStyle and selectionStartStyle from Editor to EditingStyle.
      Also moved much of code in Editor::selectionStartCSSPropertyValue to method of EditingStyle.
      
      In addition, moved Range::editingStartPosition to htmlediting where it belongs
      and renamed it to adjustedSelectionStartForStyleComputation.
      
      * dom/Range.cpp:
      * dom/Range.h:
      * editing/EditingStyle.cpp:
      (WebCore::EditingStyle::triStateOfStyle): Extracted from selectionHasStyle.
      (WebCore::EditingStyle::legacyFontSize): Extracted from selectionStartCSSPropertyValue.
      (WebCore::EditingStyle::styleAtSelectionStart): Moved from Editor::selectionStartStyle.
      * editing/EditingStyle.h:
      * editing/Editor.cpp:
      (WebCore::Editor::fontForSelection):
      (WebCore::Editor::selectionStartHasStyle):
      (WebCore::Editor::selectionHasStyle):
      (WebCore::Editor::selectionStartCSSPropertyValue):
      * editing/Editor.h:
      * editing/EditorCommand.cpp:
      (WebCore::executeToggleStyleInList):
      * editing/htmlediting.cpp:
      (WebCore::adjustedSelectionStartForStyleComputation): Moved from Range::editingStartPosition.
      * editing/htmlediting.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@97480 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d65bdd27
  29. 06 Oct, 2011 1 commit
    • andersca@apple.com's avatar
      Add DEFINE_DEBUG_ONLY_GLOBAL for globals that should be defined in debug builds · 0d7b94ed
      andersca@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=69584
      
      Reviewed by Darin Adler.
      
      ../JavaScriptCore: 
      
      Add DEFINE_DEBUG_ONLY_GLOBAL macro.
      
      * wtf/StdLibExtras.h:
      
      ../WebCore: 
      
      Adopt the DEFINE_DEBUG_ONLY_GLOBAL macro.
      
      * bindings/js/JSLazyEventListener.cpp:
      * dom/Node.cpp:
      * dom/Range.cpp:
      * history/CachedPage.cpp:
      * loader/SubresourceLoader.cpp:
      * loader/cache/CachedResource.cpp:
      * page/Frame.cpp:
      * page/Page.cpp:
      * rendering/BidiRun.cpp:
      * rendering/RenderObject.cpp:
      * svg/SVGElementInstance.cpp:
      * xml/XMLHttpRequest.cpp:
      
      ../WebKit/mac: 
      
      Adopt the DEFINE_DEBUG_ONLY_GLOBAL macro.
      
      * Plugins/Hosted/HostedNetscapePluginStream.mm:
      * Plugins/Hosted/NetscapePluginInstanceProxy.mm:
      
      ../WebKit2: 
      
      Adopt the DEFINE_DEBUG_ONLY_GLOBAL macro.
      
      * UIProcess/WebContext.cpp:
      * UIProcess/WebPageProxy.cpp:
      * WebProcess/WebPage/WebFrame.cpp:
      * WebProcess/WebPage/WebPage.cpp:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@96880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0d7b94ed
  30. 09 Sep, 2011 1 commit
    • fsamuel@chromium.org's avatar
      Move pageScaleFactor code from Frame.{h|cpp} to Page.{h|cpp} · c43a7d1c
      fsamuel@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=67250
      
      Reviewed by Simon Fraser.
      
      Source/WebCore:
      
      No new tests because there's no change in functionality.
      
      * WebCore.exp.in:
      * css/CSSStyleSelector.cpp:
      (WebCore::CSSStyleSelector::styleForDocument):
      * dom/Element.cpp:
      (WebCore::Element::getClientRects):
      (WebCore::Element::getBoundingClientRect):
      * dom/Range.cpp:
      (WebCore::adjustFloatQuadsForScrollAndAbsoluteZoomAndPageScale):
      * loader/HistoryController.cpp:
      (WebCore::HistoryController::restoreScrollPositionAndViewState):
      * page/Frame.cpp:
      (WebCore::Frame::Frame):
      (WebCore::Frame::pageScaleFactor):
      * page/Frame.h:
      * page/Page.cpp:
      (WebCore::Page::Page):
      (WebCore::Page::setPageScaleFactor):
      * page/Page.h:
      (WebCore::Page::pageScaleFactor):
      * rendering/RenderLayerCompositor.cpp:
      (WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame):
      (WebCore::RenderLayerCompositor::pageScaleFactor):
      * rendering/RenderView.cpp:
      (WebCore::RenderView::paintBoxDecorations):
      
      Source/WebKit/chromium:
      
      * src/WebViewImpl.cpp:
      (WebKit::WebViewImpl::pageScaleFactor):
      (WebKit::WebViewImpl::scalePage):
      
      Source/WebKit/gtk:
      
      * WebCoreSupport/DumpRenderTreeSupportGtk.cpp:
      (DumpRenderTreeSupportGtk::scalePageBy):
      
      Source/WebKit/mac:
      
      * WebView/WebView.mm:
      (-[WebView _scaleWebView:atOrigin:]):
      (-[WebView _viewScaleFactor]):
      
      Source/WebKit/qt:
      
      * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
      (DumpRenderTreeSupportQt::scalePageBy):
      
      Source/WebKit2:
      
      * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
      (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
      * WebProcess/WebPage/WebPage.cpp:
      (WebKit::WebPage::scalePage):
      (WebKit::WebPage::pageScaleFactor):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94889 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c43a7d1c
  31. 05 Sep, 2011 1 commit
    • commit-queue@webkit.org's avatar
      Logic from HTMLElement::deprecatedCreateContextualFragment moved into · 72a3598d
      commit-queue@webkit.org authored
      Range::createContextualFragment function.
      https://bugs.webkit.org/show_bug.cgi?id=67056
      
      Patch by Kaustubh Atrawalkar <kaustubh@motorola.com> on 2011-09-05
      Reviewed by Ryosuke Niwa.
      
      Code Refactoring for deprecatedCreateContextualFragment.
      
      Source/WebCore:
      
      No new tests. Code Re-factoring.
      
      * dom/Element.cpp:
      * dom/Element.h:
      * dom/Range.cpp:
      (WebCore::insertIntoFragment):
      (WebCore::Range::createDocumentFragmentForElement):
      (WebCore::Range::createContextualFragment):
      * dom/Range.h:
      * editing/markup.cpp:
      (WebCore::createFragmentFromMarkup):
      * html/HTMLElement.cpp:
      * html/HTMLElement.h:
      
      Source/WebKit/qt:
      
      * Api/qwebelement.cpp:
      (QWebElement::appendInside):
      (QWebElement::prependInside):
      (QWebElement::prependOutside):
      (QWebElement::appendOutside):
      (QWebElement::encloseContentsWith):
      (QWebElement::encloseWith):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      72a3598d
  32. 04 Sep, 2011 2 commits
  33. 22 Aug, 2011 1 commit
  34. 20 Aug, 2011 1 commit
  35. 17 Aug, 2011 2 commits
    • leviw@chromium.org's avatar
      Switch Document, DocumentMarker, Clipboard, and Range to new layout types · 3af17066
      leviw@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=66330
      
      Reviewed by Eric Seidel.
      
      Converting the remaining DOM classes to use the LayoutUnit abstraction.
      
      No new tests, no new behavior.
      
      * dom/Clipboard.h:
      (WebCore::Clipboard::dragLocation):
      * dom/Document.cpp:
      (WebCore::Document::nodesFromRect):
      (WebCore::nodeFromPoint):
      (WebCore::Document::caretRangeFromPoint):
      (WebCore::Document::prepareMouseEvent):
      * dom/Document.h:
      * dom/DocumentMarkerController.cpp:
      (WebCore::DocumentMarkerController::markerContainingPoint):
      (WebCore::DocumentMarkerController::renderedRectsForMarkers):
      (WebCore::DocumentMarkerController::invalidateRenderedRectsForMarkersInRect):
      * dom/DocumentMarkerController.h:
      * dom/Range.cpp:
      (WebCore::adjustFloatQuadsForScrollAndAbsoluteZoomAndPageScale):
      * dom/RenderedDocumentMarker.h:
      (WebCore::RenderedDocumentMarker::contains):
      (WebCore::RenderedDocumentMarker::setRenderedRect):
      (WebCore::RenderedDocumentMarker::renderedRect):
      (WebCore::RenderedDocumentMarker::invalidMarkerRect):
      (WebCore::RenderedDocumentMarker::invalidate):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93269 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3af17066
    • rniwa@webkit.org's avatar
      Get rid of calls to deprecatedNode and deprecatedEditingOffset in · 9c0f02c7
      rniwa@webkit.org authored
      AccessibilityRenderObject.cpp and InsertTextCommand.cpp
      https://bugs.webkit.org/show_bug.cgi?id=66014
      
      Reviewed by Hajime Morita.
      
      Removed calls to deprecatedNode and deprecatedEditingOffsets in the following files.
      
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::indexForVisiblePosition): Calls Position::rootEditableElement
      and Range::setEnd(const Position&, ExceptionCode) instead of manually pulling deprecatedNode
      and deprecatedEditingOffset.
      (WebCore::AccessibilityRenderObject::index): Abstracted the logic to loop through render objects
      from deprecatedNodes' renderer to m_renderer as renderObjectContainsPosition.
      * dom/Position.h:
      (WebCore::Position::rootEditableElement): Added.
      * dom/Range.cpp:
      (WebCore::Range::setStart): Added.
      (WebCore::Range::setEnd): Added.
      * dom/Range.h:
      * editing/InsertTextCommand.cpp:
      (WebCore::InsertTextCommand::insertTab):
      * editing/RenderedPosition.cpp:
      (WebCore::renderObjectContainsPosition): Extracted from AccessibilityRenderObject::index.
      * editing/RenderedPosition.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@93199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9c0f02c7
  36. 04 Aug, 2011 1 commit
    • simon.fraser@apple.com's avatar
      2011-08-04 Simon Fraser <simon.fraser@apple.com> · 329523a6
      simon.fraser@apple.com authored
              Add code to determine whether a Range in inside fixed position content
              https://bugs.webkit.org/show_bug.cgi?id=65720
      
              Reviewed by Sam Weinig.
      
              Propagate the 'wasFixed' flag out from various methods that
              are used when computing the collection of rects or quads
              for a range. Use the flag in Range to computer whether
              the Range is entirely within, partially within, or outside
              of fixed-position content.
      
              * WebCore.exp.in:
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::boundingBoxRect):
              * dom/Range.cpp:
              (WebCore::Range::textRects):
              (WebCore::Range::textQuads):
              * dom/Range.h:
              * rendering/RenderBlock.cpp:
              (WebCore::RenderBlock::absoluteQuads):
              * rendering/RenderBlock.h:
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::absoluteQuads):
              * rendering/RenderBox.h:
              * rendering/RenderInline.cpp:
              (WebCore::RenderInline::absoluteQuads):
              * rendering/RenderInline.h:
              * rendering/RenderObject.h:
              (WebCore::RenderObject::absoluteQuads):
              * rendering/RenderText.cpp:
              (WebCore::RenderText::absoluteRectsForRange):
              (WebCore::RenderText::absoluteQuads):
              (WebCore::RenderText::absoluteQuadsForRange):
              * rendering/RenderText.h:
              * rendering/RenderView.cpp:
              (WebCore::RenderView::absoluteQuads):
              * rendering/RenderView.h:
              * rendering/svg/RenderSVGHiddenContainer.cpp:
              (WebCore::RenderSVGHiddenContainer::absoluteQuads):
              * rendering/svg/RenderSVGHiddenContainer.h:
              * rendering/svg/RenderSVGInline.cpp:
              (WebCore::RenderSVGInline::absoluteQuads):
              * rendering/svg/RenderSVGInline.h:
              * rendering/svg/RenderSVGModelObject.cpp:
              (WebCore::RenderSVGModelObject::absoluteQuads):
              * rendering/svg/RenderSVGModelObject.h:
              * rendering/svg/RenderSVGText.cpp:
              (WebCore::RenderSVGText::absoluteQuads):
              * rendering/svg/RenderSVGText.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@92438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      329523a6