PrettyPatch: Wrap pre blocks
https://bugs.webkit.org/show_bug.cgi?id=119906

Reviewed by Darin Adler.

* PrettyPatch/PrettyPatch.rb:
<pre> will use the same wrap settings as the text class:
white-space: pre-wrap and word-wrap: break-word.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119912> Fix WebKit build error when SVG is disabled(broken since r154174)

Patch by Arunprasad Rajkumar <arurajku@cisco.com> on 2013-08-16
Reviewed by Simon Fraser.

No new tests required, just a build fix.

Since r154174 CSS keywords alpha and luminance used by -webkit-mask-source-type. Move those
keywords from SVGCSSValueKeywords.in to CSSValueKeywords.in.

* css/CSSValueKeywords.in:
* css/SVGCSSValueKeywords.in:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://bugs.webkit.org/show_bug.cgi?id=119913> Baseline JIT gives erroneous
error message that an object is not a constructor though it expects a function

Reviewed by Michael Saboff.

* jit/JITStubs.cpp:
(JSC::DEFINE_STUB_FUNCTION):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Update RenderMediaControls for new API
https://bugs.webkit.org/show_bug.cgi?id=119910

Reviewed by Eric Carlson.

* rendering/RenderMediaControls.cpp: Update calls to WebKitSystemInterface for
the changed API.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119915> REGRESSION(r154144): ASSERTION FAILED: m_history->provisionalItem() == m_requestedHistoryItem.get()

Add failing test expectations.

* platform/mac-wk2/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[JSC] x86: improve code generation for xxxTest32
https://bugs.webkit.org/show_bug.cgi?id=119876

Reviewed by Geoffrey Garen.

Try to use testb whenever possible when testing for an immediate value.

When the input is an address and an offset, we can tweak the mask
and offset to be able to generate testb for any byte of the mask.

When the input is a register, we can use testb if we are only interested
in testing the low bits.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::branchTest32):
(JSC::MacroAssemblerX86Common::test32):
(JSC::MacroAssemblerX86Common::generateTest32):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove a useless #include of SelectorChecker.h

Rubber-stamped by Ryosuke Niwa.

* dom/DocumentStyleSheetCollection.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119536> Refactor highestEditableRoot to avoid a redundant call to rendererIsEditable

Reviewed by Benjamin Poulain.

Refactor highestEditableRoot to avoid an extra tree walk. We now walk up the ancestor chain up to
the first root editable element exactly once.

* dom/Node.cpp:
(WebCore::Node::rendererIsEditable): Change the order of conditions to make the evaluation faster
when we don't have to check RenderStyle's value.
* editing/htmlediting.cpp:
(WebCore::highestEditableRoot):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unreviewed build fix after r154192

* WebCoreSupport/DumpRenderTreeSupportEfl.cpp:
(DumpRenderTreeSupportEfl::evaluateScriptInIsolatedWorld):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG optimizes out strict mode arguments tear off
https://bugs.webkit.org/show_bug.cgi?id=119504

Source/JavaScriptCore: 

Reviewed by Mark Hahnenberg and Oliver Hunt.
        
Don't do the optimization for strict mode.

* dfg/DFGArgumentsSimplificationPhase.cpp:
(JSC::DFG::ArgumentsSimplificationPhase::run):
(JSC::DFG::ArgumentsSimplificationPhase::pruneObviousArgumentCreations):

LayoutTests: 

Reviewed by Mark Hahnenberg and Oliver Hunt.

* fast/js/dfg-arguments-strict-mode-expected.txt: Added.
* fast/js/dfg-arguments-strict-mode.html: Added.
* fast/js/jsc-test-list:
* fast/js/script-tests/dfg-arguments-strict-mode.js: Added.
(f):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154217 268f45cc-cd09-0410-ab3c-d52691b4dbfc
DFG should optimize typedArray.byteLength
https://bugs.webkit.org/show_bug.cgi?id=119909

Source/JavaScriptCore: 

Reviewed by Oliver Hunt.
        
This adds typedArray.byteLength inlining to the DFG, and does so without changing
the IR: byteLength is turned into GetArrayLength followed by BitLShift. This is
legal since the byteLength of a typed array cannot exceed
numeric_limits<int32_t>::max().

