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. 28 Mar, 2013 1 commit
    • commit-queue@webkit.org's avatar
      [css3-text] Add platform support for "wavy" text decoration style · de3db7b1
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=92868
      
      Patch by Lamarque V. Souza <Lamarque.Souza@basyskom.com> on 2013-03-28
      Reviewed by Benjamin Poulain.
      
      Source/WebCore:
      
      This patch uses GraphicsContext::strokePath() to implement
      wavy decoration for the CSS3 property "text-decoration-style".
      
      No new tests as this is covered with existing tests.
      
      * rendering/InlineTextBox.cpp:
      (WebCore::textDecorationStyleToStrokeStyle): Remove obsolete comment.
      (WebCore::adjustStepToDecorationLength): Add function to adjust
      variables used to calculate the lenght of Bezier curves.
      (WebCore::strokeWavyTextDecoration): Add function to stroke wavy
      decoration based on cubic Bezier curve.
      (WebCore::InlineTextBox::paintDecoration): Call
      strokeWavyTextDecoration when necessary.
      
      LayoutTests:
      
      Rebaseline chromium-linux expectation for
      fast/css3-text/css3-text-decoration/text-decoration-style.html.
      
      * platform/chromium-linux/fast/css3-text/css3-text-decoration/text-decoration-style-expected.png: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@147170 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      de3db7b1
  3. 27 Mar, 2013 1 commit
  4. 18 Mar, 2013 1 commit
    • commit-queue@webkit.org's avatar
      [css3-text] Add rendering support for -webkit-text-underline-position · ba7c7004
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=102795
      
      Patch by Lamarque V. Souza <Lamarque.Souza@basyskom.com> on 2013-03-18
      Reviewed by Levi Weintraub.
      
      Source/WebCore:
      
      This patch implements rendering support for values [ auto | alphabetic | under ]
      of CSS3 property text-underline-position. We don't fully match the specification
      as we don't support [ left | right ] and this is left for another implementation
      as the rendering will need to be added.
      
      Tests: fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html
             fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html
             fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html
             fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html
             fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html
      
      * rendering/InlineFlowBox.cpp:
      (WebCore::InlineFlowBox::computeMaxLogicalTop): Added method to compute maximal logical top among all chidren of
      this InlineTextBox.
      * rendering/InlineFlowBox.h:
      (InlineFlowBox):
      * rendering/InlineTextBox.cpp:
      (WebCore::computeUnderlineOffset): Added method to compute offset for text-underline-position property.
      (WebCore::InlineTextBox::paintDecoration): Paint decoration at position calculated using computeUnderlineOffset().
      * rendering/RootInlineBox.cpp:
      (WebCore::RootInlineBox::RootInlineBox):
      (WebCore::RootInlineBox::alignBoxesInBlockDirection): Call method to compute maximal logical top among all
      children of this RootInlineBox.
      * rendering/RootInlineBox.h:
      (RootInlineBox):
      (WebCore::RootInlineBox::maxLogicalTop): Added getter for m_maxLogicalTop class member.
      * rendering/style/RenderStyle.h: Added the usual getter / setter / initial methods for text-underline-position
      property
      
      LayoutTests:
      
      Added text-underline-position tests for 'text-underline-position' CSS3
      property, with 'webkit' prefix.
      
      * fast/css3-text/css3-text-decoration/text-underline-position/style.css: Added.
      * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.txt: Added.
      * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all.html: Added.
      * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.txt: Added.
      * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic.html: Added.
      * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.txt: Added.
      * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto.html: Added.
      * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.txt: Added.
      * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.txt: Added.
      * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow.html: Added.
      * fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html: Added.
      * platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-all-expected.png: Added.
      * platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-alphabetic-expected.png: Added.
      * platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-auto-expected.png: Added.
      * platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-expected.png: Added.
      * platform/chromium-linux/fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under-out-of-flow-expected.png: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146104 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ba7c7004
  5. 04 Feb, 2013 1 commit
    • inferno@chromium.org's avatar
      Add ASSERT_WITH_SECURITY_IMPLICATION to detect out of bounds access · 7223e457
      inferno@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=108668
      
      Reviewed by Eric Seidel.
      
      Source/WebCore:
      
      * bindings/v8/SerializedScriptValue.cpp:
      * css/CSSCalculationValue.cpp:
      (WebCore::CSSCalcExpressionNodeParser::parseCalc):
      * css/CSSImageSetValue.cpp:
      (WebCore::CSSImageSetValue::fillImageSet):
      (WebCore::CSSImageSetValue::customCssText):
      * css/CSSParserValues.h:
      (WebCore::CSSParserString::operator[]):
      * css/CSSValueList.h:
      (WebCore::CSSValueListInspector::item):
      * css/StyleSheetContents.cpp:
      (WebCore::StyleSheetContents::ruleAt):
      (WebCore::StyleSheetContents::wrapperInsertRule):
      (WebCore::StyleSheetContents::wrapperDeleteRule):
      * dom/Document.cpp:
      (WebCore::Document::processArguments):
      * dom/Element.cpp:
      (WebCore::Element::removeAttributeInternal):
      * dom/ElementAttributeData.cpp:
      (WebCore::ElementAttributeData::removeAttribute):
      * dom/ElementAttributeData.h:
      (WebCore::ElementAttributeData::attributeItem):
      * dom/SpaceSplitString.h:
      (WebCore::SpaceSplitStringData::operator[]):
      (WebCore::SpaceSplitString::operator[]):
      * editing/TextIterator.cpp:
      (WebCore::TextIterator::characterAt):
      * html/HTMLFormElement.cpp:
      (WebCore::HTMLFormElement::removeFormElement):
      * html/HTMLSelectElementWin.cpp:
      (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
      * html/canvas/WebGLRenderingContext.cpp:
      (WebCore):
      * html/parser/HTMLFormattingElementList.cpp:
      (WebCore::HTMLFormattingElementList::swapTo):
      * inspector/InspectorStyleSheet.cpp:
      (WebCore::InspectorStyleSheet::styleSheetTextWithChangedStyle):
      * inspector/InspectorStyleTextEditor.cpp:
      (WebCore::InspectorStyleTextEditor::replaceProperty):
      * inspector/InspectorValues.cpp:
      (WebCore::InspectorArrayBase::get):
      * page/WindowFeatures.cpp:
      (WebCore::WindowFeatures::WindowFeatures):
      * platform/audio/AudioArray.h:
      (WebCore::AudioArray::at):
      * platform/audio/AudioFIFO.cpp:
      (WebCore::AudioFIFO::findWrapLengths):
      * platform/graphics/GlyphPage.h:
      (WebCore::GlyphPage::glyphDataForIndex):
      (WebCore::GlyphPage::glyphAt):
      (WebCore::GlyphPage::setGlyphDataForIndex):
      * platform/graphics/TextRun.h:
      (WebCore::TextRun::operator[]):
      (WebCore::TextRun::data8):
      (WebCore::TextRun::data16):
      * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
      (WebCore::HarfBuzzShaper::setDrawRange):
      * platform/graphics/openvg/TiledImageOpenVG.cpp:
      (WebCore::TiledImageOpenVG::setTile):
      (WebCore::TiledImageOpenVG::tile):
      * platform/image-decoders/ico/ICOImageDecoder.cpp:
      (WebCore::ICOImageDecoder::decodeAtIndex):
      (WebCore::ICOImageDecoder::imageTypeAtIndex):
      * platform/text/QuotedPrintable.cpp:
      (WebCore::lengthOfLineEndingAtIndex):
      * platform/text/SegmentedString.cpp:
      (WebCore::SegmentedString::advance):
      * platform/win/WebCoreTextRenderer.cpp:
      (WebCore::doDrawTextAtPoint):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paint):
      (WebCore::InlineTextBox::paintSelection):
      
      Source/WebKit/chromium:
      
      * src/ContextFeaturesClientImpl.cpp:
      (WebKit::ContextFeaturesCache::entryFor):
      * src/WebFrameImpl.cpp:
      (WebKit::WebFrameImpl::selectFindMatch):
      
      Source/WebKit2:
      
      * Shared/mac/SandboxExtensionMac.mm:
      (WebKit::SandboxExtension::HandleArray::operator[]):
      
      Source/WTF:
      
      * wtf/AVLTree.h:
      (WTF::AVLTreeDefaultBSet::operator[]):
      * wtf/BitArray.h:
      (WTF::BitArray::set):
      (WTF::BitArray::get):
      * wtf/FastBitVector.h:
      (WTF::FastBitVector::set):
      (WTF::FastBitVector::clear):
      (WTF::FastBitVector::get):
      * wtf/FixedArray.h:
      (WTF::FixedArray::operator[]):
      * wtf/RefCountedArray.h:
      (WTF::RefCountedArray::at):
      * wtf/TypedArrayBase.h:
      (WTF::TypedArrayBase::item):
      * wtf/text/StringBuffer.h:
      (WTF::StringBuffer::operator[]):
      * wtf/text/StringBuilder.h:
      (WTF::StringBuilder::operator[]):
      * wtf/text/StringImpl.h:
      (WTF::StringImpl::operator[]):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141816 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7223e457
  6. 01 Feb, 2013 1 commit
    • loislo@chromium.org's avatar
      Web Inspector: Native Memory Instrumentation: provide edge names to class... · a7d09fcf
      loislo@chromium.org authored
      Web Inspector: Native Memory Instrumentation: provide edge names to class members in all WebCore instrumented classes.
      https://bugs.webkit.org/show_bug.cgi?id=107369
      
      Reviewed by Yury Semikhatsky.
      
      It is almost mechanical change generated by a script.
      Late I'll implement name to edge name consistency check in clang plugin.
      
      * Modules/webaudio/AudioContext.cpp:
      (WebCore::AudioContext::reportMemoryUsage):
      * Modules/webaudio/AudioNode.cpp:
      (WebCore::AudioNode::reportMemoryUsage):
      * bindings/js/ScriptWrappable.h:
      (WebCore::ScriptWrappable::reportMemoryUsage):
      * bindings/v8/DOMDataStore.cpp:
      (WebCore::DOMDataStore::reportMemoryUsage):
      * bindings/v8/DOMWrapperMap.h:
      (WebCore::DOMWrapperMap::reportMemoryUsage):
      * bindings/v8/V8PerIsolateData.cpp:
      (WebCore::V8PerIsolateData::reportMemoryUsage):
      * bindings/v8/V8ValueCache.cpp:
      (WebCore::StringCache::reportMemoryUsage):
      * css/CSSBorderImageSliceValue.cpp:
      (WebCore::CSSBorderImageSliceValue::reportDescendantMemoryUsage):
      * css/CSSCalculationValue.cpp:
      * css/CSSCanvasValue.cpp:
      (WebCore::CSSCanvasValue::reportDescendantMemoryUsage):
      * css/CSSCharsetRule.cpp:
      (WebCore::CSSCharsetRule::reportMemoryUsage):
      * css/CSSComputedStyleDeclaration.cpp:
      (WebCore::CSSComputedStyleDeclaration::reportMemoryUsage):
      * css/CSSCrossfadeValue.cpp:
      (WebCore::CSSCrossfadeValue::reportDescendantMemoryUsage):
      * css/CSSCursorImageValue.cpp:
      (WebCore::CSSCursorImageValue::reportDescendantMemoryUsage):
      * css/CSSFontFaceRule.cpp:
      (WebCore::CSSFontFaceRule::reportMemoryUsage):
      * css/CSSFontFaceSrcValue.cpp:
      (WebCore::CSSFontFaceSrcValue::reportDescendantMemoryUsage):
      * css/CSSFunctionValue.cpp:
      (WebCore::CSSFunctionValue::reportDescendantMemoryUsage):
      * css/CSSGradientValue.cpp:
      (WebCore::CSSGradientColorStop::reportMemoryUsage):
      (WebCore::CSSGradientValue::reportBaseClassMemoryUsage):
      (WebCore::CSSLinearGradientValue::reportDescendantMemoryUsage):
      (WebCore::CSSRadialGradientValue::reportDescendantMemoryUsage):
      * css/CSSGroupingRule.cpp:
      (WebCore::CSSGroupingRule::reportMemoryUsage):
      * css/CSSImageGeneratorValue.cpp:
      (WebCore::CSSImageGeneratorValue::reportBaseClassMemoryUsage):
      * css/CSSImageSetValue.cpp:
      (WebCore::CSSImageSetValue::reportDescendantMemoryUsage):
      (WebCore::CSSImageSetValue::ImageWithScale::reportMemoryUsage):
      * css/CSSImageValue.cpp:
      (WebCore::CSSImageValue::reportDescendantMemoryUsage):
      * css/CSSImportRule.cpp:
      (WebCore::CSSImportRule::reportMemoryUsage):
      * css/CSSMediaRule.cpp:
      (WebCore::CSSMediaRule::reportMemoryUsage):
      * css/CSSPageRule.cpp:
      (WebCore::CSSPageRule::reportMemoryUsage):
      * css/CSSPrimitiveValue.cpp:
      (WebCore::CSSPrimitiveValue::reportDescendantMemoryUsage):
      * css/CSSProperty.cpp:
      (WebCore::CSSProperty::reportMemoryUsage):
      * css/CSSReflectValue.cpp:
      (WebCore::CSSReflectValue::reportDescendantMemoryUsage):
      * css/CSSRule.cpp:
      (WebCore::CSSRule::reportMemoryUsage):
      * css/CSSRuleList.cpp:
      (WebCore::StaticCSSRuleList::reportMemoryUsage):
      * css/CSSRuleList.h:
      * css/CSSSelectorList.cpp:
      (WebCore::CSSSelectorList::reportMemoryUsage):
      * css/CSSStyleRule.cpp:
      (WebCore::CSSStyleRule::reportMemoryUsage):
      * css/CSSStyleSheet.cpp:
      (WebCore::CSSStyleSheet::reportMemoryUsage):
      * css/CSSValue.cpp:
      (WebCore::TextCloneCSSValue::reportDescendantMemoryUsage):
      * css/CSSValueList.cpp:
      (WebCore::CSSValueList::reportDescendantMemoryUsage):
      * css/CSSVariableValue.h:
      (WebCore::CSSVariableValue::reportDescendantMemoryUsage):
      * css/FontFeatureValue.cpp:
      (WebCore::FontFeatureValue::reportDescendantMemoryUsage):
      * css/FontValue.cpp:
      (WebCore::FontValue::reportDescendantMemoryUsage):
      * css/MediaList.cpp:
      (WebCore::MediaQuerySet::reportMemoryUsage):
      (WebCore::MediaList::reportMemoryUsage):
      * css/MediaQuery.cpp:
      (WebCore::MediaQuery::reportMemoryUsage):
      * css/MediaQueryExp.cpp:
      (WebCore::MediaQueryExp::reportMemoryUsage):
      * css/PropertySetCSSStyleDeclaration.cpp:
      (WebCore::PropertySetCSSStyleDeclaration::reportMemoryUsage):
      (WebCore::StyleRuleCSSStyleDeclaration::reportMemoryUsage):
      (WebCore::InlineCSSStyleDeclaration::reportMemoryUsage):
      * css/RuleFeature.cpp:
      (WebCore::RuleFeatureSet::reportMemoryUsage):
      * css/RuleSet.cpp:
      (WebCore::RuleData::reportMemoryUsage):
      (WebCore::RuleSet::reportMemoryUsage):
      (WebCore::RuleSet::RuleSetSelectorPair::reportMemoryUsage):
      * css/ShadowValue.cpp:
      (WebCore::ShadowValue::reportDescendantMemoryUsage):
      * css/StylePropertySet.cpp:
      (WebCore::StylePropertySet::reportMemoryUsage):
      * css/StyleResolver.cpp:
      (WebCore::StyleResolver::MatchedProperties::reportMemoryUsage):
      (WebCore::StyleResolver::MatchedPropertiesCacheItem::reportMemoryUsage):
      (WebCore::MediaQueryResult::reportMemoryUsage):
      (WebCore::StyleResolver::reportMemoryUsage):
      * css/StyleRule.cpp:
      (WebCore::StyleRule::reportDescendantMemoryUsage):
      (WebCore::StyleRulePage::reportDescendantMemoryUsage):
      (WebCore::StyleRuleFontFace::reportDescendantMemoryUsage):
      (WebCore::StyleRuleGroup::reportDescendantMemoryUsage):
      (WebCore::StyleRuleMedia::reportDescendantMemoryUsage):
      (WebCore::StyleRuleRegion::reportDescendantMemoryUsage):
      (WebCore::StyleRuleViewport::reportDescendantMemoryUsage):
      * css/StyleRuleImport.cpp:
      (WebCore::StyleRuleImport::reportDescendantMemoryUsage):
      * css/StyleScopeResolver.cpp:
      (WebCore::StyleScopeResolver::reportMemoryUsage):
      * css/StyleSheetContents.cpp:
      (WebCore::StyleSheetContents::reportMemoryUsage):
      * css/WebKitCSSKeyframeRule.cpp:
      (WebCore::StyleKeyframe::reportMemoryUsage):
      (WebCore::WebKitCSSKeyframeRule::reportMemoryUsage):
      * css/WebKitCSSKeyframesRule.cpp:
      (WebCore::StyleRuleKeyframes::reportDescendantMemoryUsage):
      (WebCore::WebKitCSSKeyframesRule::reportMemoryUsage):
      * css/WebKitCSSSVGDocumentValue.cpp:
      (WebCore::WebKitCSSSVGDocumentValue::reportDescendantMemoryUsage):
      * css/WebKitCSSShaderValue.cpp:
      (WebCore::WebKitCSSShaderValue::reportDescendantMemoryUsage):
      * css/WebKitCSSViewportRule.cpp:
      (WebCore::WebKitCSSViewportRule::reportMemoryUsage):
      * dom/Attribute.h:
      (WebCore::Attribute::reportMemoryUsage):
      * dom/CharacterData.cpp:
      (WebCore::CharacterData::reportMemoryUsage):
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::reportMemoryUsage):
      * dom/ContainerNode.h:
      (ContainerNode):
      * dom/Document.cpp:
      (WebCore::Document::reportMemoryUsage):
      * dom/DocumentEventQueue.cpp:
      (WebCore::DocumentEventQueue::reportMemoryUsage):
      * dom/DocumentOrderedMap.cpp:
      (WebCore::DocumentOrderedMap::reportMemoryUsage):
      * dom/DocumentStyleSheetCollection.cpp:
      (WebCore::DocumentStyleSheetCollection::reportMemoryUsage):
      * dom/Element.cpp:
      (WebCore::Element::reportMemoryUsage):
      * dom/ElementAttributeData.cpp:
      (WebCore::ElementAttributeData::reportMemoryUsage):
      * dom/ElementRareData.cpp:
      (WebCore::ElementRareData::reportMemoryUsage):
      * dom/ElementShadow.cpp:
      (WebCore::ElementShadow::reportMemoryUsage):
      * dom/Event.cpp:
      (WebCore::Event::reportMemoryUsage):
      * dom/LiveNodeList.cpp:
      (WebCore::LiveNodeListBase::reportMemoryUsage):
      * dom/Node.cpp:
      (WebCore::Node::reportMemoryUsage):
      * dom/NodeRareData.cpp:
      (WebCore::NodeListsNodeData::reportMemoryUsage):
      (WebCore::NodeRareData::reportMemoryUsage):
      * dom/QualifiedName.cpp:
      (WebCore::QualifiedName::reportMemoryUsage):
      (WebCore::QualifiedName::QualifiedNameImpl::reportMemoryUsage):
      * dom/ScriptExecutionContext.cpp:
      (WebCore::ScriptExecutionContext::reportMemoryUsage):
      * dom/SecurityContext.cpp:
      (WebCore::SecurityContext::reportMemoryUsage):
      * dom/ShadowRoot.cpp:
      (WebCore::ShadowRoot::reportMemoryUsage):
      * dom/TreeScope.cpp:
      (WebCore::TreeScope::reportMemoryUsage):
      * html/HTMLCanvasElement.cpp:
      (WebCore::HTMLCanvasElement::reportMemoryUsage):
      * html/HTMLFormControlElement.cpp:
      (WebCore::HTMLFormControlElement::reportMemoryUsage):
      * html/HTMLImageElement.cpp:
      (WebCore::HTMLImageElement::reportMemoryUsage):
      * html/HTMLInputElement.cpp:
      (WebCore::HTMLInputElement::reportMemoryUsage):
      * html/HTMLMediaElement.cpp:
      (WebCore::HTMLMediaElement::reportMemoryUsage):
      * html/HTMLTextFormControlElement.cpp:
      (WebCore::HTMLTextFormControlElement::reportMemoryUsage):
      * inspector/HeapGraphSerializer.cpp:
      (WebCore::HeapGraphSerializer::HeapGraphSerializer):
      (WebCore::HeapGraphSerializer::reportNode):
      (WebCore::HeapGraphSerializer::reportMemoryUsage):
      * inspector/HeapGraphSerializer.h:
      (HeapGraphSerializer):
      * inspector/InspectorBaseAgent.cpp:
      (WebCore::InspectorBaseAgentInterface::reportMemoryUsage):
      * inspector/InspectorController.cpp:
      (WebCore::InspectorController::reportMemoryUsage):
      * inspector/InspectorDOMStorageAgent.cpp:
      (WebCore::InspectorDOMStorageAgent::reportMemoryUsage):
      * inspector/InspectorDOMStorageResource.cpp:
      (WebCore::InspectorDOMStorageResource::reportMemoryUsage):
      * inspector/InspectorDebuggerAgent.cpp:
      (WebCore::InspectorDebuggerAgent::reportMemoryUsage):
      (WebCore::ScriptDebugListener::Script::reportMemoryUsage):
      * inspector/InspectorMemoryAgent.cpp:
      (WebCore::InspectorMemoryAgent::reportMemoryUsage):
      * inspector/InspectorOverlay.cpp:
      (WebCore::InspectorOverlay::reportMemoryUsage):
      * inspector/InspectorProfilerAgent.cpp:
      (WebCore::InspectorProfilerAgent::reportMemoryUsage):
      * inspector/InspectorResourceAgent.cpp:
      (WebCore::InspectorResourceAgent::reportMemoryUsage):
      * inspector/MemoryInstrumentationImpl.cpp:
      (WebCore::MemoryInstrumentationClientImpl::reportMemoryUsage):
      (WebCore::MemoryInstrumentationImpl::reportMemoryUsage):
      * inspector/NetworkResourcesData.cpp:
      (WebCore::XHRReplayData::reportMemoryUsage):
      (WebCore::NetworkResourcesData::ResourceData::reportMemoryUsage):
      (WebCore::NetworkResourcesData::reportMemoryUsage):
      * loader/CachedMetadata.cpp:
      (WebCore::CachedMetadata::reportMemoryUsage):
      * loader/DocumentLoader.cpp:
      (WebCore::DocumentLoader::reportMemoryUsage):
      * loader/FrameLoader.cpp:
      (WebCore::FrameLoader::reportMemoryUsage):
      * loader/MainResourceLoader.cpp:
      (WebCore::MainResourceLoader::reportMemoryUsage):
      * loader/Prerenderer.cpp:
      (WebCore::Prerenderer::reportMemoryUsage):
      * loader/ResourceBuffer.cpp:
      (WebCore::ResourceBuffer::reportMemoryUsage):
      * loader/ResourceLoader.cpp:
      (WebCore::ResourceLoader::reportMemoryUsage):
      * loader/SubresourceLoader.cpp:
      (WebCore::SubresourceLoader::reportMemoryUsage):
      * loader/SubstituteData.cpp:
      (WebCore::SubstituteData::reportMemoryUsage):
      * loader/cache/CachedCSSStyleSheet.cpp:
      (WebCore::CachedCSSStyleSheet::reportMemoryUsage):
      * loader/cache/CachedFont.cpp:
      (WebCore::CachedFont::reportMemoryUsage):
      * loader/cache/CachedImage.cpp:
      (WebCore::CachedImage::reportMemoryUsage):
      * loader/cache/CachedResource.cpp:
      (WebCore::CachedResource::reportMemoryUsage):
      * loader/cache/CachedResourceHandle.cpp:
      (WebCore::CachedResourceHandleBase::reportMemoryUsage):
      * loader/cache/CachedResourceLoader.cpp:
      (WebCore::CachedResourceLoader::reportMemoryUsage):
      * loader/cache/CachedSVGDocument.cpp:
      (WebCore::CachedSVGDocument::reportMemoryUsage):
      * loader/cache/CachedScript.cpp:
      (WebCore::CachedScript::reportMemoryUsage):
      * loader/cache/CachedShader.cpp:
      (WebCore::CachedShader::reportMemoryUsage):
      * loader/cache/CachedXSLStyleSheet.cpp:
      (WebCore::CachedXSLStyleSheet::reportMemoryUsage):
      * loader/cache/MemoryCache.cpp:
      (WebCore::MemoryCache::reportMemoryUsage):
      * page/DOMTimer.cpp:
      (WebCore::DOMTimer::reportMemoryUsage):
      * page/Frame.cpp:
      (WebCore::Frame::reportMemoryUsage):
      * page/Page.cpp:
      (WebCore::Page::reportMemoryUsage):
      * platform/KURL.cpp:
      (WebCore::KURL::reportMemoryUsage):
      * platform/KURLGoogle.cpp:
      (WebCore::KURLGooglePrivate::reportMemoryUsage):
      * platform/KURLWTFURLImpl.h:
      (WebCore::KURLWTFURLImpl::reportMemoryUsage):
      * platform/ScrollableArea.cpp:
      (WebCore::ScrollableArea::reportMemoryUsage):
      * platform/SharedBuffer.cpp:
      (WebCore::SharedBuffer::reportMemoryUsage):
      * platform/audio/AudioArray.h:
      (WebCore::AudioArray::reportMemoryUsage):
      * platform/audio/FFTFrame.cpp:
      (WebCore::FFTFrame::reportMemoryUsage):
      * platform/audio/HRTFDatabase.cpp:
      (WebCore::HRTFDatabase::reportMemoryUsage):
      * platform/audio/HRTFDatabaseLoader.cpp:
      (WebCore::HRTFDatabaseLoader::reportMemoryUsage):
      * platform/audio/HRTFElevation.cpp:
      (WebCore::HRTFElevation::reportMemoryUsage):
      * platform/audio/HRTFKernel.cpp:
      (WebCore::HRTFKernel::reportMemoryUsage):
      * platform/audio/ffmpeg/FFTFrameFFMPEG.cpp:
      (reportMemoryUsage):
      * platform/graphics/BitmapImage.cpp:
      (WebCore::BitmapImage::reportMemoryUsage):
      (WebCore::FrameData::reportMemoryUsage):
      * platform/graphics/CrossfadeGeneratedImage.cpp:
      (WebCore::CrossfadeGeneratedImage::reportMemoryUsage):
      * platform/graphics/GeneratorGeneratedImage.cpp:
      (WebCore::GeneratorGeneratedImage::reportMemoryUsage):
      * platform/graphics/GraphicsLayer.cpp:
      (WebCore::GraphicsLayer::reportMemoryUsage):
      * platform/graphics/ImageBuffer.cpp:
      (WebCore::ImageBuffer::reportMemoryUsage):
      * platform/graphics/ImageSource.cpp:
      (WebCore::ImageSource::reportMemoryUsage):
      * platform/graphics/chromium/GraphicsLayerChromium.cpp:
      (WebCore::GraphicsLayerChromium::reportMemoryUsage):
      * platform/graphics/skia/ImageBufferSkia.cpp:
      (WebCore::ImageBufferData::reportMemoryUsage):
      * platform/graphics/skia/MemoryInstrumentationSkia.cpp:
      (reportMemoryUsage):
      * platform/graphics/skia/NativeImageSkia.cpp:
      (WebCore::NativeImageSkia::reportMemoryUsage):
      * platform/image-decoders/ImageDecoder.cpp:
      (WebCore::ImageFrame::reportMemoryUsage):
      (WebCore):
      (WebCore::ImageDecoder::reportMemoryUsage):
      * platform/image-decoders/skia/ImageDecoderSkia.cpp:
      (WebCore::ImageFrame::reportMemoryUsage):
      * platform/network/FormData.cpp:
      (WebCore::FormData::reportMemoryUsage):
      (WebCore::FormDataElement::reportMemoryUsage):
      * platform/network/ResourceRequestBase.cpp:
      (WebCore::ResourceRequestBase::reportMemoryUsageBase):
      * platform/network/ResourceResponseBase.cpp:
      (WebCore::ResourceResponseBase::reportMemoryUsage):
      * platform/network/chromium/ResourceRequest.cpp:
      (WebCore::ResourceRequest::reportMemoryUsage):
      * rendering/InlineBox.cpp:
      (WebCore::InlineBox::reportMemoryUsage):
      * rendering/InlineFlowBox.cpp:
      (WebCore::InlineFlowBox::reportMemoryUsage):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::reportMemoryUsage):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::reportMemoryUsage):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::reportMemoryUsage):
      * rendering/RenderFrameSet.cpp:
      (WebCore::RenderFrameSet::reportMemoryUsage):
      (WebCore::RenderFrameSet::GridAxis::reportMemoryUsage):
      * rendering/RenderInline.cpp:
      (WebCore::RenderInline::reportMemoryUsage):
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::reportMemoryUsage):
      * rendering/RenderLayerBacking.cpp:
      (WebCore::RenderLayerBacking::reportMemoryUsage):
      * rendering/RenderLayerCompositor.cpp:
      (WebCore::RenderLayerCompositor::reportMemoryUsage):
      * rendering/RenderListMarker.cpp:
      (WebCore::RenderListMarker::reportMemoryUsage):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::reportMemoryUsage):
      * rendering/RenderTableCol.cpp:
      (WebCore::RenderTableCol::reportMemoryUsage):
      * rendering/RenderTableRow.cpp:
      (WebCore::RenderTableRow::reportMemoryUsage):
      * rendering/RenderTableSection.cpp:
      (WebCore::RenderTableSection::reportMemoryUsage):
      (WebCore::RenderTableSection::RowStruct::reportMemoryUsage):
      (WebCore::RenderTableSection::CellStruct::reportMemoryUsage):
      * rendering/RenderText.cpp:
      (WebCore::RenderText::reportMemoryUsage):
      * rendering/RenderView.cpp:
      (WebCore::RenderView::reportMemoryUsage):
      * rendering/style/DataRef.h:
      (WebCore::DataRef::reportMemoryUsage):
      * rendering/style/RenderStyle.cpp:
      (WebCore::RenderStyle::reportMemoryUsage):
      * rendering/style/StyleRareInheritedData.cpp:
      (WebCore::StyleRareInheritedData::reportMemoryUsage):
      * rendering/style/StyleRareNonInheritedData.cpp:
      (WebCore::StyleRareNonInheritedData::reportMemoryUsage):
      * svg/SVGPaint.cpp:
      (WebCore::SVGPaint::reportDescendantMemoryUsage):
      * svg/graphics/SVGImage.cpp:
      (WebCore::SVGImage::reportMemoryUsage):
      * xml/XMLHttpRequest.cpp:
      (WebCore::XMLHttpRequest::reportMemoryUsage):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@141570 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a7d09fcf
  7. 16 Jan, 2013 1 commit
    • simon.fraser@apple.com's avatar
      Allow PaintInfo to carry all PaintBehavior flags · 2bedf6f3
      simon.fraser@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=106980
      
      Reviewed by Sam Weinig.
      
      PaintInfo has a single boolean for forceBlackText, but I'll be adding additional
      paint behaviors that I'd like to access from PaintInfo, so it makes sense for
      PaintInfo to just include the set of PaintBehavior flags.
      
      Also add default values in the constructor arguments for rarely used parameters.
      
      No behavior change, no tests.
      
      * rendering/EllipsisBox.cpp:
      (WebCore::EllipsisBox::paint): Use the forceBlackText() function.
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paint): Call forceBlackText().
      * rendering/PaintInfo.h:
      (WebCore::PaintInfo::PaintInfo): Pass PaintBehavior rather than a forceBlackText boolean.
      (WebCore::PaintInfo::forceBlackText): Return true if the behavior flags contain PaintBehaviorForceBlackText.
      * rendering/RenderBoxModelObject.cpp:
      (WebCore::RenderBoxModelObject::paintFillLayerExtended): Pass PaintBehaviorForceBlackText instead of 'true'
      when painting for background-clip: text.
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::paintLayerContents): Pass PaintBehaviorNormal where we used to pass 'false',
      and omit default 0 parameters.
      * rendering/svg/SVGRenderingContext.cpp:
      (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): PaintBehaviorNormal and remove default params.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@139908 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2bedf6f3
  8. 22 Dec, 2012 1 commit
  9. 16 Dec, 2012 1 commit
    • leviw@chromium.org's avatar
      Push pixel snapping logic into TransformState · 104fddd8
      leviw@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=101779
      
      Reviewed by Simon Fraser.
      
      Source/WebCore:
      
      The old SnapOffsetForTransforms behavior fell apart when there was content nested in
      multiple levels of containers with sub-pixel offsets. The point of this flag was to
      mirror the pixel snapping that occurs in paint, where offsets are accumulated bottom-
      up through the render tree and snapped at the end. This change eliminates this flag
      and pushes pixel snapping logic down into TransformState.
      
      TransformState now tracks a LayoutSize accumulated offset when there's no transform
      or we're just translating. We then snap and apply this offset before accumulating
      values into a transform, and when returning planar coordinates to callers.
      
      Test: fast/sub-pixel/transformed-iframe-copy-on-scroll.html added,
            fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html modified to also catch this bug.
      
      * platform/graphics/transforms/TransformState.cpp:
      (WebCore::TransformState::operator=): Pass accumulated offset.
      (WebCore::TransformState::translateTransform): Extracted this functionality for
      re-use when applying the accumulated offset, or accumulating from a call to move.
      (WebCore::TransformState::translateMappedCoordinates): Same as above when we're not
      acculating into a transform.
      (WebCore::TransformState::move): Changed to accumulate into m_accumulatedOffset when
      not accumulating into a transform.
      (WebCore::TransformState::applyAccumulatedOffset):
      (WebCore::TransformState::applyTransform): Applies the accumulated offset before the
      transform.
      (WebCore::TransformState::flatten): Ditto for flattening.
      (WebCore::TransformState::mappedPoint): Translates by the accumulated offset before
      returning.
      (WebCore::TransformState::mappedQuad): Ditto.
      * platform/graphics/transforms/TransformState.h:
      (TransformState): Added m_accumulatedOffset.
      * rendering/RenderGeometryMap.cpp:
      (WebCore::RenderGeometryMap::mapToContainer): When not using a transform, we still need
      to snap our offset before applying to our float result. Also, flatten when we have a
      non-uniform step.
      * rendering/RenderGeometryMap.h:
      (RenderGeometryMap): Remove use of SnapOffsetForTransforms.
      
      Everything below simply drops the use of SnapOffsetForTransforms:
      
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::getUpperLeftCorner):
      * dom/MouseRelatedEvent.cpp:
      (WebCore::MouseRelatedEvent::computeRelativePosition):
      * editing/FrameSelection.cpp:
      (WebCore::CaretBase::absoluteBoundsForLocalRect):
      * editing/RenderedPosition.cpp:
      (WebCore::RenderedPosition::absoluteRect):
      * editing/VisiblePosition.cpp:
      (WebCore::VisiblePosition::absoluteCaretBounds):
      * html/HTMLSelectElement.cpp:
      (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
      * html/shadow/SliderThumbElement.cpp:
      (WebCore::SliderThumbElement::setPositionFromPoint):
      * html/shadow/SpinButtonElement.cpp:
      (WebCore::SpinButtonElement::defaultEventHandler):
      * page/FrameView.cpp:
      (WebCore::FrameView::convertFromRenderer):
      (WebCore::FrameView::convertToRenderer):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paintDocumentMarker):
      (WebCore::InlineTextBox::paintTextMatchMarker):
      (WebCore::InlineTextBox::computeRectForReplacementMarker):
      * rendering/LayoutState.cpp:
      (WebCore::LayoutState::LayoutState):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::mapLocalToContainer):
      (WebCore::RenderBox::pushMappingToContainer):
      * rendering/RenderBox.h:
      (RenderBox):
      * rendering/RenderBoxModelObject.cpp:
      (WebCore::RenderBoxModelObject::computeStickyPositionConstraints):
      * rendering/RenderEmbeddedObject.cpp:
      (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
      * rendering/RenderFrameSet.cpp:
      (WebCore::RenderFrameSet::userResize):
      * rendering/RenderInline.cpp:
      (WebCore::RenderInline::mapLocalToContainer):
      (WebCore::RenderInline::pushMappingToContainer):
      * rendering/RenderInline.h:
      (RenderInline):
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::absoluteToContents):
      (WebCore::RenderLayer::scrollTo):
      (WebCore::RenderLayer::childrenClipRect):
      (WebCore::RenderLayer::selfClipRect):
      * rendering/RenderLayerBacking.cpp:
      (WebCore::RenderLayerBacking::contentsVisible):
      * rendering/RenderMediaControls.cpp:
      (WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton):
      * rendering/RenderMenuList.cpp:
      (WebCore::RenderMenuList::showPopup):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::absoluteFocusRingQuads):
      * rendering/RenderObject.h:
      * rendering/RenderText.cpp:
      (WebCore::RenderText::absoluteRectsForRange):
      (WebCore::RenderText::absoluteQuads):
      (WebCore::RenderText::absoluteQuadsForRange):
      * rendering/RenderTheme.cpp:
      (WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
      * rendering/RenderView.cpp:
      (WebCore::RenderView::selectionBounds):
      * rendering/RenderView.h:
      (RenderView):
      * rendering/RenderWidget.cpp:
      (WebCore::RenderWidget::updateWidgetGeometry):
      * rendering/svg/RenderSVGForeignObject.cpp:
      (WebCore::RenderSVGForeignObject::mapLocalToContainer):
      * rendering/svg/RenderSVGForeignObject.h:
      (RenderSVGForeignObject):
      * rendering/svg/RenderSVGInline.cpp:
      (WebCore::RenderSVGInline::mapLocalToContainer):
      * rendering/svg/RenderSVGInline.h:
      (RenderSVGInline):
      * rendering/svg/RenderSVGModelObject.cpp:
      (WebCore::RenderSVGModelObject::mapLocalToContainer):
      * rendering/svg/RenderSVGModelObject.h:
      (RenderSVGModelObject):
      * rendering/svg/RenderSVGRoot.h:
      (RenderSVGRoot):
      * rendering/svg/RenderSVGText.cpp:
      (WebCore::RenderSVGText::mapLocalToContainer):
      * rendering/svg/RenderSVGText.h:
      (RenderSVGText):
      * rendering/svg/SVGRenderSupport.cpp:
      (WebCore::SVGRenderSupport::mapLocalToContainer):
      * rendering/svg/SVGRenderSupport.h:
      (SVGRenderSupport):
      
      Source/WebKit/chromium:
      
      Eliminating use of SnapOffsetForTransforms as it's no longer needed.
      
      * src/FindInPageCoordinates.cpp:
      (WebKit::toNormalizedRect):
      * src/LinkHighlight.cpp:
      (WebKit::convertTargetSpaceQuadToCompositedLayer):
      * src/WebInputEventConversion.cpp:
      (WebKit::convertAbsoluteLocationForRenderObject):
      * src/WebPluginContainerImpl.cpp:
      (WebKit::WebPluginContainerImpl::windowToLocalPoint):
      
      Source/WebKit/mac:
      
      * WebView/WebFullScreenController.mm:
      (screenRectOfContents): Removed SnapOffsetForTransforms as it's no longer needed.
      
      Source/WebKit2:
      
      Eliminating use of SnapOffsetForTransforms as it's no longer needed.
      
      * WebProcess/FullScreen/WebFullScreenManager.cpp:
      (WebKit::screenRectOfContents):
      
      LayoutTests:
      
      * fast/dom/Window/webkitConvertPoint.html: Updating values to match corrected pixel snapping.
      * fast/multicol/break-properties.html: Fixing sub-pixel layout feature checking.
      * fast/multicol/vertical-lr/break-properties.html: Ditto.
      * fast/multicol/vertical-rl/break-properties.html: Ditto.
      * fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html: Updating to catch the bug where the old
      pixel snapping logic did the wrong thing when nested.
      * fast/sub-pixel/transformed-iframe-copy-on-scroll.html: Added.
      * platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png:
      * platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.png: Added.
      * platform/chromium-linux/fast/sub-pixel/transformed-iframe-copy-on-scroll-expected.txt: Added.
      * platform/chromium-win/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.txt:
      * platform/chromium/TestExpectations:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      104fddd8
  10. 13 Dec, 2012 1 commit
    • loislo@chromium.org's avatar
      Web Inspector: Native Memory Instrumentation: do not validate pointers to... · ecccc829
      loislo@chromium.org authored
      Web Inspector: Native Memory Instrumentation: do not validate pointers to objects in RenderArena agains tcmalloc data.
      https://bugs.webkit.org/show_bug.cgi?id=104903
      
      Reviewed by Yury Semikhatsky.
      
      This is a simplest approach to do that with zero performance overhead.
      
      Source/WebCore:
      
      * inspector/InspectorResourceAgent.cpp:
      (WebCore::InspectorResourceAgent::reportMemoryUsage):
      * rendering/InlineBox.cpp:
      (WebCore::InlineBox::reportMemoryUsage):
      (WebCore):
      * rendering/InlineBox.h:
      (InlineBox):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::reportMemoryUsage):
      (WebCore):
      * rendering/InlineTextBox.h:
      (InlineTextBox):
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::reportMemoryUsage):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::reportMemoryUsage):
      
      Source/WTF:
      
      * wtf/MemoryInstrumentation.cpp:
      (WTF::MemoryClassInfo::setCustomAllocation):
      (WTF):
      * wtf/MemoryInstrumentation.h:
      (MemoryClassInfo):
      * wtf/MemoryObjectInfo.h:
      (WTF::MemoryObjectInfo::MemoryObjectInfo):
      (WTF::MemoryObjectInfo::customAllocation):
      (WTF::MemoryObjectInfo::setCustomAllocations):
      (MemoryObjectInfo):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ecccc829
  11. 05 Dec, 2012 1 commit
  12. 07 Nov, 2012 1 commit
    • commit-queue@webkit.org's avatar
      Add replaceWithLiteral() method to WTF::String · bf6f7fa0
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=101257
      
      Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-11-07
      Reviewed by Benjamin Poulain.
      
      Source/WebCore:
      
      Substitute String::replace() calls by String::replaceWithLiteral() where
      adequate, for efficiency.
      
      No new tests, no behavior change.
      
      * dom/Node.cpp:
      (WebCore::Node::showNode):
      * editing/EditingStyle.cpp:
      (WebCore::StyleChange::extractTextStyles):
      * editing/MarkupAccumulator.cpp:
      (WebCore::MarkupAccumulator::appendQuotedURLAttributeValue):
      * html/HTMLAnchorElement.cpp:
      (WebCore::HTMLAnchorElement::setSearch):
      * loader/FormSubmission.cpp:
      (WebCore::appendMailtoPostFormDataToURL):
      * platform/network/soup/ProxyResolverSoup.cpp:
      (soupProxyResolverWkSetProperty):
      * plugins/PluginView.cpp:
      (WebCore::makeURL):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::showBox):
      * xml/XSLTProcessor.cpp:
      (WebCore::transformTextStringToXHTMLDocumentString):
      
      Source/WebKit/blackberry:
      
      Substitute String::replace() calls by String::replaceWithLiteral() where
      adequate, for efficiency.
      
      * WebCoreSupport/SelectPopupClient.cpp:
      (WebCore::SelectPopupClient::generateHTML):
      
      Source/WebKit2:
      
      Substitute String::replace() calls by String::replaceWithLiteral() where
      adequate, for efficiency.
      
      * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
      (WebKit::makeURLString):
      
      Source/WTF:
      
      Add replaceWithLiteral() method to WTF::String that takes
      replacement string as a literal to avoid uselessly constructing
      a String object.
      
      * wtf/text/StringImpl.cpp:
      (WTF::StringImpl::replace):
      (WTF):
      * wtf/text/StringImpl.h:
      (WTF::StringImpl::replace):
      (StringImpl):
      * wtf/text/WTFString.h:
      (String):
      (WTF::String::replaceWithLiteral):
      
      Tools:
      
      Add API tests for String::replaceWithLiteral() and corresponding
      StringImpl methods.
      
      * TestWebKitAPI/CMakeLists.txt: Add WTFString API tests to CMake.
      * TestWebKitAPI/Tests/WTF/StringImpl.cpp:
      (TestWebKitAPI::TEST):
      (TestWebKitAPI):
      * TestWebKitAPI/Tests/WTF/WTFString.cpp:
      (TestWebKitAPI::TEST):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133731 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bf6f7fa0
  13. 22 Oct, 2012 2 commits
    • eae@chromium.org's avatar
      Source/WebCore: Change baselinePosition and maxAscent/maxDescent to int · 82b94988
      eae@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=99767
      
      Reviewed by Levi Weintraub.
      
      Currently baselinePostion, maxAscent and maxDescent are
      LayoutUnits while ascent, descent and m_lineHeight are ints.
      This can lead to subtle alignment and rounding problems.
      
      Change baselinePosition and maxAscent/maxDescent to int to avoid
      these issues.
      
      Test: fast/sub-pixel/replaced-element-baseline.html
      
      * editing/FrameSelection.cpp:
      (WebCore::repaintRectForCaret):
      Inflate Y dimension just like we do for X to ensure that the
      repaint rect fully contains the caret.
      
      * rendering/InlineBox.cpp:
      (WebCore::InlineBox::baselinePosition):
      * rendering/InlineBox.h:
      (InlineBox):
      * rendering/InlineFlowBox.cpp:
      (WebCore::InlineFlowBox::adjustMaxAscentAndDescent):
      (WebCore::InlineFlowBox::computeLogicalBoxHeights):
      (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
      Change maxAscent/maxDescent to int to match ascent/descent.
              
      * rendering/InlineFlowBox.h:
      (InlineFlowBox):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::baselinePosition):
      * rendering/InlineTextBox.h:
      (InlineTextBox):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::baselinePosition):
      (WebCore::RenderBlock::firstLineBoxBaseline):
      (WebCore::RenderBlock::lastLineBoxBaseline):
      * rendering/RenderBlock.h:
      (RenderBlock):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::baselinePosition):
      * rendering/RenderBox.h:
      (WebCore::RenderBox::firstLineBoxBaseline):
      (WebCore::RenderBox::lastLineBoxBaseline):
      (RenderBox):
      * rendering/RenderBoxModelObject.h:
      (RenderBoxModelObject):
      * rendering/RenderFlexibleBox.cpp:
      (WebCore::RenderFlexibleBox::baselinePosition):
      (WebCore::RenderFlexibleBox::firstLineBoxBaseline):
      * rendering/RenderFlexibleBox.h:
      * rendering/RenderInline.cpp:
      (WebCore::RenderInline::baselinePosition):
      * rendering/RenderInline.h:
      (RenderInline):
      * rendering/RenderListBox.cpp:
      (WebCore::RenderListBox::baselinePosition):
      * rendering/RenderListBox.h:
      (RenderListBox):
      * rendering/RenderListMarker.cpp:
      (WebCore::RenderListMarker::baselinePosition):
      * rendering/RenderListMarker.h:
      (RenderListMarker):
      * rendering/RenderSlider.cpp:
      (WebCore::RenderSlider::baselinePosition):
      * rendering/RenderSlider.h:
      (RenderSlider):
      * rendering/RenderTable.cpp:
      (WebCore::RenderTable::baselinePosition):
      (WebCore::RenderTable::lastLineBoxBaseline):
      (WebCore::RenderTable::firstLineBoxBaseline):
      * rendering/RenderTable.h:
      (RenderTable):
      * rendering/RenderTableSection.cpp:
      (WebCore::RenderTableSection::firstLineBoxBaseline):
      * rendering/RenderTableSection.h:
      (RenderTableSection):
      * rendering/RenderTextControlMultiLine.cpp:
      (WebCore::RenderTextControlMultiLine::baselinePosition):
      * rendering/RenderTextControlMultiLine.h:
      (RenderTextControlMultiLine):
      * rendering/RenderTheme.cpp:
      (WebCore::RenderTheme::baselinePosition):
      * rendering/RenderTheme.h:
      (RenderTheme):
      * rendering/RenderThemeSafari.cpp:
      (WebCore::RenderThemeSafari::baselinePosition):
      * rendering/RenderThemeSafari.h:
      (RenderThemeSafari):
      * rendering/RootInlineBox.cpp:
      (WebCore::RootInlineBox::baselinePosition):
      (WebCore::RootInlineBox::alignBoxesInBlockDirection):
      * rendering/RootInlineBox.h:
      (RootInlineBox):
      * rendering/mathml/RenderMathMLBlock.cpp:
      (WebCore::RenderMathMLBlock::baselinePosition):
      (WebCore::RenderMathMLTable::firstLineBoxBaseline):
      * rendering/mathml/RenderMathMLBlock.h:
      (RenderMathMLBlock):
      (RenderMathMLTable):
      * rendering/mathml/RenderMathMLFraction.cpp:
      (WebCore::RenderMathMLFraction::firstLineBoxBaseline):
      * rendering/mathml/RenderMathMLFraction.h:
      (RenderMathMLFraction):
      * rendering/mathml/RenderMathMLOperator.cpp:
      (WebCore::RenderMathMLOperator::firstLineBoxBaseline):
      * rendering/mathml/RenderMathMLOperator.h:
      * rendering/mathml/RenderMathMLUnderOver.cpp:
      (WebCore::RenderMathMLUnderOver::firstLineBoxBaseline):
      * rendering/mathml/RenderMathMLUnderOver.h:
      (RenderMathMLUnderOver):
      
      LayoutTests: Unreviewed, further Apple Mac baselines for shadow DOM changes to RenderSlider.
      
      Patch by Jer Noble <jer.noble@apple.com> on 2012-10-22
      
      * platform/mac/fast/forms/input-appearance-height-expected.txt:
      * platform/mac/media/controls-without-preload-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132112 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      82b94988
    • commit-queue@webkit.org's avatar
      [css3-text] Add rendering support for -webkit-text-decoration-style · 49c5e13b
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=94094
      
      Patch by Bruno de Oliveira Abinader <bruno.abinader@basyskom.com> on 2012-10-22
      Reviewed by Julien Chaffraix.
      
      Source/WebCore:
      
      This patch implements the "text-decoration-style" property rendering as
      specified in CSS3 working draft, with "-webkit-" prefix. The specification can
      be found here: http://dev.w3.org/csswg/css3-text/#text-decoration-style
      
      Additionally, Mozilla implementation details can be found here:
      https://developer.mozilla.org/en/CSS/text-decoration-style
      
      Tests: fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-style.html
             fast/css3-text/css3-text-decoration/text-decoration-style.html
      
      * platform/graphics/GraphicsContext.h:
      * platform/graphics/cairo/GraphicsContextCairo.cpp:
      (WebCore::GraphicsContext::setPlatformStrokeStyle):
      * platform/graphics/cg/GraphicsContextCG.cpp:
      (WebCore::GraphicsContext::drawLine):
      * platform/graphics/qt/GraphicsContextQt.cpp:
      (WebCore::toQPenStyle):
      (WebCore::GraphicsContext::drawLine):
      * platform/graphics/skia/PlatformContextSkia.cpp:
      (WebCore::PlatformContextSkia::setupPaintForStroking):
      * platform/graphics/wince/GraphicsContextWinCE.cpp:
      (WebCore::createPen):
      * platform/graphics/wx/GraphicsContextWx.cpp:
      (WebCore::strokeStyleToWxPenStyle):
      Added 'DoubleStroke' and 'WavyStroke' to StrokeStyle enum and updated
      platform-specific stroke handling. Some styles requires
      platform-specific implementation (handled in bug 92868).
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paint):
      (WebCore::textDecorationStyleToStrokeStyle): Added static function that
      translates text decoration to stroke styles.
      (WebCore::InlineTextBox::paintDecoration): Text decoration style does
      not specify a property for line thickness (like border-width does for
      border style), so we statically set it to 1 for now. The 'double' style
      implementation simply adds a parallel line (depending if it is
      underline, overline or line-through) and the space between lines follows
      the approach used by border's 'double' style.
      * rendering/InlineTextBox.h:
      (InlineTextBox):
      * rendering/style/RenderStyle.h:
      * rendering/style/RenderStyleConstants.h:
      Added text decoration style rendering support to
      InlineTextBox::paintDecoration().
      
      LayoutTests:
      
      Added paint and repaint layout tests for CSS3 text-decoration-style
      property. Pixel results are not included due to missing platform support
      for some decoration styles (handled on bug 93507). These are going
      to be added when platform support is complete.
      
      * fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-style-expected.txt: Added.
      * fast/css3-text/css3-text-decoration/repaint/repaint-text-decoration-style.html: Added.
      * fast/css3-text/css3-text-decoration/text-decoration-style-expected.txt: Added.
      * fast/css3-text/css3-text-decoration/text-decoration-style.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      49c5e13b
  14. 15 Oct, 2012 1 commit
    • msaboff@apple.com's avatar
      Update RenderText to use String instead of UChar* for text · 776c286c
      msaboff@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=96979
      
      Reviewed by Dan Bernstein.
      
      Source/WebCore: 
      
      RenderText now uses a String for text.  It keeps a cached LCHar* or UChar* pointer to the
      actual text data for performance.  Added a characterAt() indexed accessor to RenderText to avoid the
      somewhat confusing construct for a RenderText* rt, e.g. (*re)[n] or rt->characters()[n].  This is
      now written as rt->characterAt(n).
      Enabled patch in the HTML parser to create 8 bit text data.  Modified TextRun to create 
      text runs using 8 bit string data where possible.  Added several flavors of RenderBlock::constructTextRun
      to create TextRuns from RenderText objects including with an offset.  Added an LChar flavor of constructTextRun()
      as well.  Eliminated the TextRunFlags argument to all but the String flavor as all other flavors used the default
      parameter.  
      Encased the code that creates 8 bit TextRun's in #if USE(8BIT_TEXTRUN).  Enabled WTF_USE_8BIT_TEXTRUN
      for PLATFORM(MAC).  Other platform can update this setting in Platform.h when their platform specific code is
      updated to TextRun's with 8 bit data.
      Added many 8/16 bit aware paths.  Cleanup up some int / unsigned confusion in RenderBlockLineLayout.cpp.
      
      No function change therefore no new tests.
      
      * html/parser/HTMLTokenizer.cpp:
      (WebCore::vectorEqualsString):
      (WebCore::HTMLTokenizer::nextToken):
      * html/parser/HTMLTokenizer.h:
      (HTMLTokenizer):
      * html/track/WebVTTTokenizer.cpp:
      (WebCore::vectorEqualsString):
      (WebCore::WebVTTTokenizer::nextToken):
      * html/track/WebVTTTokenizer.h:
      (WebVTTTokenizer):
      * platform/graphics/Font.h:
      (WebCore::Font::glyphDataForCharacter):
      * platform/graphics/FontFastPath.cpp:
      (WebCore):
      * platform/graphics/TextRun.h:
      (WebCore::TextRun::TextRun):
      (WebCore::TextRun::subRun):
      (TextRun):
      * platform/graphics/mac/ComplexTextController.cpp:
      (WebCore::TextLayout::isNeeded):
      (WebCore::TextLayout::constructTextRun):
      * rendering/InlineFlowBox.cpp:
      (WebCore::InlineFlowBox::placeBoxesInInlineDirection):
      * rendering/InlineIterator.h:
      (WebCore::InlineIterator::atTextParagraphSeparator):
      (WebCore::InlineIterator::current):
      (WebCore::InlineIterator::previousInSameNode):
      * rendering/InlineTextBox.cpp:
      (WebCore::adjustCharactersAndLengthForHyphen):
      (WebCore::InlineTextBox::paint):
      (WebCore::InlineTextBox::paintSelection):
      (WebCore::InlineTextBox::constructTextRun):
      * rendering/InlineTextBox.h:
      (InlineTextBox):
      * rendering/RenderBlock.cpp:
      (WebCore::constructTextRunInternal):
      (WebCore::RenderBlock::constructTextRun):
      * rendering/RenderBlock.h:
      (RenderBlock):
      * rendering/RenderBlockLineLayout.cpp:
      (WebCore::endsWithASCIISpaces):
      (WebCore::reachedEndOfTextRenderer):
      (WebCore::RenderBlock::computeInlineDirectionPositionsForLine):
      (WebCore::shouldSkipWhitespaceAfterStartObject):
      (WebCore::textWidth):
      (WebCore::tryHyphenating):
      (WebCore::RenderBlock::LineBreaker::nextLineBreak):
      * rendering/RenderCombineText.cpp:
      (WebCore::RenderCombineText::getStringToRender):
      (WebCore::RenderCombineText::combineText):
      * rendering/RenderCombineText.h:
      (RenderCombineText):
      * rendering/RenderText.cpp:
      (SameSizeAsRenderText):
      (WebCore::RenderText::RenderText):
      (WebCore::RenderText::widthFromCache):
      (WebCore::RenderText::computePreferredLogicalWidths):
      (WebCore::RenderText::setTextInternal):
      (WebCore::RenderText::width):
      * rendering/RenderText.h:
      (WebCore::RenderText::is8Bit):
      (WebCore::RenderText::characters8):
      (WebCore::RenderText::characters16):
      (WebCore::RenderText::characterAt):
      (WebCore::RenderText::operator[]):
      (RenderText):
      * xml/parser/MarkupTokenBase.h:
      (WebCore::MarkupTokenBase::appendToCharacter):
      (MarkupTokenBase):
      (WebCore::MarkupTokenBase::isAll8BitData):
      
      Source/WTF: 
      
      Added WTF_USE_8BIT_TEXTRUN to encase code that creates 8 bit TextRun's.  Enabled WTF_USE_8BIT_TEXTRUN
      for PLATFORM(MAC).  Other platform can update this setting in Platform.h when their platform specific use of
      TextRun handle 8 bit data.  Added a new Vector::appendVector to allow appending the contents of a vector
      containing one type to the end of vector containing another.  This is used to append a Vector<LChar> to
      the end of a Vector<UChar>.
      
      * wtf/Platform.h:
      * wtf/Vector.h:
      (Vector):
      (WTF::Vector::appendVector):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      776c286c
  15. 11 Oct, 2012 1 commit
    • leviw@chromium.org's avatar
      [Sub pixel layout] Fast-path iframe scrolling can picks up an extra pixel · 63f73871
      leviw@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=98571
      
      Reviewed by Emil A Eklund.
      
      Source/WebCore:
      
      Refactoring all coordinate-switching functionality to use a single "mode" flag
      as opposed to having a bunch of boolean values. This enables the same set of
      options across the board, and a consistent interface. This was previously
      done for mapLocalToContainer.
      
      The imptetus for this for this stems from the one logical change in this patch
      which only effects sub-pixel layout. FrameView::convertToRenderer and
      convertFromRenderer return IntPoint coordinates, and need to also snap transform
      offsets to determine proper rects for scrolling.
      
      Unlabeled functions below are simply being updated to these new interfaces.
      
      Test: fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html
      
      * WebCore.exp.in:
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::getUpperLeftCorner):
      (WebCore::ContainerNode::getLowerRightCorner):
      * dom/Element.cpp:
      (WebCore::Element::boundsInRootViewSpace):
      * dom/MouseRelatedEvent.cpp:
      (WebCore::MouseRelatedEvent::computeRelativePosition):
      * dom/Node.cpp:
      (WebCore::Node::convertToPage):
      (WebCore::Node::convertFromPage):
      * html/HTMLSelectElement.cpp:
      (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
      * html/shadow/SliderThumbElement.cpp:
      (WebCore::SliderThumbElement::setPositionFromPoint):
      * html/shadow/SpinButtonElement.cpp:
      (WebCore::SpinButtonElement::defaultEventHandler):
      * page/FrameView.cpp:
      (WebCore::FrameView::convertToRenderer): Now pixel-snaps offsets before passing
      them to TransformState, which transforms the coordinates.
      (WebCore::FrameView::convertFromRenderer): Ditto.
      * rendering/LayoutState.cpp:
      (WebCore::LayoutState::LayoutState):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::absoluteQuads):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::absoluteQuads):
      (WebCore::RenderBox::mapLocalToContainer):
      (WebCore::RenderBox::mapAbsoluteToLocalPoint):
      * rendering/RenderBox.h:
      (RenderBox):
      * rendering/RenderBoxModelObject.cpp:
      (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
      * rendering/RenderBoxModelObject.h:
      (RenderBoxModelObject):
      * rendering/RenderEmbeddedObject.cpp:
      (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
      * rendering/RenderFrameSet.cpp:
      (WebCore::RenderFrameSet::userResize):
      * rendering/RenderGeometryMap.cpp:
      (WebCore::RenderGeometryMap::absolutePoint):
      * rendering/RenderInline.cpp:
      (WebCore::RenderInline::mapLocalToContainer):
      * rendering/RenderInline.h:
      (RenderInline):
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::absoluteToContents):
      (WebCore::RenderLayer::calculateClipRects):
      * rendering/RenderMediaControls.cpp:
      (WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton):
      * rendering/RenderMenuList.cpp:
      (WebCore::RenderMenuList::showPopup):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::localToAbsolute):
      (WebCore::RenderObject::absoluteToLocal):
      (WebCore::RenderObject::mapLocalToContainer):
      (WebCore::RenderObject::mapAbsoluteToLocalPoint):
      (WebCore::RenderObject::localToContainerQuad):
      (WebCore::RenderObject::localToContainerPoint):
      * rendering/RenderObject.h:
      (RenderObject): MapLocalToContainerFlags is now MapCoordinatesFlags since it's
      now used for other conversion methods.
      (WebCore::RenderObject::localToAbsoluteQuad):
      * rendering/RenderTheme.cpp:
      (WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
      * rendering/RenderView.cpp:
      (WebCore::RenderView::mapLocalToContainer):
      (WebCore::RenderView::mapAbsoluteToLocalPoint):
      * rendering/RenderView.h:
      (RenderView):
      * rendering/svg/RenderSVGForeignObject.cpp:
      (WebCore::RenderSVGForeignObject::mapLocalToContainer):
      * rendering/svg/RenderSVGForeignObject.h:
      (RenderSVGForeignObject):
      * rendering/svg/RenderSVGInline.cpp:
      (WebCore::RenderSVGInline::mapLocalToContainer):
      * rendering/svg/RenderSVGInline.h:
      (RenderSVGInline):
      * rendering/svg/RenderSVGModelObject.cpp:
      (WebCore::RenderSVGModelObject::mapLocalToContainer):
      * rendering/svg/RenderSVGModelObject.h:
      (RenderSVGModelObject):
      * rendering/svg/RenderSVGRoot.cpp:
      (WebCore::RenderSVGRoot::mapLocalToContainer):
      * rendering/svg/RenderSVGRoot.h:
      (RenderSVGRoot):
      * rendering/svg/RenderSVGText.cpp:
      (WebCore::RenderSVGText::mapLocalToContainer):
      * rendering/svg/RenderSVGText.h:
      (RenderSVGText):
      * rendering/svg/SVGRenderSupport.cpp:
      (WebCore::SVGRenderSupport::mapLocalToContainer):
      * svg/SVGSVGElement.cpp:
      (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
      
      LayoutTests:
      
      Tests scrolling of sub-pixel layers on sub-pixel platforms (Chromium).
      
      * fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html: Added.
      * platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png: Added.
      * platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.txt: Added.
      * platform/chromium-linux/fast/repaint/repaint-across-writing-mode-boundary-expected.png:
      The repaint rect shrinks safely by one pixel.
      * platform/chromium/TestExpectations:
      * platform/mac-lion/TestExpectations:
      * platform/mac-snowleopard/TestExpectations:
      * platform/mac-wk2/TestExpectations:
      * platform/mac/TestExpectations:
      * platform/qt-4.8/TestExpectations:
      * platform/qt/TestExpectations:
      * platform/win-wk2/TestExpectations:
      * platform/win-xp/TestExpectations:
      * platform/win/TestExpectations:
      * platform/wincairo/TestExpectations:
      * platform/wk2/TestExpectations:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      63f73871
  16. 09 Oct, 2012 3 commits
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r130811 and r130821. · a2a40f8f
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/130811
      http://trac.webkit.org/changeset/130821
      https://bugs.webkit.org/show_bug.cgi?id=98831
      
      Broke date-suggestion-picker-appearance-with-scroll-bar.html
      (Requested by abarth|gardening on #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-10-09
      
      Source/WebCore:
      
      * WebCore.exp.in:
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::getUpperLeftCorner):
      (WebCore::ContainerNode::getLowerRightCorner):
      * dom/MouseRelatedEvent.cpp:
      (WebCore::MouseRelatedEvent::computeRelativePosition):
      * dom/Node.cpp:
      (WebCore::Node::convertToPage):
      (WebCore::Node::convertFromPage):
      * editing/FrameSelection.cpp:
      (WebCore::CaretBase::absoluteBoundsForLocalRect):
      * editing/RenderedPosition.cpp:
      (WebCore::RenderedPosition::absoluteRect):
      * editing/VisiblePosition.cpp:
      (WebCore::VisiblePosition::absoluteCaretBounds):
      * html/HTMLSelectElement.cpp:
      (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
      * html/shadow/SliderThumbElement.cpp:
      (WebCore::SliderThumbElement::setPositionFromPoint):
      * html/shadow/SpinButtonElement.cpp:
      (WebCore::SpinButtonElement::defaultEventHandler):
      * page/FrameView.cpp:
      (WebCore::FrameView::convertFromRenderer):
      (WebCore::FrameView::convertToRenderer):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paintDocumentMarker):
      (WebCore::InlineTextBox::paintTextMatchMarker):
      (WebCore::InlineTextBox::computeRectForReplacementMarker):
      * rendering/LayoutState.cpp:
      (WebCore::LayoutState::LayoutState):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::absoluteQuads):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::absoluteQuads):
      (WebCore::RenderBox::absoluteContentBox):
      (WebCore::RenderBox::mapLocalToContainer):
      (WebCore::RenderBox::mapAbsoluteToLocalPoint):
      * rendering/RenderBox.h:
      (RenderBox):
      * rendering/RenderBoxModelObject.cpp:
      (WebCore::RenderBoxModelObject::computeStickyPositionConstraints):
      (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
      * rendering/RenderBoxModelObject.h:
      (RenderBoxModelObject):
      * rendering/RenderEmbeddedObject.cpp:
      (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
      * rendering/RenderFrameSet.cpp:
      (WebCore::RenderFrameSet::userResize):
      * rendering/RenderGeometryMap.cpp:
      (WebCore::RenderGeometryMap::absolutePoint):
      * rendering/RenderInline.cpp:
      (WebCore::RenderInline::mapLocalToContainer):
      * rendering/RenderInline.h:
      (RenderInline):
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::absoluteToContents):
      (WebCore::RenderLayer::convertToLayerCoords):
      (WebCore::RenderLayer::scrollTo):
      (WebCore::RenderLayer::calculateClipRects):
      (WebCore::RenderLayer::childrenClipRect):
      (WebCore::RenderLayer::selfClipRect):
      * rendering/RenderLayerBacking.cpp:
      (WebCore::RenderLayerBacking::contentsVisible):
      * rendering/RenderMediaControls.cpp:
      (WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton):
      * rendering/RenderMenuList.cpp:
      (WebCore::RenderMenuList::showPopup):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::absoluteFocusRingQuads):
      (WebCore::RenderObject::localToAbsolute):
      (WebCore::RenderObject::absoluteToLocal):
      (WebCore::RenderObject::mapLocalToContainer):
      (WebCore::RenderObject::mapAbsoluteToLocalPoint):
      (WebCore::RenderObject::localToContainerQuad):
      (WebCore::RenderObject::localToContainerPoint):
      * rendering/RenderObject.h:
      (RenderObject):
      (WebCore::RenderObject::localToAbsoluteQuad):
      * rendering/RenderText.cpp:
      (WebCore::RenderText::absoluteRectsForRange):
      (WebCore::RenderText::absoluteQuads):
      (WebCore::RenderText::absoluteQuadsForRange):
      * rendering/RenderTheme.cpp:
      (WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
      * rendering/RenderView.cpp:
      (WebCore::RenderView::mapLocalToContainer):
      (WebCore::RenderView::mapAbsoluteToLocalPoint):
      (WebCore::RenderView::selectionBounds):
      * rendering/RenderView.h:
      (RenderView):
      * rendering/RenderWidget.cpp:
      (WebCore::RenderWidget::updateWidgetGeometry):
      * rendering/svg/RenderSVGForeignObject.cpp:
      (WebCore::RenderSVGForeignObject::mapLocalToContainer):
      * rendering/svg/RenderSVGForeignObject.h:
      (RenderSVGForeignObject):
      * rendering/svg/RenderSVGInline.cpp:
      (WebCore::RenderSVGInline::mapLocalToContainer):
      * rendering/svg/RenderSVGInline.h:
      (RenderSVGInline):
      * rendering/svg/RenderSVGModelObject.cpp:
      (WebCore::RenderSVGModelObject::mapLocalToContainer):
      (WebCore::RenderSVGModelObject::absoluteQuads):
      * rendering/svg/RenderSVGModelObject.h:
      (RenderSVGModelObject):
      * rendering/svg/RenderSVGRoot.cpp:
      (WebCore::RenderSVGRoot::mapLocalToContainer):
      * rendering/svg/RenderSVGRoot.h:
      (RenderSVGRoot):
      * rendering/svg/RenderSVGText.cpp:
      (WebCore::RenderSVGText::mapLocalToContainer):
      (WebCore::RenderSVGText::absoluteQuads):
      * rendering/svg/RenderSVGText.h:
      (RenderSVGText):
      * rendering/svg/SVGRenderSupport.cpp:
      (WebCore::SVGRenderSupport::mapLocalToContainer):
      * svg/SVGSVGElement.cpp:
      (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
      
      Source/WebKit/chromium:
      
      * src/FindInPageCoordinates.cpp:
      (WebKit::toNormalizedRect):
      * src/LinkHighlight.cpp:
      (WebKit::convertTargetSpaceQuadToCompositedLayer):
      * src/WebInputEventConversion.cpp:
      (WebKit::convertLocationForRenderObject):
      
      Source/WebKit/mac:
      
      * WebView/WebFullScreenController.mm:
      (screenRectOfContents):
      * WebView/WebRenderNode.mm:
      (copyRenderNode):
      
      Source/WebKit2:
      
      * Shared/WebRenderObject.cpp:
      (WebKit::WebRenderObject::WebRenderObject):
      * WebProcess/FullScreen/WebFullScreenManager.cpp:
      (WebKit::screenRectOfContents):
      
      LayoutTests:
      
      * fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html: Removed.
      * platform/chromium-linux/fast/repaint/repaint-across-writing-mode-boundary-expected.png:
      * platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png: Removed.
      * platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.txt: Removed.
      * platform/chromium-mac-snowleopard/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png: Removed.
      * platform/chromium-mac/fast/repaint/repaint-across-writing-mode-boundary-expected.png:
      * platform/chromium-mac/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png: Removed.
      * platform/chromium-mac/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.txt: Removed.
      * platform/mac-lion/TestExpectations:
      * platform/mac-snowleopard/TestExpectations:
      * platform/mac-wk2/TestExpectations:
      * platform/mac/TestExpectations:
      * platform/qt-4.8/TestExpectations:
      * platform/qt/TestExpectations:
      * platform/win-wk2/TestExpectations:
      * platform/win-xp/TestExpectations:
      * platform/win/TestExpectations:
      * platform/wincairo/TestExpectations:
      * platform/wk2/TestExpectations:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a2a40f8f
    • leviw@chromium.org's avatar
      [Sub pixel layout] Fast-path iframe scrolling can picks up an extra pixel · 56cde565
      leviw@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=98571
      
      Reviewed by Emil A Eklund.
      
      Source/WebCore:
      
      Refactoring all coordinate-switching functionality to use a single "mode" flag
      as opposed to having a bunch of boolean values. This enables the same set of
      options across the board, and a consistent interface. This was previously
      done for mapLocalToContainer.
      
      The imptetus for this for this stems from the one logical change in this patch
      which only effects sub-pixel layout. FrameView::convertToRenderer and
      convertFromRenderer return IntPoint coordinates, and need to also snap transform
      offsets to determine proper rects for scrolling.
      
      Unlabeled functions below are simply being updated to these new interfaces.
      
      Test: fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html
      
      * WebCore.exp.in:
      * dom/ContainerNode.cpp:
      (WebCore::ContainerNode::getUpperLeftCorner):
      (WebCore::ContainerNode::getLowerRightCorner):
      * dom/Element.cpp:
      (WebCore::Element::boundsInRootViewSpace):
      * dom/MouseRelatedEvent.cpp:
      (WebCore::MouseRelatedEvent::computeRelativePosition):
      * dom/Node.cpp:
      (WebCore::Node::convertToPage):
      (WebCore::Node::convertFromPage):
      * html/HTMLSelectElement.cpp:
      (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
      * html/shadow/SliderThumbElement.cpp:
      (WebCore::SliderThumbElement::setPositionFromPoint):
      * html/shadow/SpinButtonElement.cpp:
      (WebCore::SpinButtonElement::defaultEventHandler):
      * page/FrameView.cpp:
      (WebCore::FrameView::convertToRenderer): Now pixel-snaps offsets before passing
      them to TransformState, which transforms the coordinates.
      (WebCore::FrameView::convertFromRenderer): Ditto.
      * rendering/LayoutState.cpp:
      (WebCore::LayoutState::LayoutState):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::absoluteQuads):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::absoluteQuads):
      (WebCore::RenderBox::mapLocalToContainer):
      (WebCore::RenderBox::mapAbsoluteToLocalPoint):
      * rendering/RenderBox.h:
      (RenderBox):
      * rendering/RenderBoxModelObject.cpp:
      (WebCore::RenderBoxModelObject::mapAbsoluteToLocalPoint):
      * rendering/RenderBoxModelObject.h:
      (RenderBoxModelObject):
      * rendering/RenderEmbeddedObject.cpp:
      (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
      * rendering/RenderFrameSet.cpp:
      (WebCore::RenderFrameSet::userResize):
      * rendering/RenderGeometryMap.cpp:
      (WebCore::RenderGeometryMap::absolutePoint):
      * rendering/RenderInline.cpp:
      (WebCore::RenderInline::mapLocalToContainer):
      * rendering/RenderInline.h:
      (RenderInline):
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::absoluteToContents):
      (WebCore::RenderLayer::calculateClipRects):
      * rendering/RenderMediaControls.cpp:
      (WebCore::RenderMediaControls::volumeSliderOffsetFromMuteButton):
      * rendering/RenderMenuList.cpp:
      (WebCore::RenderMenuList::showPopup):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::localToAbsolute):
      (WebCore::RenderObject::absoluteToLocal):
      (WebCore::RenderObject::mapLocalToContainer):
      (WebCore::RenderObject::mapAbsoluteToLocalPoint):
      (WebCore::RenderObject::localToContainerQuad):
      (WebCore::RenderObject::localToContainerPoint):
      * rendering/RenderObject.h:
      (RenderObject): MapLocalToContainerFlags is now MapCoordinatesFlags since it's
      now used for other conversion methods.
      (WebCore::RenderObject::localToAbsoluteQuad):
      * rendering/RenderTheme.cpp:
      (WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
      * rendering/RenderView.cpp:
      (WebCore::RenderView::mapLocalToContainer):
      (WebCore::RenderView::mapAbsoluteToLocalPoint):
      * rendering/RenderView.h:
      (RenderView):
      * rendering/svg/RenderSVGForeignObject.cpp:
      (WebCore::RenderSVGForeignObject::mapLocalToContainer):
      * rendering/svg/RenderSVGForeignObject.h:
      (RenderSVGForeignObject):
      * rendering/svg/RenderSVGInline.cpp:
      (WebCore::RenderSVGInline::mapLocalToContainer):
      * rendering/svg/RenderSVGInline.h:
      (RenderSVGInline):
      * rendering/svg/RenderSVGModelObject.cpp:
      (WebCore::RenderSVGModelObject::mapLocalToContainer):
      * rendering/svg/RenderSVGModelObject.h:
      (RenderSVGModelObject):
      * rendering/svg/RenderSVGRoot.cpp:
      (WebCore::RenderSVGRoot::mapLocalToContainer):
      * rendering/svg/RenderSVGRoot.h:
      (RenderSVGRoot):
      * rendering/svg/RenderSVGText.cpp:
      (WebCore::RenderSVGText::mapLocalToContainer):
      * rendering/svg/RenderSVGText.h:
      (RenderSVGText):
      * rendering/svg/SVGRenderSupport.cpp:
      (WebCore::SVGRenderSupport::mapLocalToContainer):
      * svg/SVGSVGElement.cpp:
      (WebCore::SVGSVGElement::localCoordinateSpaceTransform):
      
      LayoutTests:
      
      Tests scrolling of sub-pixel layers on sub-pixel platforms (Chromium).
      
      * fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html: Added.
      * platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.png: Added.
      * platform/chromium-linux/fast/sub-pixel/sub-pixel-iframe-copy-on-scroll-expected.txt: Added.
      * platform/chromium-linux/fast/repaint/repaint-across-writing-mode-boundary-expected.png:
      The repaint rect shrinks safely by one pixel.
      * platform/chromium/TestExpectations:
      * platform/mac-lion/TestExpectations:
      * platform/mac-snowleopard/TestExpectations:
      * platform/mac-wk2/TestExpectations:
      * platform/mac/TestExpectations:
      * platform/qt-4.8/TestExpectations:
      * platform/qt/TestExpectations:
      * platform/win-wk2/TestExpectations:
      * platform/win-xp/TestExpectations:
      * platform/win/TestExpectations:
      * platform/wincairo/TestExpectations:
      * platform/wk2/TestExpectations:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      56cde565
    • commit-queue@webkit.org's avatar
      Text decorations specified on the containing block are not properly applied... · 549e1f88
      commit-queue@webkit.org authored
      Text decorations specified on the containing block are not properly applied when ::first-line is present.
      https://bugs.webkit.org/show_bug.cgi?id=93829
      
      Patch by Arpita Bahuguna <arpitabahuguna@gmail.com> on 2012-10-09
      Reviewed by Abhishek Arya.
      
      Source/WebCore:
      
      If a container's style and its pseudo :first-line style have unique
      text-decorations specified for them, only the :first-line text-decoarations
      were being applied.
      
      The uploaded patch intends to first compute the text decoration colors
      for the containing box, followed by that of the first-line (if specified).
      
      This thus avoids the condition wherein our containing box's text-decorations
      were not getting applied at all since initially we were only computing
      for the first-line style.
      
      Test: fast/css/text-decorations-on-first-line-and-containing-block.html
      
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paintDecoration):
      getTextDecorationColors() is first called for computing the containing box's
      text-decoration values and then for first-line style's text-decorations,
      if specified.
      
      LayoutTests:
      
      * fast/css/text-decorations-on-first-line-and-containing-block-expected.html: Added.
      * fast/css/text-decorations-on-first-line-and-containing-block.html: Added.
      Tests added for verifying the behavior of text-decorations when specified
      both for the ::first-line as well as its containing block.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@130750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      549e1f88
  17. 20 Sep, 2012 3 commits
    • leviw@chromium.org's avatar
      Prevent reading stale data from InlineTextBoxes · 4f479448
      leviw@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=94750
      
      Reviewed by Abhishek Arya.
      
      Text from dirty InlineTextBoxes should never be read or used. This change
      enforces this design goal by forcefully zero-ing out the start and length
      of InlineTextBoxes when they're being marked dirty. Ideally, we'd also
      add asserts to the accessors for this data, but there are still several
      places in editing that cause this. https://bugs.webkit.org/show_bug.cgi?id=97264
      tracks these cases.
      
      This change involves making markDirty virtual. Running the line-layout
      performance test as well as profiling resizing the html5 spec showed
      negligable impact with this change.
      
      No new tests as this doesn't change any proper behavior.
      
      * dom/Position.cpp:
      (WebCore::Position::downstream): Adding a FIXME.
      * rendering/InlineBox.h:
      (WebCore::InlineBox::markDirty): Marking virtual to allow InlineTextBox to
      overload and zero out its start and length.
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::markDirty): Zeroing out the start and length when
      we mark the box dirty.
      * rendering/InlineTextBox.h:
      * rendering/RenderText.cpp:
      (WebCore::RenderText::setTextWithOffset): Adding a FIXME.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129186 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4f479448
    • commit-queue@webkit.org's avatar
      Unreviewed, rolling out r129144. · ae515208
      commit-queue@webkit.org authored
      http://trac.webkit.org/changeset/129144
      https://bugs.webkit.org/show_bug.cgi?id=97244
      
      causing lots of assertions in tests (Requested by smfr on
      #webkit).
      
      Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-09-20
      
      * rendering/InlineBox.h:
      (WebCore::InlineBox::markDirty):
      * rendering/InlineTextBox.cpp:
      * rendering/InlineTextBox.h:
      (WebCore::InlineTextBox::start):
      (WebCore::InlineTextBox::end):
      (WebCore::InlineTextBox::len):
      (WebCore::InlineTextBox::offsetRun):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ae515208
    • leviw@chromium.org's avatar
      Prevent reading stale data from InlineTextBoxes · a2c0f6c1
      leviw@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=94750
      
      Reviewed by Eric Seidel.
      
      Text from dirty InlineTextBoxes should never be read or used. This change enforces this
      design goal by forcefully zero-ing out the start and length of InlineTextBoxes when 
      they're being marked dirty. It also adds asserts to accessors for those members.
      
      This change involves making markDirty virtual. Running the line-layout performance test
      as well as profiling resizing the html5 spec showed negligable impact with this change.
      
      No new tests as this doesn't change any proper behavior.
      
      * rendering/InlineBox.h:
      (WebCore::InlineBox::markDirty): Making virtual to allow InlineTextBox to overload and
      zero out its start and length.
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::markDirty): Zeroing out start and length when we mark the box dirty.
      * rendering/InlineTextBox.h:
      (WebCore::InlineTextBox::start): Adding an assert when we hit this case.
      (WebCore::InlineTextBox::end): Ditto.
      (WebCore::InlineTextBox::len): Ditto.
      (WebCore::InlineTextBox::offsetRun): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a2c0f6c1
  18. 03 Sep, 2012 1 commit
    • allan.jensen@nokia.com's avatar
      Move AllowShadowContent flag to HitTestRequest · 4c7e3523
      allan.jensen@nokia.com authored
      https://bugs.webkit.org/show_bug.cgi?id=95685
      
      Reviewed by Antonio Gomes.
      
      Moves the flag and updates the interface for HitTestResult::addNodeToRectBasedTestResult so that
      it can read the flag from HitTestRequest instead of from HitTestResult.
      
      No change in functionality. No new tests.
      
      * dom/Document.cpp:
      (WebCore::Document::nodesFromRect):
      * page/EventHandler.cpp:
      (WebCore::EventHandler::hitTestResultAtPoint):
      * rendering/HitTestRequest.h:
      * rendering/HitTestResult.cpp:
      (WebCore::HitTestLocation::HitTestLocation):
      (WebCore::HitTestResult::HitTestResult):
      (WebCore::HitTestResult::operator=):
      (WebCore::HitTestResult::addNodeToRectBasedTestResult):
      * rendering/HitTestResult.h:
      (HitTestLocation):
      (HitTestResult):
      * rendering/InlineFlowBox.cpp:
      (WebCore::InlineFlowBox::nodeAtPoint):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::nodeAtPoint):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::nodeAtPoint):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::nodeAtPoint):
      * rendering/RenderImage.cpp:
      (WebCore::RenderImage::nodeAtPoint):
      * rendering/RenderLayer.cpp:
      (WebCore::RenderLayer::hitTestLayer):
      (WebCore::RenderLayer::hitTestList):
      * rendering/RenderMultiColumnSet.cpp:
      (WebCore::RenderMultiColumnSet::nodeAtPoint):
      * rendering/RenderRegion.cpp:
      (WebCore::RenderRegion::nodeAtPoint):
      * rendering/RenderTable.cpp:
      (WebCore::RenderTable::nodeAtPoint):
      * rendering/svg/RenderSVGRoot.cpp:
      (WebCore::RenderSVGRoot::nodeAtPoint):
      * rendering/svg/SVGInlineTextBox.cpp:
      (WebCore::SVGInlineTextBox::nodeAtPoint):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@127421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4c7e3523
  19. 28 Aug, 2012 1 commit
    • allan.jensen@nokia.com's avatar
      Rename HitTestPoint and pointInContainer · 9a9045b4
      allan.jensen@nokia.com authored
      https://bugs.webkit.org/show_bug.cgi?id=90992
      
      Reviewed by Eric Seidel.
      
      The former hitTestPoint is not just a point. It can be either a point or an area being
      hit tested. This patches renames 'point' to 'location' to make it more obvious that the
      code does not only handle points.
      
      * rendering/EllipsisBox.cpp:
      (WebCore::EllipsisBox::nodeAtPoint):
      * rendering/EllipsisBox.h:
      (EllipsisBox):
      * rendering/HitTestResult.cpp:
      (WebCore::HitTestLocation::HitTestLocation):
      (WebCore::HitTestLocation::~HitTestLocation):
      (WebCore::HitTestLocation::operator=):
      (WebCore::HitTestLocation::move):
      (WebCore::HitTestLocation::intersectsRect):
      (WebCore::HitTestLocation::intersects):
      (WebCore::HitTestLocation::rectForPoint):
      (WebCore::HitTestResult::HitTestResult):
      (WebCore::HitTestResult::operator=):
      (WebCore::HitTestResult::addNodeToRectBasedTestResult):
      (WebCore::HitTestResult::dictationAlternatives):
      * rendering/HitTestResult.h:
      (HitTestLocation):
      (HitTestResult):
      (WebCore::HitTestResult::hitTestLocation):
      * rendering/InlineBox.cpp:
      (WebCore::InlineBox::nodeAtPoint):
      * rendering/InlineBox.h:
      (InlineBox):
      * rendering/InlineFlowBox.cpp:
      (WebCore::InlineFlowBox::nodeAtPoint):
      * rendering/InlineFlowBox.h:
      (InlineFlowBox):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::nodeAtPoint):
      * rendering/InlineTextBox.h:
      (InlineTextBox):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::isPointInOverflowControl):
      (WebCore::RenderBlock::nodeAtPoint):
      (WebCore::RenderBlock::hitTestFloats):
      (WebCore::RenderBlock::hitTestColumns):
      (WebCore::RenderBlock::adjustForColumnRect):
      (WebCore::RenderBlock::hitTestContents):
      * rendering/RenderBlock.h:
      (RenderBlock):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::nodeAtPoint):
      * rendering/RenderBox.h:
      (RenderBox):
      * rendering/RenderEmbeddedObject.cpp:
      (WebCore::RenderEmbeddedObject::nodeAtPoint):
      * rendering/RenderEmbeddedObject.h:
      (RenderEmbeddedObject):
      * rendering/RenderFlowThread.cpp:
      (WebCore::RenderFlowThread::hitTestRegion):
      * rendering/RenderFlowThread.h:
      * rendering/RenderFrameSet.cpp:
      (WebCore::RenderFrameSet::nodeAtPoint):
      * rendering/RenderFrameSet.h:
      (RenderFrameSet):
      * rendering/RenderImage.cpp:
      (WebCore::RenderImage::nodeAtPoint):
      * rendering/RenderImage.h:
      (RenderImage):
      * rendering/RenderInline.cpp:
      (WebCore::RenderInline::nodeAtPoint):
      * rendering/RenderInline.h:
      (RenderInline):
      * rendering/RenderLayer.cpp:
      (WebCore::ClipRect::intersects):
      (WebCore::RenderLayer::hitTest):
      (WebCore::RenderLayer::createLocalTransformState):
      (WebCore::RenderLayer::hitTestLayer):
      (WebCore::RenderLayer::hitTestContents):
      (WebCore::RenderLayer::hitTestList):
      (WebCore::RenderLayer::hitTestPaginatedChildLayer):
      (WebCore::RenderLayer::hitTestChildLayerColumns):
      * rendering/RenderLayer.h:
      (ClipRect):
      (RenderLayer):
      * rendering/RenderLineBoxList.cpp:
      (WebCore::RenderLineBoxList::hitTest):
      * rendering/RenderLineBoxList.h:
      (RenderLineBoxList):
      * rendering/RenderListBox.cpp:
      (WebCore::RenderListBox::isPointInOverflowControl):
      (WebCore::RenderListBox::nodeAtPoint):
      * rendering/RenderListBox.h:
      (RenderListBox):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::hitTest):
      (WebCore::RenderObject::nodeAtPoint):
      * rendering/RenderObject.h:
      (RenderObject):
      * rendering/RenderRegion.cpp:
      (WebCore::RenderRegion::nodeAtPoint):
      * rendering/RenderRegion.h:
      (RenderRegion):
      * rendering/RenderTable.cpp:
      (WebCore::RenderTable::nodeAtPoint):
      * rendering/RenderTable.h:
      (RenderTable):
      * rendering/RenderTableRow.cpp:
      (WebCore::RenderTableRow::nodeAtPoint):
      * rendering/RenderTableRow.h:
      (RenderTableRow):
      * rendering/RenderTableSection.cpp:
      (WebCore::RenderTableSection::nodeAtPoint):
      * rendering/RenderTableSection.h:
      (RenderTableSection):
      * rendering/RenderText.h:
      * rendering/RenderTextControlMultiLine.cpp:
      (WebCore::RenderTextControlMultiLine::nodeAtPoint):
      * rendering/RenderTextControlMultiLine.h:
      (RenderTextControlMultiLine):
      * rendering/RenderTextControlSingleLine.cpp:
      (WebCore::RenderTextControlSingleLine::nodeAtPoint):
      * rendering/RenderTextControlSingleLine.h:
      (RenderTextControlSingleLine):
      * rendering/RenderWidget.cpp:
      (WebCore::RenderWidget::nodeAtPoint):
      * rendering/RenderWidget.h:
      (RenderWidget):
      * rendering/RootInlineBox.cpp:
      (WebCore::RootInlineBox::nodeAtPoint):
      * rendering/RootInlineBox.h:
      (RootInlineBox):
      * rendering/svg/RenderSVGForeignObject.cpp:
      (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
      (WebCore::RenderSVGForeignObject::nodeAtPoint):
      * rendering/svg/RenderSVGForeignObject.h:
      (RenderSVGForeignObject):
      * rendering/svg/RenderSVGModelObject.cpp:
      (WebCore::RenderSVGModelObject::nodeAtPoint):
      * rendering/svg/RenderSVGModelObject.h:
      (RenderSVGModelObject):
      * rendering/svg/RenderSVGRoot.cpp:
      (WebCore::RenderSVGRoot::nodeAtPoint):
      * rendering/svg/RenderSVGRoot.h:
      (RenderSVGRoot):
      * rendering/svg/RenderSVGText.cpp:
      (WebCore::RenderSVGText::nodeAtFloatPoint):
      (WebCore::RenderSVGText::nodeAtPoint):
      * rendering/svg/RenderSVGText.h:
      (RenderSVGText):
      * rendering/svg/SVGInlineTextBox.cpp:
      (WebCore::SVGInlineTextBox::nodeAtPoint):
      * rendering/svg/SVGInlineTextBox.h:
      (SVGInlineTextBox):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126859 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9a9045b4
  20. 22 Jun, 2012 1 commit
    • benjamin@webkit.org's avatar
      Text with text-overflow:ellipsis and text-align:right is left aligned · f68b1be4
      benjamin@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=88705
      
      Patch by Benjamin Poulain <bpoulain@apple.com> on 2012-06-22
      Reviewed by Dan Bernstein.
      
      Source/WebCore: 
      
      When building the line of a text with overflow, we do not know if we can place
      an ellipsis and where it should be. Because of that, text is laid out as if it does
      not have text-overflow: ellipsis.
      
      This causes problems with text-alignement right in LTR and left in RTL. The shortened text
      did not follow the allignment.
      
      This patch changes the position of lines with ellipsis after layout to follow the allignment.
      In RenderBlock::checkLinesForTextOverflow(), the call to RootInlineBox::placeEllipsis() now
      also gives the width of the truncated text. We use this width to re-compute the alignement and
      shift the box if necessary.
      
      In RenderBlock::deleteEllipsisLineBoxes() we revert the text to the position computed with the
      total width. This way all layout computation is done as usual.
      
      Tests: fast/css/text-overflow-ellipsis-text-align-left.html
             fast/css/text-overflow-ellipsis-text-align-right.html
      
      * rendering/InlineBox.cpp:
      (WebCore::InlineBox::canAccommodateEllipsis): Make the method const for readability, truncating is
      done later in placeEllipsisBox().
      (WebCore::InlineBox::placeEllipsisBox): Add an output argument, truncatedWidth, giving the width
      of the text + ellipsis after truncation (if any truncation can be done).
      * rendering/InlineBox.h:
      (InlineBox):
      * rendering/InlineFlowBox.cpp:
      (WebCore::InlineBox::adjustLogicalPosition): adjustPosition() logical coordinates.
      (WebCore::InlineFlowBox::canAccommodateEllipsis):
      (WebCore::InlineFlowBox::placeEllipsisBox):
      * rendering/InlineFlowBox.h:
      (InlineFlowBox):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::placeEllipsisBox):
      * rendering/InlineTextBox.h:
      (InlineTextBox):
      * rendering/RenderBlockLineLayout.cpp:
      (WebCore::RenderBlock::deleteEllipsisLineBoxes): In addition to removing the truncation, we
      need to revert the shift introduced by checkLinesForTextOverflow(). This restore the lines
      to its original, untruncated position in order to layout the block correctly in RenderBlock::layoutInlineChildren().
      (WebCore::RenderBlock::checkLinesForTextOverflow): After we truncate the text, we now recompute the shift we need
      for alignment, and move the line accordingly.
      * rendering/RenderDeprecatedFlexibleBox.cpp:
      (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
      * rendering/RootInlineBox.cpp:
      (WebCore::RootInlineBox::placeEllipsis): Return the width of the truncated text + the width of the ellipsis.
      (WebCore::RootInlineBox::placeEllipsisBox):
      (WebCore::RootInlineBox::adjustPosition):
      * rendering/RootInlineBox.h:
      (RootInlineBox):
      
      LayoutTests: 
      
      * fast/css/text-overflow-ellipsis-text-align-center.html: Added.
      * fast/css/text-overflow-ellipsis-text-align-justify.html: Added.
      * fast/css/text-overflow-ellipsis-text-align-left.html: Added.
      * fast/css/text-overflow-ellipsis-text-align-right.html: Added.
      * fast/css/vertical-text-overflow-ellipsis-text-align-center.html: Added.
      * fast/css/vertical-text-overflow-ellipsis-text-align-justify.html: Added.
      * fast/css/vertical-text-overflow-ellipsis-text-align-left.html: Added.
      * fast/css/vertical-text-overflow-ellipsis-text-align-right.html: Added.
      The vertical-text tests are incorrect due to other bugs. Add they to track regressions/progressions
      going forward.
      
      * platform/chromium/TestExpectations: The tests need platform specific results.
      * platform/mac/fast/css/text-overflow-ellipsis-text-align-center-expected.txt: Added.
      * platform/mac/fast/css/text-overflow-ellipsis-text-align-justify-expected.txt: Added.
      * platform/mac/fast/css/text-overflow-ellipsis-text-align-left-expected.txt: Added.
      * platform/mac/fast/css/text-overflow-ellipsis-text-align-right-expected.txt: Added.
      * platform/mac/fast/css/text-overflow-ellipsis-text-align-center-expected.txt: Added.
      * platform/mac/fast/css/text-overflow-ellipsis-text-align-justify-expected.txt: Added.
      * platform/mac/fast/css/text-overflow-ellipsis-text-align-left-expected.txt: Added.
      * platform/mac/fast/css/text-overflow-ellipsis-text-align-right-expected.txt: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f68b1be4
  21. 20 Jun, 2012 1 commit
    • commit-queue@webkit.org's avatar
      Use HitTestPoint instead of LayoutPoint for nodeAtPoint. · 227d0ab8
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=89448
      
      Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-06-20
      Reviewed by Eric Seidel.
      
      This patch updates the API of nodeAtPoint without changing any
      functionality. This is largest change necessary to support
      transforms in area-based hit-testing, but is only boilerplate.
      
      No change in functionality. No new tests.
      
      * rendering/EllipsisBox.cpp:
      (WebCore::EllipsisBox::nodeAtPoint):
      * rendering/EllipsisBox.h:
      (EllipsisBox):
      * rendering/HitTestResult.cpp:
      (WebCore::HitTestResult::addNodeToRectBasedTestResult):
      * rendering/HitTestResult.h:
      (WebCore::HitTestPoint::intersects):
      (HitTestPoint):
      (HitTestResult):
      * rendering/InlineBox.cpp:
      (WebCore::InlineBox::nodeAtPoint):
      * rendering/InlineBox.h:
      (InlineBox):
      * rendering/InlineFlowBox.cpp:
      (WebCore::InlineFlowBox::nodeAtPoint):
      * rendering/InlineFlowBox.h:
      (InlineFlowBox):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::nodeAtPoint):
      * rendering/InlineTextBox.h:
      (InlineTextBox):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::nodeAtPoint):
      (WebCore::RenderBlock::hitTestFloats):
      (WebCore::RenderBlock::hitTestColumns):
      (WebCore::RenderBlock::hitTestContents):
      * rendering/RenderBlock.h:
      (RenderBlock):
      * rendering/RenderBox.cpp:
      (WebCore::RenderBox::nodeAtPoint):
      * rendering/RenderBox.h:
      (RenderBox):
      * rendering/RenderEmbeddedObject.cpp:
      (WebCore::RenderEmbeddedObject::nodeAtPoint):
      * rendering/RenderEmbeddedObject.h:
      (RenderEmbeddedObject):
      * rendering/RenderFlowThread.cpp:
      (WebCore::RenderFlowThread::hitTestRegion):
      * rendering/RenderFlowThread.h:
      * rendering/RenderFrameSet.cpp:
      (WebCore::RenderFrameSet::nodeAtPoint):
      * rendering/RenderFrameSet.h:
      (RenderFrameSet):
      * rendering/RenderImage.cpp:
      (WebCore::RenderImage::nodeAtPoint):
      * rendering/RenderImage.h:
      (RenderImage):
      * rendering/RenderInline.cpp:
      (WebCore::RenderInline::nodeAtPoint):
      * rendering/RenderInline.h:
      (RenderInline):
      * rendering/RenderLayer.cpp:
      (WebCore::ClipRect::intersects):
      (WebCore::RenderLayer::hitTest):
      (WebCore::RenderLayer::createLocalTransformState):
      (WebCore::RenderLayer::hitTestLayer):
      (WebCore::RenderLayer::hitTestContents):
      (WebCore::RenderLayer::hitTestList):
      (WebCore::RenderLayer::hitTestPaginatedChildLayer):
      (WebCore::RenderLayer::hitTestChildLayerColumns):
      * rendering/RenderLayer.h:
      (ClipRect):
      (RenderLayer):
      * rendering/RenderLineBoxList.cpp:
      (WebCore::RenderLineBoxList::hitTest):
      * rendering/RenderLineBoxList.h:
      (RenderLineBoxList):
      * rendering/RenderListBox.cpp:
      (WebCore::RenderListBox::nodeAtPoint):
      * rendering/RenderListBox.h:
      (RenderListBox):
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::hitTest):
      (WebCore::RenderObject::nodeAtPoint):
      * rendering/RenderObject.h:
      (RenderObject):
      * rendering/RenderRegion.cpp:
      (WebCore::RenderRegion::nodeAtPoint):
      * rendering/RenderRegion.h:
      (RenderRegion):
      * rendering/RenderTable.cpp:
      (WebCore::RenderTable::nodeAtPoint):
      * rendering/RenderTable.h:
      (RenderTable):
      * rendering/RenderTableRow.cpp:
      (WebCore::RenderTableRow::nodeAtPoint):
      * rendering/RenderTableRow.h:
      (RenderTableRow):
      * rendering/RenderTableSection.cpp:
      (WebCore::RenderTableSection::nodeAtPoint):
      * rendering/RenderTableSection.h:
      (RenderTableSection):
      * rendering/RenderText.h:
      * rendering/RenderTextControlMultiLine.cpp:
      (WebCore::RenderTextControlMultiLine::nodeAtPoint):
      * rendering/RenderTextControlMultiLine.h:
      (RenderTextControlMultiLine):
      * rendering/RenderTextControlSingleLine.cpp:
      (WebCore::RenderTextControlSingleLine::nodeAtPoint):
      * rendering/RenderTextControlSingleLine.h:
      (RenderTextControlSingleLine):
      * rendering/RenderWidget.cpp:
      (WebCore::RenderWidget::nodeAtPoint):
      * rendering/RenderWidget.h:
      (RenderWidget):
      * rendering/RootInlineBox.cpp:
      (WebCore::RootInlineBox::nodeAtPoint):
      * rendering/RootInlineBox.h:
      (RootInlineBox):
      * rendering/svg/RenderSVGForeignObject.cpp:
      (WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
      (WebCore::RenderSVGForeignObject::nodeAtPoint):
      * rendering/svg/RenderSVGForeignObject.h:
      (RenderSVGForeignObject):
      * rendering/svg/RenderSVGModelObject.cpp:
      (WebCore::RenderSVGModelObject::nodeAtPoint):
      * rendering/svg/RenderSVGModelObject.h:
      (RenderSVGModelObject):
      * rendering/svg/RenderSVGRoot.cpp:
      (WebCore::RenderSVGRoot::nodeAtPoint):
      * rendering/svg/RenderSVGRoot.h:
      (RenderSVGRoot):
      * rendering/svg/RenderSVGText.cpp:
      (WebCore::RenderSVGText::nodeAtFloatPoint):
      (WebCore::RenderSVGText::nodeAtPoint):
      * rendering/svg/RenderSVGText.h:
      (RenderSVGText):
      * rendering/svg/SVGInlineTextBox.cpp:
      (WebCore::SVGInlineTextBox::nodeAtPoint):
      * rendering/svg/SVGInlineTextBox.h:
      (SVGInlineTextBox):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      227d0ab8
  22. 14 Jun, 2012 1 commit
    • jpu@apple.com's avatar
      Mark text with text alternative with blue underline. · e1c1a77e
      jpu@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83047
      
      Reviewed by Enrica Casucci.
      
      Tests: platform/mac/editing/input/edit-dictated-text-with-alternative.html
             platform/mac/editing/input/insert-dictated-text.html
      
      This patch implements visual indication on dictated text with alternatives, and provides UI
      to show alternative text on OS X. Majority of the changes is for generalizing existing AlternativeTextController
      class to handle dictation alternatives. The two new classes, AlternativeTextUIController and
      TextAlternativeWithRange, are used by both WebKit and WK2. So WebCore seems to be the natural place
      for them.
      
      * WebCore.exp.in:
      * WebCore.xcodeproj/project.pbxproj:
      * editing/AlternativeTextController.cpp: Expanded exising class interface to support dictation alternatives.
      (DictationAlternativeDetails): Marker detail class for dictation alternative mark.
      (WebCore::DictationAlternativeDetails::create):
      (WebCore::DictationAlternativeDetails::dictationContext):
      (WebCore::DictationAlternativeDetails::DictationAlternativeDetails):
      (WebCore::markerTypesForAppliedDictationAlternative):
      (WebCore::AlternativeTextController::applyAlternativeTextToRange): Generalized existing applyAlternativeTextToRange() to handle dictation alternatives.
      (WebCore::AlternativeTextController::timerFired): Expanded existing code to handle dictation alternatives.
      (WebCore::AlternativeTextController::handleAlternativeTextUIResult): Expanded existing code to handle dictation alternatives.
      (WebCore::AlternativeTextController::respondToChangedSelection): Moved part of the function into respondToMarkerAtEndOfWord() to improve readability.
      (WebCore::AlternativeTextController::shouldStartTimerFor):
      (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
      (WebCore::AlternativeTextController::markerDescriptionForAppliedAlternativeText):
      (WebCore::AlternativeTextController::removeDictationAlternativesForMarker):
      (WebCore::AlternativeTextController::dictationAlternativesForMarker):
      (WebCore::AlternativeTextController::applyDictationAlternative):
      * editing/AlternativeTextController.h:
      * editing/Editor.cpp:
      (WebCore::Editor::notifyComponentsOnChangedSelection): Renamed existing respondToChangedSelection() function to avoid naming collision.
      (WebCore::Editor::appliedEditing):
      (WebCore::Editor::unappliedEditing):
      (WebCore::Editor::reappliedEditing):
      (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
      (WebCore::Editor::changeSelectionAfterCommand):
      (WebCore::Editor::respondToChangedSelection):
      (WebCore::Editor::dictationAlternativesForMarker):
      (WebCore::Editor::applyDictationAlternativelternative):
      * editing/Editor.h:
      * editing/FrameSelection.h:
      * editing/mac/AlternativeTextUIController.h: Added. WK1 and WK2 use this class to keep track of text alternatives objects.
      (AlternativeTextUIController):
      (WebCore::AlternativeTextUIController::AlternativeTextUIController):
      (AlernativeTextContextController):
      (WebCore::AlternativeTextUIController::AlernativeTextContextController::AlernativeTextContextController):
      * editing/mac/AlternativeTextUIController.mm: Added.
      (WebCore::AlternativeTextUIController::AlernativeTextContextController::addAlternatives):
      (WebCore::AlternativeTextUIController::AlernativeTextContextController::alternativesForContext):
      (WebCore::AlternativeTextUIController::AlernativeTextContextController::removeAlternativesForContext):
      (WebCore::AlternativeTextUIController::AlernativeTextContextController::clear):
      (WebCore::AlternativeTextUIController::addAlternatives):
      (WebCore::AlternativeTextUIController::alternativesForContext):
      (WebCore::AlternativeTextUIController::clear):
      (WebCore::AlternativeTextUIController::showAlternatives):
      (WebCore::AlternativeTextUIController::handleAcceptedAlternative):
      (WebCore::AlternativeTextUIController::dismissAlternatives):
      (WebCore::AlternativeTextUIController::removeAlternatives):
      * editing/mac/TextAlternativeWithRange.h: Added.  A simple struct to make it easier to pass around a pair of text alternatives object and range.
      * editing/mac/TextAlternativeWithRange.mm: Added.
      (WebCore::TextAlternativeWithRange::TextAlternativeWithRange):
      (WebCore::collectDictationTextAlternatives):
      * page/AlternativeTextClient.h:
      * page/ContextMenuController.cpp: Added code to show alternative dictated text in context menu.
      (WebCore::ContextMenuController::contextMenuItemSelected):
      (WebCore::ContextMenuController::populate):
      (WebCore::ContextMenuController::checkOrEnableIfNeeded):
      * platform/ContextMenuItem.h:
      * rendering/HitTestResult.cpp:
      (WebCore::HitTestResult::dictationAlternatives):
      * rendering/HitTestResult.h:
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paintDocumentMarker):
      
      Changes in WebKit include implementation of new functions declared in AlternativeTextClient,
      and logic for calling Editor::insertDictatedText() instead of Editor::insertText() when there's
      alternatives attached to the input string.
      
      * WebCoreSupport/CorrectionPanel.mm:
      (correctionIndicatorType):
      (CorrectionPanel::handleAcceptedReplacement):
      * WebCoreSupport/WebAlternativeTextClient.h:
      (WebAlternativeTextClient):
      * WebCoreSupport/WebAlternativeTextClient.mm:
      (WebAlternativeTextClient::showCorrectionAlternative):
      (WebAlternativeTextClient::dismissAlternative):
      (WebAlternativeTextClient::dismissAlternativeSoon):
      (WebAlternativeTextClient::recordAutocorrectionResponse):
      (WebAlternativeTextClient::removeDictationAlternatives):
      (WebAlternativeTextClient::showDictationAlternativeUI):
      (WebAlternativeTextClient::dismissDictationAlternativeUI):
      (WebAlternativeTextClient::dictationAlternatives):
      * WebView/WebHTMLView.mm:
      (-[WebHTMLView validAttributesForMarkedText]):
      (-[WebHTMLView insertText:]):
      * WebView/WebView.mm:
      (-[WebView handleAcceptedAlternativeText:]):
      (-[WebView _getWebCoreDictationAlternatives:fromTextAlternatives:]):
      (-[WebView _showDictationAlternativeUI:WebCore::forDictationContext:]):
      (-[WebView _dismissDictationAlternativeUI]):
      (-[WebView _removeDictationAlternatives:]):
      (-[WebView _dictationAlternatives:]):
      * WebView/WebViewData.h:
      * WebView/WebViewData.mm:
      (-[WebViewPrivate init]):
      * WebView/WebViewInternal.h:
      * WebView/WebViewPrivate.h:
      
      Changes in WebKit2 include implementation of new functions declared in AlternativeTextClient,
      and logic for calling Editor::insertDictatedText() instead of Editor::insertText() when there's
      alternatives attached to the input string.
      
      * Shared/API/c/WKContextMenuItemTypes.h:
      * Shared/API/c/WKSharedAPICast.h:
      * Shared/WebCoreArgumentCoders.cpp:
      * Shared/WebCoreArgumentCoders.h:
      * UIProcess/API/mac/PageClientImpl.h:
      * UIProcess/API/mac/PageClientImpl.mm:
      (WebKit::PageClientImpl::PageClientImpl):
      (WebKit::PageClientImpl::pageClosed):
      (WebKit::PageClientImpl::addDictationAlternatives):
      (WebKit::PageClientImpl::removeDictationAlternatives):
      (WebKit::PageClientImpl::showDictationAlternativeUI):
      (WebKit::PageClientImpl::dictationAlternatives):
      (WebKit::PageClientImpl::dismissDictationAlternativeUI):
      * UIProcess/API/mac/WKView.mm:
      (-[WKView insertText:replacementRange:]):
      (-[WKView validAttributesForMarkedText]):
      (-[WKView handleAcceptedAlternativeText:]):
      * UIProcess/API/mac/WKViewInternal.h:
      * UIProcess/PageClient.h:
      * UIProcess/WebPageProxy.cpp:
      (WebKit::WebPageProxy::showDictationAlternativeUI):
      (WebKit::WebPageProxy::dismissDictationAlternativeUI):
      (WebKit::WebPageProxy::removeDictationAlternatives):
      (WebKit::WebPageProxy::dictationAlternatives):
      * UIProcess/WebPageProxy.h:
      * UIProcess/WebPageProxy.messages.in:
      * UIProcess/mac/CorrectionPanel.mm:
      (correctionIndicatorType):
      (WebKit::CorrectionPanel::handleAcceptedReplacement):
      * UIProcess/mac/WebPageProxyMac.mm:
      (WebKit::WebPageProxy::insertDictatedText):
      * WebProcess/WebCoreSupport/WebAlternativeTextClient.h:
      (WebAlternativeTextClient):
      * WebProcess/WebCoreSupport/mac/WebAlternativeTextClient.cpp:
      (WebKit::WebAlternativeTextClient::showCorrectionAlternative):
      (WebKit::WebAlternativeTextClient::dismissAlternative):
      (WebKit::WebAlternativeTextClient::dismissAlternativeSoon):
      (WebKit::WebAlternativeTextClient::recordAutocorrectionResponse):
      (WebKit::WebAlternativeTextClient::removeDictationAlternatives):
      (WebKit::WebAlternativeTextClient::showDictationAlternativeUI):
      (WebKit::WebAlternativeTextClient::dismissDictationAlternativeUI):
      (WebKit::WebAlternativeTextClient::dictationAlternatives):
      * WebProcess/WebPage/WebPage.h:
      * WebProcess/WebPage/WebPage.messages.in:
      * WebProcess/WebPage/mac/WebPageMac.mm:
      (WebKit::WebPage::insertDictatedText):
      
      * platform/mac-lion/Skipped:
      * platform/mac-snowleopard/Skipped:
      * platform/mac/editing/input/edit-dictated-text-with-alternative-expected.txt: Added.
      * platform/mac/editing/input/edit-dictated-text-with-alternative.html: Added.
      * platform/mac/editing/input/insert-dictated-text-expected.txt: Added.
      * platform/mac/editing/input/insert-dictated-text.html: Added.
      
      * DumpRenderTree/mac/TextInputController.m:
      (+[TextInputController isSelectorExcludedFromWebScript:]):
      (+[TextInputController webScriptNameForSelector:]):
      (-[TextInputController dictatedStringWithPrimaryString:alternative:alternativeOffset:alternativeLength:]):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@120357 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e1c1a77e
  23. 05 Jun, 2012 1 commit
    • leviw@chromium.org's avatar
      Block selection gaps painted not properly pixel snapped · 6deea0ee
      leviw@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=88000
      
      Reviewed by Ryosuke Niwa.
      
      Source/WebCore: 
      
      Fixes for selection painting in both inline line heights and block gaps. We were unintentionally
      flooring inline and block offsets in RenderBlock, but actually need to intentionally floor the
      logical left and right values in logical(Left|Right)SelectionGap to properly align our block
      selection gaps. This is to properly mirror the behavior in pixelSnappedLogicalRightOffsetForLine.
      
      We were also unintentionally upcasting LayoutUnits to floats in InlineTextBox's selection painting
      routine. Now we're properly rounding.
      
      Test: fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html
      
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paintSelection): Move paint values to integers and do proper rounding.
      * rendering/RenderBlock.cpp:
      (WebCore::blockDirectionOffset): Fix incorrect flooring in return value.
      (WebCore::inlineDirectionOffset): Ditto.
      (WebCore): Removing previous attempt to properly mirror inline box selection pixel alignment. This
      implementation rounded the final x value instead of properly rounding our block offset then flooring
      the offset that corresponds to the behavior in InlineTextBox. It also didn't properly pixel snap
      the y offset and height.
      (WebCore::RenderBlock::blockSelectionGap): Properly pixel snapping the gap rect before painting.
      (WebCore::RenderBlock::logicalLeftSelectionGap): Correctly match InlineTextBox's selection pixel
      alignment by flooring the logicalLeft and pixel snapping the subsequent rect. We do this in order
      to maintain proper render tree pixel snapping while simultaneously mirroring the flooring in the
      inline direction that occurs in InlineTextBox.cpp's alignSelectionRectToDevicePixels method.
      (WebCore::RenderBlock::logicalRightSelectionGap): Ditto with the right.
      
      LayoutTests: 
      
      One new selection test and updated snowleopard expectations for a handful that improved.
      
      Note: a couple of the RTL results appear worse, but sadly are only returning to our old pre-sub-pixel results.
      
      * fast/sub-pixel/selection: Added.
      * fast/sub-pixel/selection/selection-gaps-at-fractional-offsets-expected.txt: Added.
      * fast/sub-pixel/selection/selection-gaps-at-fractional-offsets.html: Added.
      * platform/chromium-mac-snowleopard/editing/selection/3690703-2-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/3690703-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/3690719-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/selection-button-text-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-lr-ltr-extend-line-backward-br-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-lr-ltr-extend-line-forward-br-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-backward-br-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-backward-p-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-backward-wrap-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-forward-br-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-forward-p-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-ltr-extend-line-forward-wrap-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.png:
      * platform/chromium-mac-snowleopard/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.png:
      * platform/chromium-mac-snowleopard/fast/sub-pixel: Added.
      * platform/chromium-mac-snowleopard/fast/sub-pixel/selection: Added.
      * platform/chromium-mac-snowleopard/fast/sub-pixel/selection/selection-gaps-at-fractional-offsets-expected.png: Added.
      * platform/chromium-mac/fast/repaint/japanese-rl-selection-repaint-expected.png:
      * platform/chromium-mac/fast/repaint/japanese-rl-selection-repaint-in-regions-expected.png:
      * platform/chromium/TestExpectations:
      * platform/efl/Skipped:
      * platform/gtk-wk2/Skipped:
      * platform/mac-lion/Skipped:
      * platform/mac-snowleopard/Skipped:
      * platform/mac-wk2/Skipped:
      * platform/mac/Skipped:
      * platform/qt-4.8/Skipped:
      * platform/qt/Skipped:
      * platform/win-wk2/Skipped:
      * platform/win-xp/Skipped:
      * platform/win/Skipped:
      * platform/wincairo/Skipped:
      * platform/wk2/Skipped:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6deea0ee
  24. 18 May, 2012 1 commit
    • leviw@chromium.org's avatar
      Revert to float method of selection rect alignment for line box tree · 607c575c
      leviw@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=86904
      
      Reviewed by Eric Seidel.
      
      In r117491, we introduced a new method of alignment for the selection rect in the sub-pixel case.
      It turns out there is at least one case on Mac where this leaves a gap when painting selection rects
      originating in the line box tree. This patch reverts us to the float method for the line box tree,
      but retains the LayoutRect snapping for gap rects.
      
      No new tests. Covered by existing tests with sub-pixel layout enabled.
      
      * rendering/EllipsisBox.cpp:
      (WebCore::EllipsisBox::paintSelection): Re-enabling the FloatRect flavor of
      alignSelectionRectToDevicePixels for the line box tree.
      * rendering/InlineTextBox.cpp:
      (WebCore::alignSelectionRectToDevicePixels): Moving LayoutRect flavor to RenderBlock.
      (WebCore::InlineTextBox::paintSelection): Happily clearing up the bifurcation of algorithms for
      sub-pixel layout.
      * rendering/InlineTextBox.h: Re-enabling the FloatRect flavor of alignSelectionRectToDevicePixels
      for the line box tree.
      * rendering/RenderBlock.cpp:
      (WebCore::alignSelectionRectToDevicePixels): Re-seating the LayoutRect version of
      alignSelectionRectToDevicePixels for use with GapRects.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117659 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      607c575c
  25. 17 May, 2012 1 commit
    • eae@chromium.org's avatar
      Fix rounding in paintSelection · d55f3c01
      eae@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=86693
      
      Reviewed by Eric Seidel.
      
      Break out rounding logic from InlineTextBox::paintSelection into separate
      function and use it for all the EllipsisBox paintSelection implementation
      and selection gap calculation. This ensures that selections are painted
      without gaps and overlaps once we turn on subpixel layout.
      
      No new tests, covered by existing tests in editing/selection and
      editing/style.
      
      * rendering/EllipsisBox.cpp:
      (WebCore::EllipsisBox::paintSelection):
      * rendering/InlineTextBox.cpp:
      (WebCore::alignSelectionRectToDevicePixels):
      (WebCore):
      (WebCore::InlineTextBox::paintSelection):
      * rendering/InlineTextBox.h:
      (WebCore):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::logicalLeftSelectionGap):
      (WebCore::RenderBlock::logicalRightSelectionGap):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@117491 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d55f3c01
  26. 10 May, 2012 1 commit
    • morrita@google.com's avatar
      WebKit should support tab-size. · 6e818ec7
      morrita@google.com authored
      https://bugs.webkit.org/show_bug.cgi?id=52994
      
      Source/WebCore:
      
      - Added boilerplate for "tab-size" CSS property.
      - Added RenderStye::tabSize() as a RareInheritedData.
      - Replaced TextRun::m_allowTabs into TextRun::m_tabSize.
      
      Reviewed by Simon Fraser.
      
      Tests: fast/css/tab-size-expected.html
             fast/css/tab-size.html
      
      * css/CSSComputedStyleDeclaration.cpp:
      (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
      * css/CSSParser.cpp:
      (WebCore::CSSParser::parseValue):
      * css/CSSProperty.cpp:
      (WebCore::CSSProperty::isInheritedProperty):
      * css/CSSPropertyNames.in:
      * css/CSSStyleSelector.cpp:
      (WebCore::CSSStyleSelector::applyProperty):
      * html/canvas/CanvasRenderingContext2D.cpp:
      (WebCore::CanvasRenderingContext2D::drawTextInternal):
      * platform/chromium/PopupListBox.cpp:
      (WebCore::PopupListBox::paintRow):
      * platform/graphics/Font.h:
      (WebCore::Font::tabWidth):
      * platform/graphics/TextRun.h:
      (WebCore::TextRun::TextRun):
      (WebCore::TextRun::allowTabs):
      (WebCore::TextRun::tabSize):
      (WebCore::TextRun::setTabSize):
      * platform/graphics/WidthIterator.cpp:
      (WebCore::WidthIterator::advance):
      * platform/graphics/mac/ComplexTextController.cpp:
      (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
      * platform/win/PopupMenuWin.cpp:
      (WebCore::PopupMenuWin::paint):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::constructTextRun):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::constructTextRun):
      * rendering/RenderBlockLineLayout.cpp:
      (WebCore::textWidth):
      (WebCore::tryHyphenating):
      * rendering/RenderText.cpp:
      (WebCore::RenderText::widthFromCache):
      (WebCore::RenderText::computePreferredLogicalWidths):
      (WebCore::RenderText::width):
      * rendering/RenderText.h:
      * rendering/style/RenderStyle.cpp:
      (WebCore::RenderStyle::diff):
      * rendering/style/RenderStyle.h:
      (WebCore::RenderStyleBitfields::tabSize):
      (WebCore::RenderStyleBitfields::collapsedTabSize):
      (WebCore::RenderStyleBitfields::setTabSize):
      (WebCore::RenderStyleBitfields::initialTabSize):
      * rendering/style/StyleRareInheritedData.cpp:
      (WebCore::StyleRareInheritedData::StyleRareInheritedData):
      (WebCore::StyleRareInheritedData::operator==):
      * rendering/style/StyleRareInheritedData.h:
      * rendering/svg/SVGInlineTextBox.cpp:
      (WebCore::SVGInlineTextBox::constructTextRun):
      * rendering/svg/SVGTextMetrics.cpp:
      (WebCore::constructTextRun):
      
      Source/WebKit/chromium:
      
      Reviewed by Simon Fraser.
      
      * src/WebTextRun.cpp:
      (WebKit::WebTextRun::operator WebCore::TextRun):
      
      LayoutTests:
      
      Reviewed by Simon Fraser.
      
      * fast/css/tab-size-expected.html: Added.
      * fast/css/tab-size.html: Added.
      * platform/chromium-linux/svg/css/getComputedStyle-basic-expected.txt:
      * platform/chromium-win/fast/css/getComputedStyle/computed-style-expected.txt:
      * platform/chromium-win/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116723 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6e818ec7
  27. 07 May, 2012 2 commits
    • commit-queue@webkit.org's avatar
      :first-line text-decorations are not rendered · 29facb8b
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=6047
      
      Source/WebCore:
      
      Text-decorations are applied during paint phase. The style was not being properly selected in case of
      first line box. The patch fixes this.
      
      Patch by Pravin D <pravind.2k4@gmail.com> on 2012-05-07
      Reviewed by Eric Seidel.
      
      Tests: fast/css/first-line-text-decoration-inherited-from-parent.html
             fast/css/first-line-text-decoration.html
      
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paintDecoration):
      Inform the decoration color retriever if this box is part of the first line box or not.
      
      * rendering/RenderObject.cpp:
      (WebCore::decorationColor):
      Changed the argument from RenderObject* to RenderStyle*. As this function is just a helper to getTextDecorationColors
      as used RenderObject solely to retrieve the corresponding RenderStyle, which(RenderStyle*) was already available with the latter function.
      
      (WebCore::RenderObject::getTextDecorationColors):
      Take a new variable to check if first line style or the regular style has to be used.
      Sends RenderStyle* as an argument to decorationColor().
      
      * rendering/RenderObject.h:
      (RenderObject):
      
      LayoutTests:
      
      Patch by Pravin D <pravind.2k4@gmail.com> on 2012-05-07
      Reviewed by Eric Seidel.
      
      * fast/css/first-line-text-decoration.html: Added.
      * platform/qt-linux/fast/css/first-line-text-decoration-expected.png: Added.
      * platform/qt-linux/fast/css/first-line-text-decoration-expected.txt: Added.
       This test checks if text-decoration present in the tags first-line style is applied properly.
      
      * fast/css/first-line-text-decoration-inherited-from-parent.html: Added.
      * platform/qt-linux/fast/css/first-line-text-decoration-inherited-from-parent-expected.png: Added.
      * platform/qt-linux/fast/css/first-line-text-decoration-inherited-from-parent-expected.txt: Added.
       This test checks if the text-decoration and text color is chosen properly in the case where
       the first-line style is inherited from a parent and contains such text-decorations.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116373 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      29facb8b
    • commit-queue@webkit.org's avatar
      Selection Background Color Error · a42bf04e
      commit-queue@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=80382
      
      Patch by Shezan Baig <shezbaig.wk@gmail.com> on 2012-05-07
      Reviewed by David Hyatt.
      
      Source/WebCore:
      
      Determine the text colors and selection colors before painting the
      background behind the text.  This is because when determining whether
      to invert the selection background, the selection text color should be
      used instead of the regular text color.  With this patch, the selection
      text color is passed to 'paintSelection' so that the selection
      background can be compared against it, instead of comparing against the
      CSSPropertyColor value.
      
      Test: fast/backgrounds/selection-background-color.html
      
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paint):
          Pass selection text color to paintSelection
      
      (WebCore::InlineTextBox::paintSelection):
          Use the selection text color instead of CSSPropertyColor
      
      * rendering/InlineTextBox.h:
      (InlineTextBox):
          Adjust signature of paintSelection to accept text color
      
      LayoutTests:
      
      Added new test case for selection background color.
      
      * fast/backgrounds/selection-background-color.html: Added.
      * fast/backgrounds/selection-background-color-expected.html: Added.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@116353 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a42bf04e
  28. 20 Apr, 2012 1 commit
    • mitz@apple.com's avatar
      Source/WebCore: <rdar://problem/10786000> Selection highlights of lines in... · e2068b8e
      mitz@apple.com authored
      Source/WebCore: <rdar://problem/10786000> Selection highlights of lines in adjoining blocks can overlap
      https://bugs.webkit.org/show_bug.cgi?id=84489
      
      Reviewed by Anders Carlsson.
      
      Test: fast/block/line-layout/selection-highlight-overlap.html
      
      * rendering/EllipsisBox.cpp:
      (WebCore::EllipsisBox::selectionRect): Changed to use
      selection{Top,Height}AdjustedForPrecedingBlock().
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paintSelection): Ditto.
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::inlineSelectionGaps): Ditto.
      (WebCore::RenderBlock::blockBeforeWithinSelectionRoot): Added. Returns the block which is
      likely to contain the selected line just before the first line in this block, if it is
      within the same selection root.
      * rendering/RenderBlock.h:
      * rendering/RootInlineBox.cpp:
      (WebCore::RootInlineBox::selectionTopAdjustedForPrecedingBlock): Added. If the selection
      starts before our block, finds the last line in the preceding block and adjusts the selection
      top to avoid overlap with that line’s selection bottom.
      * rendering/RootInlineBox.h:
      (WebCore::RootInlineBox::selectionHeightAdjustedForPrecedingBlock): Added. Like
      selectionHeight(), but uses selectionTopAdjustedForPrecedingBlock().
      
      LayoutTests: Selection highlights of lines in adjoining blocks can overlap
      https://bugs.webkit.org/show_bug.cgi?id=84489
      
      Reviewed by Anders Carlsson.
      
      * fast/block/line-layout/selection-highlight-overlap-expected.html: Added.
      * fast/block/line-layout/selection-highlight-overlap.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114784 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e2068b8e
  29. 15 Apr, 2012 1 commit
    • jpu@apple.com's avatar
      Introducing DictationCommand. · dfd2ce60
      jpu@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=83549
      
      Reviewed by Hajime Morita.
      
      No new tests. This patch doesn't introduce any change of new functionality. It prepares for
      additional changes which will inlude tests.
      
      On OS X, alternative dictation results need to be stored as document markers. This patch introduces
      following changes to achieve this:
      1. Added DictationMarkDetails to store non-string type maker detail.
      2. Introduce DictationCommand, which is similor to TypingCommand, but allows inserting text with
        attached markers.
      3. Added Editor::insertDictatedText as interaface to WebKit and WebKit2.
      4. Added struct DictationAlternative to pass dictation related info from WebKit to WebCore.
      
      Several fragments of code in TypingCommand can be also used by DictationCommand. So this patch
      introduced a new class, TextInsertionBaseCommand. It's a subclass of CompositeEditCommmand, and
      base class of both TypingCommand and DictationCommand.
      
      This patch also extends InsertTextCommand class. Its constructor will take an TextInsertionMarkerSupplier
      object. After text is inserted to a node, InsertTextCommand would give marker supplier a chance to
      add document markers to the inserted text.
      
      * CMakeLists.txt:
      * GNUmakefile.list.am:
      * Target.pri:
      * WebCore.exp.in:
      * WebCore.gypi:
      * WebCore.vcproj/WebCore.vcproj:
      * WebCore.xcodeproj/project.pbxproj:
      * dom/Document.cpp:
      (WebCore::eventTargetNodeForDocument): Moved this function from EventHandler so that it can be used
        by AlternativeTextController.
      (WebCore):
      * dom/Document.h:
      (WebCore):
      * dom/DocumentMarker.cpp:
      (WebCore::DocumentMarker::DocumentMarker): New constructor that takes a pointer to DocumentMarkerDetails object.
      (WebCore):
      * dom/DocumentMarker.h:
      (WebCore::DocumentMarker::AllMarkers::AllMarkers):
      (DocumentMarker):
      * dom/DocumentMarkerController.cpp:
      (WebCore::DocumentMarkerController::addMarker):
      (WebCore):
      * dom/DocumentMarkerController.h:
      (DocumentMarkerController):
      * dom/TextEvent.cpp:
      (WebCore::TextEvent::createForDictation):
      (WebCore):
      (WebCore::TextEvent::TextEvent):
      * dom/TextEvent.h: Added member variable for dictation alternatives.
      (TextEvent):
      (WebCore::TextEvent::isDictation):
      (WebCore::TextEvent::dictationAlternatives):
      * dom/TextEventInputType.h:
      * editing/AlternativeTextController.cpp:
      (WebCore::AlternativeTextController::AlternativeTextController):
      (WebCore::AlternativeTextController::insertDictatedText): Used by Editor::insertDictatedText().
      (WebCore):
      * editing/AlternativeTextController.h:
      (WebCore):
      (DictationMarkerDetails):
      (WebCore::DictationMarkerDetails::create):
      (WebCore::DictationMarkerDetails::originalText):
      (WebCore::DictationMarkerDetails::dictationContext):
      (WebCore::DictationMarkerDetails::DictationMarkerDetails):
      (AlternativeTextController):
      * editing/CompositeEditCommand.h:
      (WebCore::CompositeEditCommand::isDictationCommand):
      * editing/DictationAlternative.cpp: Added.
      (WebCore):
      (WebCore::DictationAlternative::DictationAlternative):
      * editing/DictationAlternative.h: Added. Data structure for passing dictation related data from WebKit to WebCore.
      (DictationAlternative):
      (WebCore):
      * editing/DictationCommand.cpp: Added.
      (WebCore):
      (DictationCommandLineOperation):
      (WebCore::DictationCommandLineOperation::DictationCommandLineOperation):
      (WebCore::DictationCommandLineOperation::operator()):
      (DictationMarkerSupplier):
      (WebCore::DictationMarkerSupplier::create):
      (WebCore::DictationMarkerSupplier::addMarkersToTextNode):
      (WebCore::DictationMarkerSupplier::DictationMarkerSupplier):
      (WebCore::DictationCommand::DictationCommand):
      (WebCore::DictationCommand::insertText):
      (WebCore::DictationCommand::doApply):
      (WebCore::DictationCommand::insertTextRunWithoutNewlines):
      (WebCore::DictationCommand::insertParagraphSeparator):
      (WebCore::DictationCommand::collectDictationAlternativesInRange):
      * editing/DictationCommand.h: Added.
      (WebCore):
      (DictationCommand):
      (WebCore::DictationCommand::isDictationCommand):
      (WebCore::DictationCommand::create):
      * editing/EditingAllInOne.cpp:
      * editing/Editor.cpp:
      (WebCore::Editor::insertDictatedText): Main interface that allows WebKit passes in text with attached dictation information.
      (WebCore):
      (WebCore::Editor::insertTextWithoutSendingTextEvent):
      (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
      * editing/Editor.h:
      (Editor):
      * editing/InsertTextCommand.cpp:
      (WebCore::InsertTextCommand::InsertTextCommand):
      (WebCore):
      (WebCore::InsertTextCommand::doApply):
      * editing/InsertTextCommand.h:
      (WebCore):
      (TextInsertionMarkerSupplier): Interface to allow caller of InsertTextCommand to add document markers to inserted text.
      (WebCore::TextInsertionMarkerSupplier::~TextInsertionMarkerSupplier):
      (WebCore::TextInsertionMarkerSupplier::TextInsertionMarkerSupplier):
      (WebCore::InsertTextCommand::createWithMarkerSupplier):
      (InsertTextCommand):
      * editing/TextInsertionBaseCommand.cpp: Added. This class contains functions shared by TypingCommand and DictationCommand.
      (WebCore):
      (WebCore::TextInsertionBaseCommand::TextInsertionBaseCommand):
      (WebCore::TextInsertionBaseCommand::applyTextInsertionCommand):
      (WebCore::dispatchBeforeTextInsertedEvent):
      (WebCore::canAppendNewLineFeedToSelection):
      * editing/TextInsertionBaseCommand.h: Added.
      (WebCore):
      (TextInsertionBaseCommand):
      (WebCore::TextInsertionBaseCommand::~TextInsertionBaseCommand):
      (WebCore::forEachLineInString):
      * editing/TypingCommand.cpp:
      (TypingCommandLineOperation):
      (WebCore::TypingCommandLineOperation::TypingCommandLineOperation):
      (WebCore::TypingCommandLineOperation::operator()):
      (WebCore::TypingCommand::TypingCommand):
      (WebCore::TypingCommand::insertText):
      (WebCore::TypingCommand::insertLineBreak):
      (WebCore::TypingCommand::insertParagraphSeparator):
      * editing/TypingCommand.h:
      * page/EventHandler.cpp:
      * rendering/InlineTextBox.cpp:
      (WebCore::lineStyleForMarkerType):
      (WebCore::InlineTextBox::paintDocumentMarker): Renamed existing function to reflect new funcationality.
      (WebCore::InlineTextBox::paintDocumentMarkers):
      * rendering/InlineTextBox.h:
      (InlineTextBox):
      * testing/Internals.cpp:
      (WebCore::markerTypesFrom):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      dfd2ce60
  30. 12 Apr, 2012 1 commit
    • hyatt@apple.com's avatar
      https://bugs.webkit.org/show_bug.cgi?id=83817 · c2fdbe10
      hyatt@apple.com authored
              
      This patch modifies RenderText so that it scans all of its characters up front to
      determine whether or not the simple code path can be used for measurement/rendering
      of the text for the whole run.
              
      TextRun now has an additional field that indicates that the character scan is not
      required, since the entire RenderText is known to be simple. This boolean is set
      when constructing the TextRun from the places that make TextRuns from RenderTexts.
              
      The character scan has been refactored into a static Font method so that it can be
      called by RenderText. The scan of individual TextRuns is also done using the same method
      so that the code is shared.
      
      Reviewed by Dan Bernstein.
      
      * platform/graphics/Font.cpp:
      (WebCore::Font::codePath):
      (WebCore::Font::characterRangeCodePath):
      * platform/graphics/Font.h:
      * platform/graphics/TextRun.h:
      (WebCore::TextRun::TextRun):
      (WebCore::TextRun::characterScanForCodePath):
      (WebCore::TextRun::setCharacterScanForCodePath):
      (TextRun):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::constructTextRun):
      * rendering/RenderBlockLineLayout.cpp:
      (WebCore::textWidth):
      * rendering/RenderText.cpp:
      (WebCore::RenderText::RenderText):
      (WebCore::RenderText::widthFromCache):
      (WebCore::RenderText::setTextInternal):
      (WebCore::RenderText::width):
      (WebCore::RenderText::computeCanUseSimpleFontCodePath):
      (WebCore):
      * rendering/RenderText.h:
      (RenderText):
      (WebCore::RenderText::canUseSimpleFontCodePath):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@114032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c2fdbe10
  31. 03 Apr, 2012 1 commit
    • jpu@apple.com's avatar
      Rename GraphicsContext::drawLineForTextChecking() to GraphicsContext::drawLineForDocumentMarker() · 02107526
      jpu@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=82946
      
      Reviewed by Enrica Casucci.
      
      On OS X, we draw similar underline on dictated text that has alternative text. We rename
      this function, so that we can reuse it for dictation underline.
      
      No new tests, since there's no change of functionality.
      
      * platform/graphics/GraphicsContext.h:
      * platform/graphics/cairo/GraphicsContextCairo.cpp:
      (WebCore::GraphicsContext::drawLineForDocumentMarker):
      * platform/graphics/mac/GraphicsContextMac.mm:
      (WebCore::GraphicsContext::drawLineForDocumentMarker):
      * platform/graphics/openvg/GraphicsContextOpenVG.cpp:
      (WebCore::GraphicsContext::drawLineForDocumentMarker):
      * platform/graphics/qt/GraphicsContextQt.cpp:
      (WebCore::GraphicsContext::drawLineForDocumentMarker):
      * platform/graphics/skia/GraphicsContextSkia.cpp:
      (WebCore::GraphicsContext::drawLineForDocumentMarker):
      * platform/graphics/win/GraphicsContextCGWin.cpp:
      (WebCore::GraphicsContext::drawLineForDocumentMarker):
      * platform/graphics/wince/GraphicsContextWinCE.cpp:
      (WebCore::GraphicsContext::drawLineForDocumentMarker):
      * platform/graphics/wx/GraphicsContextWx.cpp:
      (WebCore::GraphicsContext::drawLineForDocumentMarker):
      * rendering/InlineTextBox.cpp:
      (WebCore::lineStyleForMarkerType):
      (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      02107526
  32. 29 Mar, 2012 1 commit
    • rniwa@webkit.org's avatar
      Pack bitfields in InlineBox for Windows · 296fcae0
      rniwa@webkit.org authored
      https://bugs.webkit.org/show_bug.cgi?id=82578
      
      Reviewed by Kent Tamura.
      
      Unlike gcc and clang, MSVC pads each consecutive member variables of the same type in bitfields. e.g. if you have:
      sturct AB {
      unsigned m_1 : 31;
      bool m_2 : 1;
      }
      then MSVC pads m_1 and allocates sizeof(unsigned) * 2 for AB whereas gcc and clang only allocate
      sizeof(unsigned) * 1 for AB.
      
      Fixed the bug by packing all bitfields in InlineBox into InlineBoxBitfields and always using either unsigned or int.
      
      * rendering/EllipsisBox.cpp:
      (WebCore::EllipsisBox::paint):
      (WebCore::EllipsisBox::selectionRect):
      (WebCore::EllipsisBox::nodeAtPoint):
      * rendering/InlineBox.cpp:
      (WebCore):
      (SameSizeAsInlineBox):
      (WebCore::InlineBox::logicalHeight):
      (WebCore::InlineBox::baselinePosition): Moved from the header file since it's a virtual function.
      (WebCore::InlineBox::lineHeight): Ditto.
      (WebCore::InlineBox::deleteLine):
      (WebCore::InlineBox::extractLine):
      (WebCore::InlineBox::attachLine):
      (WebCore::InlineBox::nextOnLineExists):
      (WebCore::InlineBox::clearKnownToHaveNoOverflow):
      * rendering/InlineBox.h:
      (WebCore::InlineBox::InlineBox):
      (WebCore::InlineBox::isText):
      (WebCore::InlineBox::setIsText):
      (WebCore::InlineBox::hasVirtualLogicalHeight):
      (WebCore::InlineBox::setHasVirtualLogicalHeight):
      (WebCore::InlineBox::isHorizontal):
      (WebCore::InlineBox::setIsHorizontal):
      (WebCore::InlineBox::isConstructed):
      (WebCore::InlineBox::setConstructed):
      (WebCore::InlineBox::setExtracted):
      (WebCore::InlineBox::setFirstLineStyleBit):
      (WebCore::InlineBox::isFirstLineStyle):
      (InlineBox):
      (WebCore::InlineBox::bidiLevel):
      (WebCore::InlineBox::setBidiLevel):
      (WebCore::InlineBox::direction):
      (WebCore::InlineBox::isDirty):
      (WebCore::InlineBox::markDirty):
      (WebCore::InlineBox::expansion):
      (WebCore::InlineBox::verticalAlign):
      (WebCore::InlineBox::knownToHaveNoOverflow):
      (WebCore::InlineBox::dirOverride):
      (WebCore::InlineBox::setDirOverride):
      (InlineBoxBitfields):
      (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields):
      (WebCore::InlineBox::InlineBoxBitfields::bidiEmbeddingLevel):
      (WebCore::InlineBox::InlineBoxBitfields::setBidiEmbeddingLevel):
      (WebCore::InlineBox::InlineBoxBitfields::determinedIfNextOnLineExists):
      (WebCore::InlineBox::InlineBoxBitfields::setDeterminedIfNextOnLineExists):
      (WebCore::InlineBox::InlineBoxBitfields::nextOnLineExists):
      (WebCore::InlineBox::InlineBoxBitfields::setNextOnLineExists):
      (WebCore::InlineBox::InlineBoxBitfields::expansion):
      (WebCore::InlineBox::InlineBoxBitfields::setExpansion):
      (WebCore::InlineBox::endsWithBreak):
      (WebCore::InlineBox::setEndsWithBreak):
      (WebCore::InlineBox::hasEllipsisBox):
      (WebCore::InlineBox::hasSelectedChildren):
      (WebCore::InlineBox::setHasSelectedChildren):
      (WebCore::InlineBox::setHasEllipsisBox):
      (WebCore::InlineBox::hasHyphen):
      (WebCore::InlineBox::setHasHyphen):
      (WebCore::InlineBox::canHaveLeadingExpansion):
      (WebCore::InlineBox::setCanHaveLeadingExpansion):
      (WebCore::InlineBox::setExpansion):
      (WebCore::InlineBox::extracted):
      * rendering/InlineFlowBox.cpp:
      (WebCore::InlineFlowBox::addToLine):
      (WebCore::InlineFlowBox::removeChild):
      (WebCore::InlineFlowBox::extractLine):
      (WebCore::InlineFlowBox::attachLine):
      (WebCore::InlineFlowBox::placeBoxesInInlineDirection):
      (WebCore::InlineFlowBox::requiresIdeographicBaseline):
      (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
      (WebCore::InlineFlowBox::addBoxShadowVisualOverflow):
      (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
      (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
      (WebCore::InlineFlowBox::paintBoxDecorations):
      (WebCore::InlineFlowBox::computeOverAnnotationAdjustment):
      (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment):
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::destroy):
      (WebCore::InlineTextBox::logicalOverflowRect):
      (WebCore::InlineTextBox::setLogicalOverflowRect):
      (WebCore::InlineTextBox::baselinePosition):
      (WebCore::InlineTextBox::lineHeight):
      (WebCore::InlineTextBox::localSelectionRect):
      (WebCore::InlineTextBox::extractLine):
      (WebCore::InlineTextBox::attachLine):
      (WebCore::InlineTextBox::placeEllipsisBox):
      (WebCore::InlineTextBox::paint):
      (WebCore::InlineTextBox::paintDecoration):
      (WebCore::InlineTextBox::paintSpellingOrGrammarMarker):
      (WebCore::InlineTextBox::paintCompositionUnderline):
      (WebCore::InlineTextBox::offsetForPosition):
      (WebCore::InlineTextBox::positionForOffset):
      (WebCore::InlineTextBox::constructTextRun):
      * rendering/InlineTextBox.h:
      (InlineTextBox):
      (WebCore::InlineTextBox::setExpansion):
      (WebCore::InlineTextBox::expansionBehavior):
      * rendering/RenderBlockLineLayout.cpp:
      (WebCore::RenderBlock::constructLine):
      * rendering/RenderTreeAsText.cpp:
      (WebCore::writeTextRun):
      * rendering/RootInlineBox.cpp:
      (WebCore::RootInlineBox::baselinePosition): Moved from the header file since it's a virtual function.
      (WebCore::RootInlineBox::lineHeight): Ditto.
      (WebCore::RootInlineBox::paint):
      (WebCore::RootInlineBox::ascentAndDescentForBox):
      (WebCore::RootInlineBox::verticalPositionForBox):
      * rendering/RootInlineBox.h:
      (RootInlineBox):
      * rendering/svg/SVGInlineTextBox.cpp:
      (WebCore::SVGInlineTextBox::constructTextRun):
      * rendering/svg/SVGRenderTreeAsText.cpp:
      (WebCore::writeSVGInlineTextBox):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      296fcae0
  33. 26 Mar, 2012 1 commit
    • leviw@chromium.org's avatar
      Update localSelectionRect to return a LayoutRect · b43991f8
      leviw@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=82183
      
      Reviewed by Eric Seidel.
      
      localSelectionRect returns a rectangle in the coordinate space of its renderer,
      and therefor should remain LayoutUnits until being promoted to absolute
      coordinates or painted. Also fixing an incorrect conversion of startPos and
      endPos in selectionRectForRepaint.
      
      No new tests. No change in behavior.
      
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::localSelectionRect): Continuing to use enclosingIntRect
      for the value being returned from the font engine since these floating point
      values should not be pixel snapped.
      * rendering/InlineTextBox.h:
      (InlineTextBox):
      * rendering/RenderReplaced.cpp:
      (WebCore::RenderReplaced::localSelectionRect):
      * rendering/RenderReplaced.h:
      (RenderReplaced):
      * rendering/RenderText.cpp:
      (WebCore::localQuadForTextBox):
      (WebCore::RenderText::absoluteRectsForRange):
      (WebCore::RenderText::absoluteQuadsForRange):
      (WebCore::RenderText::selectionRectForRepaint): Fixing an incorrect conversion of
      start/endPos to LayoutUnits. These values represent a range of selected characters,
      not layout values!
      * rendering/svg/RenderSVGInlineText.cpp:
      (WebCore::RenderSVGInlineText::localCaretRect):
      * rendering/svg/SVGInlineTextBox.cpp:
      (WebCore::SVGInlineTextBox::localSelectionRect):
      * rendering/svg/SVGInlineTextBox.h:
      (SVGInlineTextBox):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112166 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b43991f8
  34. 16 Mar, 2012 1 commit
    • leviw@chromium.org's avatar
      Update usage of LayoutUnits in RenderBlock* · d32486e7
      leviw@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=80437
      
      Reviewed by Julien Chaffraix.
      
      Updating LayoutUnit usage in RenderBlock and RenderBlockLineLayout. This better readies trunk for
      the transition to subpixel layout.
      
      See https://trac.webkit.org/wiki/LayoutUnit for more details.
      
      No new tests. No changed behavior.
      
      * rendering/InlineTextBox.cpp:
      (WebCore::InlineTextBox::paint): Adding the paint offset rounding previously in RenderBlock::paint.
      * rendering/LayoutTypes.h:
      (WebCore::floorToInt): Will floor a LayoutUnit to an integer once we switch to
      FractionalLayoutUnits.
      (WebCore::boundedMultiply): Method that will return the multiplied result of two LayoutUnits
      or the max/min LayoutUnit if the result overflows. Only does a regular multiply while
      LayoutUnits are integers instead of FractionalLayoutUnits.
      (WebCore):
      * rendering/RenderBlock.cpp:
      (WebCore::RenderBlock::paintContents): Rounding the paintOffset here didn't work for all
      inline blocks. This rounding is actually only needed for InlineTextBoxes, so the logic has
      been moved there.
      (WebCore::RenderBlock::newLine): Use a LayoutUnit for the y position.
      (WebCore::RenderBlock::isPointInOverflowControl): Points for hit testing need to be rounded.
      (WebCore::RenderBlock::layoutColumns): Using boundedMultiply for a calculation prone to overflow.
      (WebCore::updatePreferredWidth): Reverting back to using ceilf. ceiledLayoutUnit was to be ultimately
      converted to just a straight LayoutUnit constructor to preserve precision. This precision doesn't work
      for us here as we still paint Boxes/Blocks on pixel boundaries, so we need to expand to a pixel size
      that encloses the contained text.
      (WebCore::RenderBlock::setPageLogicalOffset): LogicalOffset should be a LayoutUnit.
      (WebCore::RenderBlock::marginValuesForChild): Margins should have subpixel resolution.
      (WebCore::RenderBlock::FloatingObjects::intervalForFloatingObject): Intervals for floating objects
      need to use pixel snapped values to give the proper results.
      * rendering/RenderBlock.h:
      (WebCore::RenderBlock::pixelSnappedLogicalLeftOffsetForLine): Only moved.
      (WebCore::RenderBlock::pixelSnappedLogicalRightOffsetForLine): While we can round the left offset,
      columns add an extra offset at paint that can't currently be planned for at line-layout time. To
      avoid laying out lines that run off the end of columns, we floor the right offset. The resulting
      lines will be up to 1 pixel shorter than they potentially could be.
      (RenderBlock):
      (WebCore::RenderBlock::FloatingObject::pixelSnappedX): Using corresponding pixelSnappedX value from
      LayoutRects.
      (WebCore::RenderBlock::FloatingObject::pixelSnappedMaxX): Ditto.
      (WebCore::RenderBlock::FloatingObject::pixelSnappedY): Ditto.
      (WebCore::RenderBlock::FloatingObject::pixelSnappedMaxY): Ditto.
      (WebCore::RenderBlock::FloatingObject::pixelSnappedWidth): Ditto.
      (WebCore::RenderBlock::FloatingObject::pixelSnappedHeight): Ditto.
      * rendering/RenderBlockLineLayout.cpp:
      (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded): LogicalHeight is a LayoutUnit. Also
      flooring textIndentOffset to an integer to match old behavior.
      (WebCore::LineWidth::fitBelowFloats): Using LayoutUnits for float logical top and bottoms.
      (WebCore::LineLayoutState::endLineLogicalTop): Changing to a LayoutUnit.
      (WebCore::LineLayoutState::setEndLineLogicalTop): Ditto.
      (LineLayoutState): Ditto.
      (WebCore::RenderBlock::linkToEndLineIfNeeded): Calculating overflow with LayoutUnits.
      (WebCore::RenderBlock::layoutInlineChildren): LowestAllowedPosition should be subpixel.
      (WebCore::RenderBlock::checkLinesForTextOverflow): Reverting ellipsis width calculation to integers
      as this value can be seen as representing pixels on screen.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110983 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d32486e7