Crash in ScrollingStateStickyNode::updateConstraints
https://bugs.webkit.org/show_bug.cgi?id=119638

Reviewed by Simon Fraser.

Ensure when a scrolling state node is removed from the state tree,
we remove both the current node and all its children from the
associated m_stateNodeMap lookup table.

Source/WebCore:

Test: fast/css/sticky/multiple-layers-sticky-crash.html

* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::removeChild):
(WebCore::ScrollingStateNode::willBeRemovedFromStateTree):
* page/scrolling/ScrollingStateNode.h:

LayoutTests:

* fast/css/sticky/multiple-layers-sticky-crash-expected.txt: Added.
* fast/css/sticky/multiple-layers-sticky-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
XMLSerializer.serializeToString() should throw exception for invalid node value.
https://bugs.webkit.org/show_bug.cgi?id=121209

Reviewed by Darin Adler.

Source/WebCore:

FF and Opera 12 (pre blink/webkit) throw exception in case the node value is invalid.
Blink sends an empty string as the result of serializeToString operation with invalid node.
We should match with other browsers for throwing it as an exception.

Blink review URL: https://chromiumcodereview.appspot.com/23532055/

Test: fast/dom/xmlserializer-serialize-to-string-exception.html

* xml/XMLSerializer.cpp:
(WebCore::XMLSerializer::serializeToString):

LayoutTests:

* fast/dom/xmlserializer-serialize-to-string-exception-expected.txt: Added.
* fast/dom/xmlserializer-serialize-to-string-exception.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add jhbuild-wayland.modules
https://bugs.webkit.org/show_bug.cgi?id=120455

Reviewed by Gustavo Noronha Silva.

Current versions of gtk+, gdk-pixbuf and glib don't fit the requirement for wayland support.
With this patch, you can build extra gtk+, gdk-pixbuf and glib through jhbuild with exporting
WEBKIT_EXTRA_MODULESETS.

* gtk/jhbuild-wayland.modules: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155610 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Rebase after r155253.

Patch by Gabor Abraham <abrhm@inf.u-szeged.hu> on 2013-09-12

* platform/qt-wk2/editing/style/style-boundary-005-expected.png: Added.
* platform/qt/editing/pasteboard/4989774-expected.png:
* platform/qt/editing/pasteboard/4989774-expected.txt:
* platform/qt/editing/pasteboard/paste-match-style-001-expected.png:
* platform/qt/editing/pasteboard/paste-match-style-001-expected.txt:
* platform/qt/editing/selection/caret-ltr-2-expected.png:
* platform/qt/editing/selection/caret-ltr-2-expected.txt:
* platform/qt/editing/selection/caret-ltr-2-left-expected.png:
* platform/qt/editing/selection/caret-ltr-2-left-expected.txt:
* platform/qt/editing/selection/caret-ltr-expected.png:
* platform/qt/editing/selection/caret-ltr-expected.txt:
* platform/qt/editing/selection/caret-ltr-right-expected.png:
* platform/qt/editing/selection/caret-ltr-right-expected.txt:
* platform/qt/editing/selection/caret-rtl-2-expected.png:
* platform/qt/editing/selection/caret-rtl-2-expected.txt:
* platform/qt/editing/selection/caret-rtl-2-left-expected.png:
* platform/qt/editing/selection/caret-rtl-2-left-expected.txt:
* platform/qt/editing/selection/caret-rtl-expected.png:
* platform/qt/editing/selection/caret-rtl-expected.txt:
* platform/qt/editing/selection/caret-rtl-right-expected.png:
* platform/qt/editing/selection/caret-rtl-right-expected.txt:
* platform/qt/editing/selection/vertical-rl-ltr-extend-line-backward-wrap-expected.png:
* platform/qt/editing/selection/vertical-rl-ltr-extend-line-backward-wrap-expected.txt:
* platform/qt/editing/selection/vertical-rl-ltr-extend-line-forward-wrap-expected.png:
* platform/qt/editing/selection/vertical-rl-ltr-extend-line-forward-wrap-expected.txt:
* platform/qt/editing/style/style-boundary-005-expected.png:
* platform/qt/editing/style/style-boundary-005-expected.txt:
* platform/qt/fast/forms/formmove3-expected.txt:
* platform/qt/fast/forms/input-align-image-expected.png:
* platform/qt/fast/forms/input-align-image-expected.txt:
* platform/qt/fast/forms/preserveFormDuringResidualStyle-expected.png:
* platform/qt/fast/forms/preserveFormDuringResidualStyle-expected.txt:
* platform/qt/fast/invalid/003-expected.png:
* platform/qt/fast/invalid/003-expected.txt:
* platform/qt/tables/mozilla/bugs/bug647-expected.png:
* platform/qt/tables/mozilla/bugs/bug647-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Moving myself to the commiters list.