* bytecode/SpeculatedType.cpp:
(JSC::typedArrayTypeFromSpeculation):
* bytecode/SpeculatedType.h:
* dfg/DFGArrayMode.cpp:
(JSC::DFG::toArrayType):
* dfg/DFGArrayMode.h:
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::attemptToMakeGetArrayLength):
(JSC::DFG::FixupPhase::attemptToMakeGetByteLength):
(JSC::DFG::FixupPhase::convertToGetArrayLength):
(JSC::DFG::FixupPhase::prependGetArrayLength):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::constantRegisterForConstant):
(JSC::DFG::Graph::convertToConstant):
* runtime/TypedArrayType.h:
(JSC::logElementSize):
(JSC::elementSize):

LayoutTests: 

Reviewed by Oliver Hunt.
        
Convert two of the tyepd array tests to use byteLength instead of length.
These tests show speed-ups around 2.5x-5x.

* fast/js/regress/Int16Array-bubble-sort-with-byteLength-expected.txt: Added.
* fast/js/regress/Int16Array-bubble-sort-with-byteLength.html: Added.
* fast/js/regress/Int8Array-load-with-byteLength-expected.txt: Added.
* fast/js/regress/Int8Array-load-with-byteLength.html: Added.
* fast/js/regress/script-tests/Int16Array-bubble-sort-with-byteLength.js: Added.
(bubbleSort):
(myRandom):
(validateSort):
* fast/js/regress/script-tests/Int8Array-load-with-byteLength.js: Added.
(adler32):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154218 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119903> Make Settings ref-counted (and let Frame keep a ref!)

Reviewed by Geoff Garen.

Let Frame hold a RefPtr<Settings> so Frame::settings() isn't forced to go through Page.
It now also returns a reference, as it can never be null.

Removed 8.8 million lines of null-checking as a result.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.

* platform/gtk/TestExpecations: Unskip fast/dom/gc-10.html, the test seems to work now.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154220 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119795> Propagate writing-mode from the first region to the flow thread

Patch by Morten Stenshorne <mstensho@opera.com> on 2013-08-17
Reviewed by Darin Adler.

Source/WebCore:

Since the flow thread is a direct child of RenderView, it doesn't inherit
proper writing-mode automatically. It should be mentioned that if the thread's
contents' writing-mode differs from that of the first region, things are
typically going to look useless (although perhaps that's how it should be),
but as long as writing-mode is only specified on a common parent of the
thread's contents and the regions, things look fine, and also, we're now
following what the spec has to say on the matter:

http://www.w3.org/TR/2013/WD-css3-regions-20130528/#the-flow-into-property

    "The first region defines the principal writing mode for the entire flow.
     The writing mode on subsequent regions is ignored."

This is a back-port of the fix for Blink bug 257965.
Reviewed by esprehn and mihnea there.
Blink review URL: https://chromiumcodereview.appspot.com/18374008

Tests: fast/regions/changing-writing-mode-2.html
       fast/regions/changing-writing-mode-3.html
       fast/regions/changing-writing-mode-4.html
       fast/regions/changing-writing-mode-5.html
       fast/regions/changing-writing-mode.html
       fast/regions/invalid-first-region-with-writing-mode-2.html
       fast/regions/invalid-first-region-with-writing-mode.html
       fast/regions/subtree-with-horiz-bt.html
       fast/regions/subtree-with-horiz-tb.html
       fast/regions/subtree-with-vert-lr.html
       fast/regions/subtree-with-vert-rl.html

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::styleDidChange):
* rendering/RenderFlowThread.h:
* rendering/RenderNamedFlowThread.cpp:
(WebCore::RenderNamedFlowThread::updateWritingMode):
(WebCore::RenderNamedFlowThread::addRegionToNamedFlowThread):
(WebCore::RenderNamedFlowThread::removeRegionFromThread):
(WebCore::RenderNamedFlowThread::regionChangedWritingMode):
* rendering/RenderNamedFlowThread.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::styleDidChange):

LayoutTests:

