Fix cast-align warnings in WebCore/platform/graphics/texmap/TextureMapperGL.cpp
https://bugs.webkit.org/show_bug.cgi?id=118249

Reviewed by Allan Sandfeld Jensen.

* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::BitmapTextureGL::updateContents):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152283 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Simplify SVGTextContentElement::elementFromRenderer()
https://bugs.webkit.org/show_bug.cgi?id=118284

Reviewed by Andreas Kling.

Simplify SVGTextContentElement::elementFromRenderer() by leveraging
SVGElement::isTextContent() methods instead of explicitly checking
for tag names.

No new tests, no behavior change.

* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::elementFromRenderer):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152284 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce toSVGInlineTextBox
https://bugs.webkit.org/show_bug.cgi?id=118289

Reviewed by Andreas Kling.

As a step to change static_cast with toXXX, static_cast<SVGInlineTextBox*> can
be changed with toSVGInlineTextBox().

Blink merge from https://src.chromium.org/viewvc/blink?view=rev&revision=153345

* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::positionForPoint):
* rendering/svg/SVGInlineFlowBox.cpp:
(WebCore::SVGInlineFlowBox::paintSelectionBackground):
(WebCore::SVGInlineFlowBox::paint):
(WebCore::SVGInlineFlowBox::computeTextMatchMarkerRectForRenderer):
* rendering/svg/SVGInlineTextBox.h:
(WebCore::toSVGInlineTextBox):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGInlineTextBoxes):
* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::paint):
(WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes):
(WebCore::SVGRootInlineBox::layoutChildBoxes):
(WebCore::reverseInlineBoxRangeAndValueListsIfNeeded):
* rendering/svg/SVGTextQuery.cpp:
(WebCore::SVGTextQuery::collectTextBoxesInFlowBox):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152285 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unexpose EditingPropertiesToInclude in EditingStyle.h after r151772
https://bugs.webkit.org/show_bug.cgi?id=118271

Reviewed by Andreas Kling.

Don't expose EditingPropertiesToInclude in EditingStyle.h and do other cleanups as described below.

No new tests since there should be no behavioral change.

* editing/EditingStyle.cpp:
(WebCore::copyEditingProperties): Use newly defined numAllEditingProperties and numInheritableEditingProperties
instead of a magic number of 2.
(WebCore::copyPropertiesFromComputedStyle): Renamed from editingStyleFromComputedStyle. It now takes ComputedStyleExtractor and
PropertiesToInclude instead of Node* and EditingPropertiesToInclude and handles AllProperties. Also added a helper that takes Node*.
(WebCore::EditingStyle::init): Calls copyPropertiesFromComputedStyle. Unfortunately, we need to special-case EditingPropertiesInEffect
and not set background-color and text-decoration. This is required probably due to a bug elsewhere.
(WebCore::EditingStyle::removeStyleAddedByNode):
(WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
(WebCore::extractEditingProperties): Renamed from EditingStyle::removeAllButEditingProperties; takes PropertiesToInclude instead of
EditingPropertiesToInclude since the only caller of this function, EditingStyle::mergeInlineAndImplicitStyleOfElement, was converting
the type.
(WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
* editing/EditingStyle.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skip 3 MathML tests that are failing after r152235.
<http://webkit.org/b/118298>

* TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152287 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Skip fast/dom/timer-throttling-hidden-page.html after r152202.
<http://webkit.org/b/118301>

* TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid code duplication inside String::append()
https://bugs.webkit.org/show_bug.cgi?id=118290

Reviewed by Anders Carlsson.

The implementation of 'append(UChar)' had been repeated inside 'append(LChar)',
this duplication is obviated now.

* wtf/text/WTFString.cpp:
(WTF::String::appendInternal):
(WTF::String::append):
* wtf/text/WTFString.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152289 268f45cc-cd09-0410-ab3c-d52691b4dbfc
is/toHTMLStyleElement should use Element* for its argument
https://bugs.webkit.org/show_bug.cgi?id=118286

Reviewed by Andreas Kling.

To reduce unnecessary call of isElementNode(), this patch replaces argument
of is/toHTMLStyleElement from Node* to Element*. Plus, use Element::hasTagName
in collectActiveStyleSheets function for minor code refactoring since
its cost is cheaper than Node::hasTagName.

* css/CSSStyleSheet.cpp:
(WebCore::isAcceptableCSSStyleSheetParent):
* css/StyleScopeResolver.cpp:
(WebCore::StyleScopeResolver::scopeFor):
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets):
* dom/Node.cpp:
(WebCore::Node::numberOfScopedHTMLStyleChildren):
* html/HTMLStyleElement.h:
(WebCore::isHTMLStyleElement):
(WebCore::toHTMLStyleElement):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152290 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Rebaseline background blend mode default test result.

* platform/mac/css3/compositing/background-blend-mode-default-value-expected.png:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152291 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r152233.
http://trac.webkit.org/changeset/152233
https://bugs.webkit.org/show_bug.cgi?id=118304

hopeful attempt to restore windows buildage (Requested by
kling on #webkit).

* win/tools/vsprops/debugsuffix.props:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152292 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions] No other SVG elements except the SVGRoot must have RegionInfo objects attached
https://bugs.webkit.org/show_bug.cgi?id=118295

Patch by Radu Stavila <stavila@adobe.com> on 2013-07-02
Reviewed by Antti Koivisto.

Only the SVGRoot element can be collected in a named flow. As such, no SVG element below the root should
be attached to a RenderBoxRegionInfo object.

A larger patch's test (https://bugs.webkit.org/show_bug.cgi?id=118300) is failing because of this.
This change will be covered by that test.

* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::canHaveBoxInfoInRegion):
* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderSVGBlock):
* rendering/svg/RenderSVGBlock.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Added new baselines for GTK after revision r151841 and r151868.