* Scripts/webkitpy/common/config/contributors.json:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add back c++11 features removed by buildfixes after all ports did the switch
https://bugs.webkit.org/show_bug.cgi?id=119266

Reviewed by Anders Carlsson.

* bytecode/GetByIdStatus.h:
(JSC::GetByIdStatus::GetByIdStatus):
* dfg/DFGWorklist.cpp:
(JSC::DFG::Worklist::~Worklist):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::codeType):
(JSC::StackVisitor::Frame::functionName):
(JSC::StackVisitor::Frame::sourceURL):
(JSC::StackVisitor::Frame::print):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Auto GDB backtrace generation for EFL/GTK/Qt bots.
https://bugs.webkit.org/show_bug.cgi?id=119338

Patch by Gabor Abraham <abrhm@inf.u-szeged.hu> on 2013-09-12
Reviewed by Csaba Osztrogonác.

* Scripts/webkitpy/port/efl.py:
(EflPort.check_sys_deps):
(EflPort):
(EflPort._get_crash_log):
* Scripts/webkitpy/port/efl_unittest.py:
(EflPortTest.test_show_results_html_file):
(EflPortTest):
(EflPortTest.test_get_crash_log):
* Scripts/webkitpy/port/gtk.py:
(GtkPort._get_crash_log):
* Scripts/webkitpy/port/gtk_unittest.py:
(GtkPortTest.test_get_crash_log):
* Scripts/webkitpy/port/linux_get_crash_log.py: Added.
(GDBCrashLogGenerator):
(GDBCrashLogGenerator.__init__):
(GDBCrashLogGenerator._get_gdb_output):
(GDBCrashLogGenerator.generate_crash_log):
(GDBCrashLogGenerator.generate_crash_log.match_filename):
* Scripts/webkitpy/port/linux_get_crash_log_unittest.py: Added.
(GDBCrashLogGeneratorTest):
(GDBCrashLogGeneratorTest.test_generate_crash_log):
(_mock_gdb_output):
* Scripts/webkitpy/port/qt.py:
(QtPort.default_child_processes):
(QtPort):
(QtPort._get_crash_log):
* Scripts/webkitpy/port/qt_unittest.py:
(QtPortTest.test_check_sys_deps):
(QtPortTest):
(QtPortTest.test_get_crash_log):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: Inline PDF that are cached fail to appear in iframe.
https://bugs.webkit.org/show_bug.cgi?id=75449

Reviewed by Darin Adler.

Make sure 'frame is from page cache' flag is set for subframes too.

WebFrameLoaderClient::m_frameCameFromPageCache == true forces plugins
to be loaded manually. It ensures that the plugin raw data is fetched again
while the containing frame is being restored from the page cache.
(Plugins get destroyed when the frame goes to page cache.)

Source/WebKit2:

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame):
This gets called only on the frame where the actual history navigation happens.
(WebKit::WebFrameLoaderClient::didRestoreFromPageCache):
This gets called for all the restored frames.

LayoutTests:

* fast/history/history-back-while-pdf-in-pagecache-expected.html: Added.
* fast/history/history-back-while-pdf-in-pagecache.html: Added.
* fast/history/resources/history-back-for-pfd-test.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] Compile errors, missing include.
https://bugs.webkit.org/show_bug.cgi?id=121222

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-09-12
Reviewed by Brent Fulgham.

* platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp: Include required header.
* platform/win/DragImageCairoWin.cpp: Include required header.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] TestWebKitAPI fails to link.
https://bugs.webkit.org/show_bug.cgi?id=121223

Patch by peavo@outlook.com <peavo@outlook.com> on 2013-09-12
Reviewed by Brent Fulgham.

* WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in: Add required symbol.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155617 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Changed expected results after turning on WTF_USE_TILED_BACKING_STORE (r133898)
https://bugs.webkit.org/show_bug.cgi?id=121227

Unreviewed EFL gardening.

Patch by Krzysztof Wolanski <k.wolanski@samsung.com> on 2013-09-12

* platform/efl/TestExpectations:
* platform/efl/editing/selection/caret-ltr-2-expected.png:
* platform/efl/editing/selection/caret-ltr-2-expected.txt:
* platform/efl/editing/selection/caret-ltr-2-left-expected.png:
* platform/efl/editing/selection/caret-ltr-2-left-expected.txt:
* platform/efl/editing/selection/caret-ltr-expected.png:
* platform/efl/editing/selection/caret-ltr-expected.txt:
* platform/efl/editing/selection/caret-rtl-2-expected.png:
* platform/efl/editing/selection/caret-rtl-2-expected.txt:
* platform/efl/editing/selection/caret-rtl-expected.png:
* platform/efl/editing/selection/caret-rtl-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK][WK1] Block accelerated compositing under non-X11 displays
https://bugs.webkit.org/show_bug.cgi?id=121165

Reviewed by Martin Robinson.

This is analogous to the changes in r154728 and r154729 that enforce disabling accelerated compositing
under Wayland displays and made the RedirectedXCompositeWindow use in WebKit2 limited only to the X11 displays.

* WebCoreSupport/AcceleratedCompositingContextGL.cpp: Remove two unnecessary header includes that also
introduce symbols that conflict with the symbols defined in the X headers. Include the <gdk/gdkx.h> header
if the GTK+ dependency can provide it.
(WebKit::AcceleratedCompositingContext::initialize): Only set up the RedirectedXCompositeWindow instance
if running under an X11 display.
(WebKit::AcceleratedCompositingContext::renderLayersToWindow): The removal of the unnecessary header
inclusions also removed the std::max() injection into the global scope. Using std::max directly instead.
(WebKit::AcceleratedCompositingContext::scheduleLayerFlush): Ditto.
* webkit/webkitwebview.cpp:
(updateAcceleratedCompositingSetting): A helper function that ensures the accelerated compositing feature
stays disabled under Wayland displays. It also prints out a warning message the first time the user tries
to enable accelerated compositing under Wayland displays, telling that the feature is not supported and
will remain disabled.
(webkit_web_view_update_settings): Call updateAcceleratedCompositingSetting() to enable the feature if possible.
(webkit_web_view_settings_notify): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155619 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add rudimentary support for move-only types as values in HashMap
https://bugs.webkit.org/show_bug.cgi?id=121226

Reviewed by Andreas Kling.

Source/WTF:

* wtf/HashMap.h:
Change a bunch of functions to so they can take both rvalue and lvalue references and use std::forward.

* wtf/HashTraits.h:
(WTF::KeyValuePair::KeyValuePair):
Change constructors to accept both lvalues and rvalues.

Tools:

* TestWebKitAPI/Tests/WTF/HashMap.cpp:
(TestWebKitAPI::TEST):
Add a HashMap<unsigned, MoveOnly> test.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Change debug hooks to pass sourceID and position info via the DebuggerCallFrame.
https://bugs.webkit.org/show_bug.cgi?id=121214.

Reviewed by Geoffrey Garen.

Source/JavaScriptCore: 

* debugger/Debugger.h:
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::sourceId):
(JSC::DebuggerCallFrame::clear):
* debugger/DebuggerCallFrame.h:
(JSC::DebuggerCallFrame::DebuggerCallFrame):
(JSC::DebuggerCallFrame::line):
(JSC::DebuggerCallFrame::column):
* interpreter/Interpreter.cpp:
(JSC::unwindCallFrame):
(JSC::Interpreter::unwind):
(JSC::Interpreter::debug):