* fast/regions/changing-writing-mode-2-expected.html: Added.
* fast/regions/changing-writing-mode-2.html: Added.
* fast/regions/changing-writing-mode-3-expected.html: Added.
* fast/regions/changing-writing-mode-3.html: Added.
* fast/regions/changing-writing-mode-4-expected.html: Added.
* fast/regions/changing-writing-mode-4.html: Added.
* fast/regions/changing-writing-mode-5-expected.html: Added.
* fast/regions/changing-writing-mode-5.html: Added.
* fast/regions/changing-writing-mode-expected.html: Added.
* fast/regions/changing-writing-mode.html: Added.
* fast/regions/invalid-first-region-with-writing-mode-2-expected.html: Added.
* fast/regions/invalid-first-region-with-writing-mode-2.html: Added.
* fast/regions/invalid-first-region-with-writing-mode-expected.html: Added.
* fast/regions/invalid-first-region-with-writing-mode.html: Added.
* fast/regions/subtree-with-horiz-bt-expected.html: Added.
* fast/regions/subtree-with-horiz-bt.html: Added.
* fast/regions/subtree-with-horiz-tb-expected.html: Added.
* fast/regions/subtree-with-horiz-tb.html: Added.
* fast/regions/subtree-with-vert-lr-expected.html: Added.
* fast/regions/subtree-with-vert-lr.html: Added.
* fast/regions/subtree-with-vert-rl-expected.html: Added.
* fast/regions/subtree-with-vert-rl.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154221 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit2 fails to build with trunk clang: error: 'WebPluginSiteDataManagerh' is used as a header guard here, followed by #define of a different macro [-Werror,-Wheader-guard]
<http://webkit.org/b/119935>
<rdar://problem/14764131>

Reviewed by Darin Adler.

* UIProcess/Plugins/WebPluginSiteDataManager.h: Fix typo
introduced in r78647.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ANGLE fails to build with trunk clang: error: 'register' storage class specifier is deprecated [-Werror,-Wdeprecated-register]
<http://webkit.org/b/119931>
<rdar://problem/14763822>

Reviewed by Darin Adler.

* src/compiler/glslang.l:
* src/compiler/glslang_lex.cpp:
* src/compiler/preprocessor/Tokenizer.cpp:
* src/compiler/preprocessor/Tokenizer.l:
Add pragma statements to ignore -Wdeprecated-register warnings
in generated code.  Also ignore -Wunknown-pragmas so this
doesn't cause a build failure in older versions of clang.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119941> Make Page::dragController return a reference

Reviewed by Andreas Kling.

Source/WebCore:

* page/Page.h:
(WebCore::Page::dragController): Return a reference instead of a pointer.

* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::eventMayStartDrag):
(WebCore::EventHandler::updateDragSourceActionsAllowed):
(WebCore::EventHandler::handleDrag):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::passSubframeEventToSubframe):
Updated call sites.

Source/WebKit/gtk:

* webkit/webkitwebview.cpp:
(dragExitedCallback):
(webkit_web_view_drag_motion):
(webkit_web_view_drag_data_received):
(webkit_web_view_drag_drop):
Updated call sites.

Source/WebKit/mac:

* WebView/WebFrameView.mm:
(-[WebFrameView _setDocumentView:]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView draggingSourceOperationMaskForLocal:]):
(-[WebHTMLView namesOfPromisedFilesDroppedAtDestination:]):
* WebView/WebView.mm:
(-[WebView _setInitiatedDrag:]):
(-[WebView draggingEntered:]):
(-[WebView draggingUpdated:]):
(-[WebView draggingExited:]):
(-[WebView performDragOperation:]):
(-[WebView moveDragCaretToPoint:]):
(-[WebView removeDragCaret]):
Updated call sites.

Source/WebKit/qt:

* WebCoreSupport/DragClientQt.cpp:
(WebCore::DragClientQt::startDrag):
* WebCoreSupport/QWebPageAdapter.cpp:
(QWebPageAdapter::dragEntered):
(QWebPageAdapter::dragLeaveEvent):
(QWebPageAdapter::dragUpdated):
(QWebPageAdapter::performDrag):
Updated call sites.

Source/WebKit/win:

