Assertion in LegacyWebArchive::create() in editing tests
https://bugs.webkit.org/show_bug.cgi?id=112642

Reviewed by Enrica Casucci.

It's possible for clipboard to be overriden between the time we retrieve clipboard types and the time
we actually retrieve the Web archive buffer. Add a null check to take this into account.

Also extracted fragmentFromWebArchive for clarity.

* platform/mac/PasteboardMac.mm:
(WebCore::fragmentFromWebArchive): Extracted.
(WebCore::Pasteboard::documentFragment):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146389 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Build ANGLE sources into a separate library from libWebCore.la
https://bugs.webkit.org/show_bug.cgi?id=112778

Reviewed by Martin Robinson.

.: 

* GNUmakefile.am: Include the GNUmakefile.am covering the libANGLE.la library.

Source/ThirdParty/ANGLE: 

* GNUmakefile.am: Added, sets up the libANGLE.la library.

Source/WebCore: 

No new tests - no change in functionality.

* GNUmakefile.list.am: Remove the ANGLE sources listing, it's now placed in the ANGLE-specific GNUmakefile.am.

Source/WebKit/gtk: 

* GNUmakefile.am: Add libLevelDB.la to the libwebkitgtk library if using the OpenGL accelerated backend.

Source/WebKit2: 

* GNUmakefile.am: Add libLevelDB.la to the libwebkit2gtk library if using the OpenGL accelerated backend.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Assertion in LegacyWebArchive::create() in editing tests
https://bugs.webkit.org/show_bug.cgi?id=112642

Reviewed by Simon Fraser.

Address Simon's review comment. Don't convert String to MIMEType just to convert it back to String.

* platform/mac/PasteboardMac.mm:
(WebCore::fragmentFromWebArchive):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146391 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Objective-C API: Fix over-releasing in allocateConstructorAndPrototypeWithSuperClassInfo:
https://bugs.webkit.org/show_bug.cgi?id=112832

Reviewed by Geoffrey Garen.

If either the m_constructor or m_prototype (but not both) is collected, we will call 
allocateConstructorAndPrototypeWithSuperClassInfo, which will create a new object to replace the one 
that was collected, but at the end of the method we call release on both of them. 
This is incorrect since we autorelease the JSValue in the case that the object doesn't need to be 
reallocated. Thus we'll end up overreleasing later during the drain of the autorelease pool.

* API/JSWrapperMap.mm:
(objectWithCustomBrand): We no longer alloc here. We instead call the JSValue valueWithValue class method,
which autoreleases for us.
(-[JSObjCClassInfo allocateConstructorAndPrototypeWithSuperClassInfo:]): We no longer call release on the 
constructor or prototype JSValues.
* API/tests/testapi.mm: Added a new test that crashes on ToT due to over-releasing.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in Document::setFocusedNode if the frame of new focused node is detached in 'change' event handler
https://bugs.webkit.org/show_bug.cgi?id=112653

Reviewed by Dimitri Glazkov.

Source/WebCore:

Test: fast/frames/detach-frame-during-focus.html

* page/FocusController.cpp:
(WebCore::FocusController::setFocusedNode):
A oldDocument->setFocusedNode call might dispatch a 'change' event for
an old focused node, and an event handler code might detach the
newFocusedFrame. So we should check it. Without the check, the following
newDocument->setFocusedNode call would crash because of null
Frame::page().

LayoutTests:

* fast/frames/detach-frame-during-focus-expected.txt: Added.
* fast/frames/detach-frame-during-focus.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146393 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r145592): AutodrainedPool.h. RunLoopTimer.h, SchedulePair.h are being copied into
the wrong location
https://bugs.webkit.org/show_bug.cgi?id=112833

Reviewed by Darin Adler.

Source/WebCore:

Fix an incorrect include path.

* loader/DocumentLoader.h:
RunLoopTimer.h lives in wtf as of r145592.

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
Make sure those three headers are copied with the rest of the WTF headers.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ARMv7 replaceWithJump ASSERT failure after r135330.
https://bugs.webkit.org/show_bug.cgi?id=103146

Reviewed by Filip Pizlo.

On Linux, the 24 bit distance range of jumps sometimes does not
enough to cover all targets addresses. This patch supports jumps
outside of this range using a mov/movt/bx 10 byte long sequence.