Source/WebCore: 

No new tests.

Also changed the Inspector's JavaScriptCallFrame to get the sourceID and
position info from its DebuggerCallFrame instead of caching those values.

* bindings/js/JavaScriptCallFrame.cpp:
(WebCore::JavaScriptCallFrame::JavaScriptCallFrame):
* bindings/js/JavaScriptCallFrame.h:
(WebCore::JavaScriptCallFrame::create):
(WebCore::JavaScriptCallFrame::invalidate):
(WebCore::JavaScriptCallFrame::sourceID):
(WebCore::JavaScriptCallFrame::position):
(WebCore::JavaScriptCallFrame::line):
(WebCore::JavaScriptCallFrame::column):
(WebCore::JavaScriptCallFrame::update):
* bindings/js/ScriptDebugServer.cpp:
(WebCore::ScriptDebugServer::createCallFrame):
(WebCore::ScriptDebugServer::updateCallFrameAndPauseIfNeeded):
(WebCore::ScriptDebugServer::callEvent):
(WebCore::ScriptDebugServer::atStatement):
(WebCore::ScriptDebugServer::returnEvent):
(WebCore::ScriptDebugServer::exception):
(WebCore::ScriptDebugServer::willExecuteProgram):
(WebCore::ScriptDebugServer::didExecuteProgram):
(WebCore::ScriptDebugServer::didReachBreakpoint):
* bindings/js/ScriptDebugServer.h:
* bindings/js/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::willExecuteProgram):
* bindings/js/WorkerScriptDebugServer.h:

Source/WebKit/mac: 

* webview/WebScriptDebugger.h:
* WebView/WebScriptDebugger.mm:
(WebScriptDebugger::WebScriptDebugger):
(WebScriptDebugger::callEvent):
(WebScriptDebugger::atStatement):
(WebScriptDebugger::returnEvent):
(WebScriptDebugger::exception):
(WebScriptDebugger::willExecuteProgram):
(WebScriptDebugger::didExecuteProgram):
(WebScriptDebugger::didReachBreakpoint):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Coordinated Graphics] Fix the build on MacOS 10.9
https://bugs.webkit.org/show_bug.cgi?id=121225

Reviewed by Darin Adler.

* platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSS Unit vw in border-width maps to 0px.
https://bugs.webkit.org/show_bug.cgi?id=109229

Patch by Gurpreet Kaur <k.gurpreet@samsung.com> on 2013-09-12
Reviewed by Darin Adler.

Source/WebCore:

Border and outline properties were not applied incase
its values were given in vh/vw units.

Tests: fast/css/viewport-height-border.html
       fast/css/viewport-height-outline.html
       fast/css/viewport-width-border.html
       fast/css/viewport-width-outline.html

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::computeLengthDouble):
Added case CSS_VH and CSS_VW.
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isViewportPercentageWidth):
(WebCore::CSSPrimitiveValue::isViewportPercentageHeight):
Added APIs to check the unit type(CSS_VW and CSS_VH).
* css/DeprecatedStyleBuilder.cpp:
(WebCore::ApplyPropertyComputeLength::applyValue):
Calculating the border values which has been specified
in vh/vw units.The vh/vw units are calcultated as percent
of viewport height and viewport width respectively.

LayoutTests:

* fast/css/viewport-height-border-expected.txt: Added.
* fast/css/viewport-height-border.html: Added.
* fast/css/viewport-height-outline-expected.txt: Added.
* fast/css/viewport-height-outline.html: Added.
* fast/css/viewport-width-border-expected.txt: Added.
* fast/css/viewport-width-border.html: Added.
* fast/css/viewport-width-outline-expected.txt: Added.
* fast/css/viewport-width-outline.html: Added.
Added new tests for verifying that border and outline properties are
applied when its values are given in vh/vw units.
* resources/js-test-pre.js:
(shouldNotBeEqualToString):
Added this API so that can compare two strings.Similiar to
shouldBeEqualToString.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move layering-violating code from Pasteboard::plainText into Editor (Mac only at first)
https://bugs.webkit.org/show_bug.cgi?id=121075