* WebCoreSupport/WebDragClient.cpp:
(WebDragClient::startDrag):
* WebView.cpp:
(WebView::keyStateToDragOperation):
(WebView::DragEnter):
(WebView::DragOver):
(WebView::DragLeave):
(WebView::Drop):
Updated call sites.

Source/WebKit2:

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::performDragControllerAction):
(WebKit::WebPage::dragEnded):
Updated call sites.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154224 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119942> Remove unnecessary uses of Element::ownerDocument

Reviewed by Andreas Kling.

The Element::document is a simpler faster alternative to Element::ownerDocument.
The only behavior difference between the two is that ownerDocument returns 0 when
called on a Document.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::supportsFocus): Call document instead of ownerDocument.
(WebCore::HTMLMediaElement::mediaPlayerOwningDocument): Removed null checking of
document and call to ownerDocument, since ownerDocument will never return non-null
if document returns null.
(WebCore::HTMLMediaElement::mediaPlayerSawUnsupportedTracks): Call document instead
of ownerDocument.

* inspector/DOMEditor.cpp:
(WebCore::DOMEditor::SetOuterHTMLAction::perform): Call document instead of ownerDocument.

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getMatchedStylesForNode): Call document instead of ownerDocument.
(WebCore::InspectorCSSAgent::forcePseudoState): Call document instead of ownerDocument.
(WebCore::InspectorCSSAgent::resetPseudoStates): Call document instead of ownerDocument.

* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setOuterHTML): Call document instead of expression that
does the same thing in a roundabout way.
(WebCore::InspectorDOMAgent::focusNode): Call document instead of ownerDocument.
(WebCore::InspectorDOMAgent::resolveNode): Call document instead of expression that
does the same thing in a roundabout way.

* page/DragController.cpp:
(WebCore::DragController::concludeEditDrag): Call document instead of ownerDocument.

* svg/SVGElementInstance.cpp:
(WebCore::SVGElementInstance::ownerDocument): Call document instead of ownerDocument.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154225 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119940> Rename Clipboard::m_dragLoc to m_dragLocation

Reviewed by Andreas Kling.

* dom/Clipboard.h: Removed unused dragLocation member function.
Renamed m_dragLoc to m_dragLocation.

* dom/Clipboard.cpp:
(WebCore::Clipboard::setDragImage):
* platform/gtk/ClipboardGtk.cpp:
(WebCore::Clipboard::createDragImage):
* platform/mac/ClipboardMac.mm:
(WebCore::Clipboard::createDragImage):
* platform/qt/ClipboardQt.cpp:
(WebCore::Clipboard::createDragImage):
* platform/win/ClipboardWin.cpp:
(WebCore::Clipboard::createDragImage):
Updated for new name.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154226 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119939> Remove some unused clipboard and pasteboard code

Reviewed by Andreas Kling.

* PlatformWinCE.cmake: Removed EditorWin.cpp.
* WebCore.vcxproj/WebCore.vcxproj: Removed EditorWin.cpp.
* WebCore.vcxproj/WebCore.vcxproj.filters: Removed EditorWin.cpp.
* WebCore.xcodeproj/project.pbxproj: Removed ClipboardIOS.h and
ClipboardIOS.mm, and also let Xcode edit/reorder this file.

* editing/Editor.cpp:
(WebCore::Editor::dispatchCPPEvent): Removed some LEGACY_STYLE_ABSTRACT_CLIPBOARD
class code. Will remove the rest later.

* editing/Editor.h: Removed declaration of newGeneralClipboard.

* platform/Pasteboard.h: Removed declaration of writeClipboard. Also updated a
comment to make it clearer.

* platform/blackberry/PasteboardBlackBerry.cpp: Removed Pasteboard::writeClipboard.
* platform/efl/PasteboardEfl.cpp: Ditto.
* platform/ios/PasteboardIOS.mm: Ditto.
* platform/win/PasteboardWin.cpp: Ditto.

* platform/ios/ClipboardIOS.h: Removed. Was an empty file.
* platform/ios/ClipboardIOS.mm: Removed. Was an empty file.
* platform/win/EditorWin.cpp: Removed. Had only newGeneralClipboard in the file,
a function that is never called.


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