* assembler/ARMv7Assembler.h:
(ARMv7Assembler):
(JSC::ARMv7Assembler::revertJumpTo_movT3movtcmpT2):
(JSC::ARMv7Assembler::nopw):
(JSC::ARMv7Assembler::label):
(JSC::ARMv7Assembler::replaceWithJump):
(JSC::ARMv7Assembler::maxJumpReplacementSize):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::revertJumpReplacementToBranchPtrWithPatch):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146396 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac rebaseline after r140202.

* editing/input/caret-at-the-edge-of-contenteditable-expected.png:
* editing/input/reveal-caret-of-multiline-contenteditable-expected.png:
* editing/input/reveal-caret-of-multiline-input-expected.png:
* fast/spatial-navigation/snav-div-overflow-scrol-hidden-expected.txt:
* platform/mac/TestExpectations:
* platform/mac/editing/input/caret-at-the-edge-of-contenteditable-expected.txt:
* platform/mac/editing/input/reveal-caret-of-multiline-contenteditable-expected.txt:
* platform/mac/editing/input/reveal-caret-of-multiline-input-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] Build WebKit Tools under VS2010
https://bugs.webkit.org/show_bug.cgi?id=112821

Reviewed by Tim Horton.

* DumpRenderTree/DumpRenderTree.vcxproj/DumpRenderTree/DumpRenderTree.vcxproj:
Add WinCairo-specific build target.
* DumpRenderTree/DumpRenderTree.vcxproj/DumpRenderTree/DumpRenderTreeDebugWinCairo.props: Added.
* DumpRenderTree/DumpRenderTree.vcxproj/DumpRenderTree/DumpRenderTreeLauncher.vcxproj: Add WinCairo-specific build target.
* DumpRenderTree/DumpRenderTree.vcxproj/DumpRenderTree/DumpRenderTreeReleaseWinCairo.props: Added.
* DumpRenderTree/DumpRenderTree.vcxproj/DumpRenderTree/DumpRenderTreeWinCairo.props: Added.
* DumpRenderTree/DumpRenderTree.vcxproj/ImageDiff/ImageDiff.vcxproj:
Add WinCairo-specific build target.
* DumpRenderTree/DumpRenderTree.vcxproj/ImageDiff/ImageDiffLauncher.vcxproj:
* DumpRenderTree/DumpRenderTree.vcxproj/TestNetscapePlugin/TestNetscapePlugin.vcxproj:
Add WinCairo-specific build target.
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj: Add
WinCairo-specific build target.
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIDebugWinCairo.props: Added.
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPIReleaseWinCairo.props: Added.
* WinLauncher/WinLauncher.vcxproj/WinLauncher.vcxproj: Add WinCairo-
specific build target.
* WinLauncher/WinLauncher.vcxproj/WinLauncherLib.vcxproj: Add
WinCairo-specific build target.
* win/record-memory/record-memory.vcxproj: Add WinCairo target.
* win/record-memory/record-memoryDebugWinCairo.props: Added.
* win/record-memory/record-memoryReleaseWinCairo.props: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146398 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Correct coordinated scrolling for RTL iframe and overflow:scroll
https://bugs.webkit.org/show_bug.cgi?id=112088

Patch by Tien-Ren Chen <trchen@chromium.org> on 2013-03-20
Reviewed by James Robinson.

Source/WebCore:

This patch adds appropriate offset in ScrollingCoordinatorChromium to
adjust impl-side scroll position to the range [0, maxPos - minPos].

This also corrects RenderLayer to return correct scroll position for RTL,
explained below:

There are 2 commonly used scroll offset coordinate systems in WebCore.

1. The scroll offset is the amount that needs to be translated when painting
   child elements in a RenderBox. The value can be negative when there is
   negative overflow (for RTL). The range will be within
   [overflow_top_left_corner, overflow_bottom_right_corner - client_size].
   This system is mainly used for painting and layer positioning.

2. The scroll offset will be always non-negative, and the range will be within
   [0, content_size - client_size]. This system is mainly used for scrollbars.

scrollOrigin is defined to convert between the two systems. scrollOrigin is always
non-negative, and equivalent to -overflow_top_left_corner.

The first system is used for ScrollableArea::scrollPosition/minimumScrollPosition/
maximumScrollPosition function family. So is it implemented in ScrollView/Frameview.
RenderLayer errorneously implemented scrollPosition in the second system,
and worse, returned minimumScrollPosition/maximumScrollPosition were totally non-sense.
This patch corrects RenderLayer to use the first coordinate system.

Test: compositing/rtl/rtl-overflow-scrolling.html
      ScrollingCoordinatorChromiumTest.rtlIframe