Reviewed by Anders Carlsson.

* editing/Editor.cpp:
(WebCore::Editor::pasteAsPlainTextBypassingDHTML): Pass pasteboard as a reference.
(WebCore::Editor::pasteAsPlainTextWithPasteboard): Use readPlainTextFromPasteboard
for Mac. Also update to take a reference.
(WebCore::Editor::paste): Pass pasteboard as a reference.
(WebCore::Editor::pasteAsPlainText): Ditto.
* editing/Editor.h: Ditto.

* editing/mac/EditorMac.mm:
(WebCore::Editor::readSelectionFromPasteboard): Pass pasteboard as a reference.
(WebCore::Editor::readPlainTextFromPasteboard): Added. The declaration of this
was added (by mistake) in an earlier patch. This has code that used to be inside
Pasteboard::plainText.

* platform/Pasteboard.h: Added PasteboardPlainText. Reorganized functions in the
Pasteboard class and added some FIXMEs. Sorted platforms alphabetically and grouped
functions together and data members separate from them.

* platform/mac/DragDataMac.mm:
(WebCore::DragData::asPlainText): Updated to call readPlainTextFromPasteboard.
(WebCore::DragData::asURL): Tweaked style of unused parameter.

* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read): Renamed this from plainText, and refactored so that
the data goes out in the PasteboardPlainText structure.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Turn shape's logicalwidth/height into a LayoutSize
https://bugs.webkit.org/show_bug.cgi?id=121187

Reviewed by David Hyatt.

No new tests, no behavior change.

* rendering/shapes/ShapeInfo.cpp:
(WebCore::::computedShape):
* rendering/shapes/ShapeInfo.h:
(WebCore::ShapeInfo::setShapeSize):
(WebCore::ShapeInfo::shapeContainingBlockHeight):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Shapes] Remove unnecessarily complex template from ShapeInfo classes
https://bugs.webkit.org/show_bug.cgi?id=121213

Reviewed by Darin Adler.

These classes were trying to be way too clever, and as a result were
hard to read and hard to debug. Replace the complex templated method
calls with virtual methods to make these classes much easier to
understand and maintain.

No new tests, no behavior change.

* rendering/shapes/ShapeInfo.cpp:
(WebCore::::computedShape):
(WebCore::::computeSegmentsForLine):
* rendering/shapes/ShapeInfo.h:
* rendering/shapes/ShapeInsideInfo.cpp:
(WebCore::ShapeInsideInfo::getShapeValue):
* rendering/shapes/ShapeInsideInfo.h:
(WebCore::ShapeInsideInfo::computeSegmentsForLine):
(WebCore::ShapeInsideInfo::ShapeInsideInfo):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::computeSegmentsForLine):
(WebCore::ShapeOutsideInfo::getShapeValue):
* rendering/shapes/ShapeOutsideInfo.h:
(WebCore::ShapeOutsideInfo::ShapeOutsideInfo):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move LineInfo class into LineInfo.h
https://bugs.webkit.org/show_bug.cgi?id=121191

Reviewed by David Hyatt.

No new tests, no behavior change.

* GNUmakefile.list.am:
* Target.pri:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
* rendering/LineInfo.h: Added.
(WebCore::LineInfo::LineInfo):
(WebCore::LineInfo::isFirstLine):
(WebCore::LineInfo::isLastLine):
(WebCore::LineInfo::isEmpty):
(WebCore::LineInfo::previousLineBrokeCleanly):
(WebCore::LineInfo::floatPaginationStrut):
(WebCore::LineInfo::runsFromLeadingWhitespace):
(WebCore::LineInfo::resetRunsFromLeadingWhitespace):
(WebCore::LineInfo::incrementRunsFromLeadingWhitespace):
(WebCore::LineInfo::setFirstLine):
(WebCore::LineInfo::setLastLine):
(WebCore::LineInfo::setEmpty):
(WebCore::LineInfo::setPreviousLineBrokeCleanly):
(WebCore::LineInfo::setFloatPaginationStrut):
* rendering/RenderBlockLineLayout.cpp:


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