* accessibility/listitem-title-expected.txt: Renamed from LayoutTests/platform/mac/accessibility/listitem-title-expected.txt.
* platform/gtk/accessibility/aria-tab-role-on-buttons-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152294 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix WebKitTestRunner crashes.
https://bugs.webkit.org/show_bug.cgi?id=117630

Reviewed by Darin Adler.

Create static function to dump for WebProcess unresponsiveness status,
and use it before calling TestController::runTest().

Accessing TestController::m_currentInvocation before calling
TestController::runTest() can make crash because the invocation
instance will be assigned at the function.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::run):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::dumpWebProcessUnresponsiveness):
* WebKitTestRunner/TestInvocation.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152295 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening. Added new common expectations for test after r151665.

* accessibility/box-styled-lists-expected.txt: Added shared expectation.
* platform/efl/TestExpectations: Removed failure expectation.
* platform/gtk/TestExpectations: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152296 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Curl] Crash after download.
https://bugs.webkit.org/show_bug.cgi?id=118303

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-07-02
Reviewed by Brent Fulgham.

We need to make sure that the Curl easy handle is removed from the Curl multi handle before it's freed.

* platform/network/curl/CurlDownload.cpp:
(CurlDownloadManager::updateHandleList): Use addToCurl() and removeFromCurl() methods.
(CurlDownloadManager::addToCurl): Add method to add easy handle to multi handle.
(CurlDownloadManager::removeFromCurl): Add method to remove easy handle from multi handle, and then delete the handle.
(CurlDownloadManager::downloadThread): Use removeFromCurl() method.
(CurlDownload::~CurlDownload):
* platform/network/curl/CurlDownload.h: Avoid deleting Curl easy handle in destructor.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152297 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[ATK] Leak: leaks in AccessibilityUIElement
https://bugs.webkit.org/show_bug.cgi?id=118297

Fixed memory leak.

Patch by Brian Holt <brian.holt@samsung.com> on 2013-07-02
Reviewed by Christophe Dumez.

* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(AccessibilityUIElement::stringValue):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152298 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove SVGStyledLocatableElement class
https://bugs.webkit.org/show_bug.cgi?id=118283

Reviewed by Dirk Schulze.