* page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
(WebCore::ScrollingCoordinatorChromium::scrollableAreaScrollLayerDidChange):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollPosition):
(WebCore::RenderLayer::minimumScrollPosition):
(WebCore::RenderLayer::maximumScrollPosition):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):

Source/WebKit/chromium:

Added test to ensure RTL iframe has appropriate impl-side scroll position.

* tests/ScrollingCoordinatorChromiumTest.cpp:
(WebKit::TEST_F):
(WebKit):
* tests/data/rtl-iframe-inner.html: Added.
* tests/data/rtl-iframe.html: Added.

LayoutTests:

This patch corrects scrollOrigin compensation for composited overflow:scroll.

compositing/rtl/rtl-overflow-scrolling.html is added to verify RTL divs
can be correctly scrolled to the left under accelerated scrolling mode.

fast/css/sticky/inline-sticky-abspos-child.html is modified to avoid sub-pixel
issue with Ahem font.

* compositing/rtl/rtl-overflow-scrolling-expected.png: Added.
* compositing/rtl/rtl-overflow-scrolling-expected.txt: Added.
* compositing/rtl/rtl-overflow-scrolling.html: Added.
* fast/css/sticky/inline-sticky-abspos-child-expected.html:
* fast/css/sticky/inline-sticky-abspos-child.html:
* platform/chromium/TestExpectations:
* platform/mac/compositing/rtl/rtl-overflow-scrolling-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
"" + x where x is not a string should be optimized by the DFG to some manner of ToString conversion
https://bugs.webkit.org/show_bug.cgi?id=112845

Reviewed by Mark Hahnenberg.
        
I like to do "" + x. So I decided to make DFG recognize it, and related idioms.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupToPrimitive):
(FixupPhase):
(JSC::DFG::FixupPhase::fixupToString):
(JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::resultOfToPrimitive):
(DFG):
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGPredictionPropagationPhase.h:
(DFG):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146400 268f45cc-cd09-0410-ab3c-d52691b4dbfc
"" + x where x is not a string should be optimized by the DFG to some manner of ToString conversion
https://bugs.webkit.org/show_bug.cgi?id=112845

Reviewed by Mark Hahnenberg.

* fast/js/regress/empty-string-plus-int-expected.txt: Added.
* fast/js/regress/empty-string-plus-int.html: Added.
* fast/js/regress/script-tests/empty-string-plus-int.js: Added.
(foo):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146401 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Remove VIEW_MODE_CSS_MEDIA from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=112849

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-03-20
Reviewed by Sam Weinig.

Source/WebKit2: 

The code was added in r137148 for the sole purpose of testing,
and it is not even being properly tested.

Remove the code until someone actually implement the feature in WebKit2.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCanShowMIMEType):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
(WebPage):

Tools: 

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
* WebKitTestRunner/InjectedBundle/TestRunner.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac rebaseline after r139282.

* fast/repaint/caret-with-transformation-expected.png: Added.
* fast/repaint/caret-with-transformation-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac rebaseline after r140693.

* editing/selection/extend-by-sentence-001-expected.txt:
* platform/mac/TestExpectations:
* platform/mac/css2.1/t0505-c16-descendant-01-e-expected.png:
* platform/mac/css2.1/t0505-c16-descendant-01-e-expected.txt:
* platform/mac/editing/selection/extend-by-sentence-001-expected.png:
* platform/mac/fast/inline/drawStyledEmptyInlines-expected.txt:
* platform/mac/fast/inline/drawStyledEmptyInlinesWithWS-expected.png:
* platform/mac/fast/inline/drawStyledEmptyInlinesWithWS-expected.txt:
* platform/mac/fast/text/capitalize-empty-generated-string-expected.png:
* platform/mac/fast/text/capitalize-empty-generated-string-expected.txt:
* platform/mac/fast/text/whitespace/006-expected.png:
* platform/mac/fast/text/whitespace/006-expected.txt:
* platform/mac/fast/text/whitespace/007-expected.png:
* platform/mac/fast/text/whitespace/007-expected.txt:
* platform/mac/svg/batik/text/xmlSpace-expected.png:
* platform/mac/svg/batik/text/xmlSpace-expected.txt:
* platform/mac/svg/carto.net/combobox-expected.png:
* platform/mac/tables/mozilla/bugs/bug113235-3-expected.txt:
* platform/mac/tables/mozilla/bugs/bug1188-expected.png:
* platform/mac/tables/mozilla/bugs/bug1188-expected.txt:
* platform/mac/tables/mozilla/bugs/bug1318-expected.png:
* platform/mac/tables/mozilla/bugs/bug1318-expected.txt:
* svg/carto.net/combobox-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac rebaseline after r142152.