Remove SVGStyledLocatableElement class and have SVGGraphicsElement
inherit SVGStyledElement directly instead. SVGStyledLocatableElement
is no longer needed and according to the specification, SVGGraphicsElement
should inherit SVGStyledElement (actually SVGElement once we merge
SVGStyledElement into SVGElement).

No new tests, no behavior change.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.order:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(GetGnuVTableOffsetForType):
* svg/SVGAllInOne.cpp:
* svg/SVGElement.cpp:
(WebCore::SVGElement::getBoundingBox):
* svg/SVGElement.h:
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::SVGGraphicsElement):
(WebCore::SVGGraphicsElement::parseAttribute):
(WebCore::SVGGraphicsElement::svgAttributeChanged):
* svg/SVGGraphicsElement.h:
* svg/SVGLocatable.cpp:
(WebCore::SVGLocatable::getTransformToElement):
* svg/SVGStyledElement.cpp:
(WebCore::SVGStyledElement::localCoordinateSpaceTransform):
* svg/SVGStyledLocatableElement.cpp: Removed.
* svg/SVGStyledLocatableElement.h: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152299 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Unreviewed build correction for 'DebugSuffix' target.

* JavaScriptCore.vcxproj/LLInt/LLIntAssembly/LLIntAssembly.vcxproj: Must pass the
DEBUGSUFFIX definition to the nmake instance to be available during script processing.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
constrainScrollPositionForOverhang needs to handle scrollOrigin correctly
https://bugs.webkit.org/show_bug.cgi?id=118176
<rdar://problem/14301271>

Reviewed by Anders Carlsson.

Test: compositing/geometry/fixed-position-flipped-writing-mode.html

WebCore makes use of constrainScrollPositionForOverhang not only for
constraining fixed- and sticky-positioned elements to the viewport, but
also for clamping the tile cache's visible rect.

Therefore, constrainScrollPositionForOverhang needs to correctly take
the scrollOrigin into account. The easiest way I saw to do this was to
reimplement the function in terms of a pair of rect intersections
between a virtual scrollable "viewport" and the document (with a bit
of complication from headers and footers).

The first intersection is performed, then if the viewport doesn't fit,
it is pushed down and to the right, from the origin. Next, we intersect
again, this time pushing the rect up by the amount it overflowed the document
rect from the bottom right. This performs effectively the same constraint
as previously, but handles the scrollOrigin correctly and is also somewhat
easier to read and understand (with pictures).

* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::setScrollLayerPosition):
Subtract the scrollOrigin out of the offset passed to scrollOffsetForFixedPosition,
it's expecting an offset without the origin included.

* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::constrainScrollPositionForOverhang):
Reimplement the function as described above.

Add a test that ensures that fixed position works with a scrollable document
and direction: rtl, which is one case where scrollOrigin is set.

Disable the test on Mac WebKit1 because of https://bugs.webkit.org/show_bug.cgi?id=118269.

* compositing/geometry/fixed-position-flipped-writing-mode-expected.txt: Added.
* compositing/geometry/fixed-position-flipped-writing-mode.html: Added.
* platform/mac/compositing/geometry/fixed-position-flipped-writing-mode-expected.png: Added.
* platform/mac/TestExpectations:
* platform/mac-wk2/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@152303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
plainText() is O(N^2)
https://bugs.webkit.org/show_bug.cgi?id=118282
<rdar://problem/14284360>

Reviewed by Alexey Proskuryakov.

Source/WebCore: 

* editing/TextIterator.cpp:
(WebCore::plainText): Linear growth for a vector data type is O(N^2).
Don't do that. Luckily, StringBuilder does the right thing automatically,
so we can just delete code.

Source/WTF: 

* wtf/text/StringBuilder.cpp:
(WTF::expandCapacity): Factored out this helper function to simplify
some code that was duplicated in four places.

(WTF::StringBuilder::appendUninitializedSlow):
(WTF::StringBuilder::append): Use expandCapacity(). One of the cases
was not doing anything special, and so was O(N^2).

Also, always call expandCapacity() it in a standard way, calling
capacity() first, so it's easy to tell at a glance that you got it right.


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