* platform/mac/TestExpectations:
* platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.png:
* platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146405 268f45cc-cd09-0410-ab3c-d52691b4dbfc
dialog-enabled.html and dialog-disabled.html don't really test what they think they do
https://bugs.webkit.org/show_bug.cgi?id=112848

Reviewed by Adam Barth.

* fast/dom/HTMLDialogElement/dialog-disabled.html:
* fast/dom/HTMLDialogElement/dialog-enabled.html:
Set the dialog element enabled setting before parsing <dialog> element.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146406 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix indentation of JSString.h

Rubber stamped by Mark Hahnenberg.

* runtime/JSString.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146407 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: [css3-text] Parsing -webkit-each-line value for text-indent from css3-text
https://bugs.webkit.org/show_bug.cgi?id=109021

Patch by Jaehun Lim <ljaehun.lim@samsung.com> on 2013-03-20
Reviewed by Julien Chaffraix.

"each-line" is added for text-indent in CSS3.
http://dev.w3.org/csswg/css3-text/#each-line

This patch is the parsing part to support each-line value for text-indent.

"each-line" means "Indentation affects the first line of the block
container as well as each line after a forced line break, but does
not affect lines after a soft wrap break."

It's prefixed and guarded by CSS3_TEXT flag.

Tests: fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent-inherited.html
       fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
    style.getPropertyCSSValue(text-indent) returns CSSPrimitiveValue when text-indent has only <length>
    or <percentage> value, but returns CSSValueList when text-indent also has -webkit-each-line.

* css/CSSParser.cpp:
(WebCore::isSimpleLengthPropertyID): Removed CSSPropertyTextIndent case.
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseTextIndent): Added.
* css/CSSParser.h:
    Parsed <length> or <percentage> with -webkit-each-line for text-indent.

* css/CSSValueKeywords.in: Added new -webkit-each-line keyword.
* css/StyleBuilder.cpp:
(ApplyPropertyTextIndent): Added.
(WebCore::ApplyPropertyTextIndent::applyInheritValue):
(WebCore::ApplyPropertyTextIndent::applyInitialValue):
(WebCore::ApplyPropertyTextIndent::applyValue):
(WebCore::ApplyPropertyTextIndent::createHandler):
(WebCore::StyleBuilder::StyleBuilder):
    Added codes to handle applying text-indent offset and -webkit-each-line option to our style.

* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::diff):
* rendering/style/RenderStyle.h:
* rendering/style/RenderStyleConstants.h: Added enum TextIndentLine.
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator==):
* rendering/style/StyleRareInheritedData.h: Added m_textIndentLine.
(StyleRareInheritedData):
    Added the usual getter / setter / initial methods for m_textIndentLine.

LayoutTests: [css3-text] Parsing -webkit-each-line value for text-indent from css3-text
https://bugs.webkit.org/show_bug.cgi?id=109021

"each-line" is added for text-indent in CSS3.
http://dev.w3.org/csswg/css3-text/#each-line

Patch by Jaehun Lim <ljaehun.lim@samsung.com> on 2013-03-20
Reviewed by Julien Chaffraix.

* fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent-expected.txt: Added.
* fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent-inherited-expected.txt: Added.
* fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent-inherited.html: Added.
* fast/css3-text/css3-text-indent/getComputedStyle/getComputedStyle-text-indent.html: Added.
* fast/css3-text/css3-text-indent/getComputedStyle/script-tests/getComputedStyle-text-indent-inherited.js: Added.
(testComputedStyle):
(ownValueTest):
(inheritanceTest):
* fast/css3-text/css3-text-indent/getComputedStyle/script-tests/getComputedStyle-text-indent.js: Added.
(testElementStyle):
(testComputedStyle):
(valueSettingTest):
(invalidValueSettingTest):
* platform/chromium/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt-mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146408 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Mac rebaseline after r144096.

* platform/mac/TestExpectations:
* platform/mac/css3/flexbox/button-expected.png: Copied from LayoutTests/css3/flexbox/button-expected.png.
* platform/mac/css3/flexbox/button-expected.txt: Copied from LayoutTests/css3/flexbox/button-expected.txt.
* platform/mac/svg/custom/foreign-object-skew-expected.png:


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