[iOS] Fix the build following <http://trac.webkit.org/changeset/154903>
(https://bugs.webkit.org/show_bug.cgi?id=120540)

* style/StyleResolveTree.cpp:
(WebCore::Style::resolveTree): Use address operator and dot-notation when
passing Element to CheckForVisibilityChangeOnRecalcStyle and calling
Element::renderStyle(), respectively.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155052 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderSVGResource shouldn't trigger relayout during render tree teardown.
<https://webkit.org/b/120689>
<rdar://problem/14908967>

Reviewed by Antti Koivisto.

The new assertion in FrameView::scheduleRelayoutOfSubtree() caught a fish!
We were doing some unnecessary relayout scheduling while tearing down SVG
resource renderers.

* rendering/svg/RenderSVGResource.cpp:
(WebCore::RenderSVGResource::markForLayoutAndParentResourceInvalidation):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155055 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERT in MarkedAllocator::allocateSlowCase is wrong
https://bugs.webkit.org/show_bug.cgi?id=120639

Reviewed by Oliver Hunt.

ASSERT(!m_heap->shouldCollect()) is no longer true due to our use of the GC
deferral mechanism. We could technically be beyond our byte allocation limit,
but still not try to collect due to deferral. This patch amends shouldCollect()
to return false if GC is currently deferred.

* heap/Heap.h:
(JSC::Heap::shouldCollect):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155056 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get MEDIA_STREAM compiling on OSX
https://bugs.webkit.org/show_bug.cgi?id=120650

Reviewed by Darin Adler.

No new tests, the code changed doesn't run on OSX yet.

* DerivedSources.make: Add MediaStream idl files.

* Modules/mediastream/LocalMediaStream.h: Mark class as FINAL.

* Modules/mediastream/MediaConstraintsImpl.cpp:
(WebCore::MediaConstraintsImpl::getOptionalConstraints): append -> appendRange so we don't
    need a MediaConstraint copy constructor.

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::send): Remove an unused parameter name.
* Modules/mediastream/RTCDataChannel.h: ArrayBuffer and ArrayBufferView are in the JSC namespace.

* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::RTCPeerConnection): loader() doesn't return a pointer.
(WebCore::RTCPeerConnection::localDescription): Set the ExceptionCode on error.
(WebCore::RTCPeerConnection::remoteDescription): Ditto.

* Modules/mediastream/RTCSessionDescription.cpp:
(WebCore::RTCSessionDescription::setSdp): Remove the unused ExceptionCode parameter.
* Modules/mediastream/RTCSessionDescription.h: Ditto.
* Modules/mediastream/RTCSessionDescription.idl: Ditto.

* Modules/mediastream/RTCStatsResponse.cpp:
(WebCore::RTCStatsResponse::canGetItemsForName): Add so JSRTCStatsResponse::canGetItemsForName
    doesn't cause ref count churn.
* Modules/mediastream/RTCStatsResponse.h: Mark class as FINAL. Declare canGetItemsForName.

* WebCore.xcodeproj/project.pbxproj: Add new files.

* bindings/js/JSRTCStatsResponseCustom.cpp:
(WebCore::JSRTCStatsResponse::canGetItemsForName): Use canGetItemsForName instead of namedItem.
    Use propertyNameToAtomicString instead of propertyNameToString 
(WebCore::JSRTCStatsResponse::nameGetter): Use propertyNameToAtomicString instead of 
    propertyNameToString because namedItem takes an AtomicString.

* platform/mediastream/mac: Added.
* platform/mediastream/mac/MediaStreamCenterMac.cpp: Added.
* platform/mediastream/mac/MediaStreamCenterMac.h: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155057 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119622> [CSSRegions] Not possible to clear the selection when mixing content from different FlowThreads

Patch by Javier Fernandez <jfernandez@igalia.com> on 2013-09-04
Reviewed by David Hyatt.

Source/WebCore:

When using CSS Regions is usual that the RenderTree doesn't match
the DOM Tree in terms of relative position of the nodes. Besides,
usually the content of a certain node is split and spread across
multiple blocks, rendered in different positions.

Regarding the Selection, this problem is even more important; the
selection direction changes when crossing the FlowThread
boundaries. This weird behavior is also present in other layouts
using non-regular positioning mechanisms, like absolute,
static. However, for those layouts the RenderTree preserves the
order of the nodes, unlike the CSS Regions layout model.

Because of how the RenderTree is generated with CSS Regions, the
RenderView::setSelection algorithm is not able to repaint some of
the rectangles defined during the selection process. In order to
face this issue, the proposed fix determines whether it should
backwards traversing the RenderTree, from the "stop" node to the
RenderView node.

Test: fast/regions/selecting-text-through-different-region-flows-2.html

* rendering/RenderView.cpp:
(WebCore::getNextOrPrevRenderObjectBasedOnDirection): Added.
(WebCore::RenderView::setSelection):

LayoutTests:

* fast/regions/selecting-text-through-different-region-flows-2-expected.html: Added.
* fast/regions/selecting-text-through-different-region-flows-2.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155058 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: aria-valuetext property not exposing AXValueDescription
https://bugs.webkit.org/show_bug.cgi?id=120375

Reviewed by Darin Adler.

Source/WebCore: 

Expose value based attributes for incrementor roles (which are called spinbuttons by ARIA).

Test: platform/mac/accessibility/spinbutton-valuedescription.html

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):

LayoutTests: 

* platform/mac/accessibility/spinbutton-valuedescription-expected.txt: Added.
* platform/mac/accessibility/spinbutton-valuedescription.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155059 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Rename customCssText -> customCSSText to match WebKit style
https://bugs.webkit.org/show_bug.cgi?id=120694

Reviewed by Simon Fraser.

No new tests, just a rename.

* WebCore.order:
* css/CSSAspectRatioValue.cpp:
(WebCore::CSSAspectRatioValue::customCSSText):
* css/CSSAspectRatioValue.h:
* css/CSSBorderImageSliceValue.cpp:
(WebCore::CSSBorderImageSliceValue::customCSSText):
* css/CSSBorderImageSliceValue.h:
* css/CSSCalculationValue.cpp:
(WebCore::CSSCalcValue::customCSSText):
(WebCore::CSSCalcPrimitiveValue::customCSSText):
(WebCore::CSSCalcBinaryOperation::customCSSText):
* css/CSSCalculationValue.h:
* css/CSSCanvasValue.cpp:
(WebCore::CSSCanvasValue::customCSSText):
* css/CSSCanvasValue.h:
* css/CSSCrossfadeValue.cpp:
(WebCore::CSSCrossfadeValue::customCSSText):
* css/CSSCrossfadeValue.h:
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::customCSSText):
* css/CSSCursorImageValue.h:
* css/CSSFilterImageValue.cpp:
(WebCore::CSSFilterImageValue::customCSSText):
* css/CSSFilterImageValue.h:
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::customCSSText):
* css/CSSFontFaceSrcValue.h:
* css/CSSFunctionValue.cpp:
(WebCore::CSSFunctionValue::customCSSText):
* css/CSSFunctionValue.h:
* css/CSSGradientValue.cpp:
(WebCore::CSSLinearGradientValue::customCSSText):
(WebCore::CSSRadialGradientValue::customCSSText):
* css/CSSGradientValue.h:
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::customCSSText):
* css/CSSImageSetValue.h:
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::customCSSText):
* css/CSSImageValue.h:
* css/CSSInheritedValue.cpp:
(WebCore::CSSInheritedValue::customCSSText):
* css/CSSInheritedValue.h:
* css/CSSInitialValue.cpp:
(WebCore::CSSInitialValue::customCSSText):
* css/CSSInitialValue.h:
* css/CSSLineBoxContainValue.cpp:
(WebCore::CSSLineBoxContainValue::customCSSText):
* css/CSSLineBoxContainValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::customCSSText):
(WebCore::CSSPrimitiveValue::customSerializeResolvingVariables):
* css/CSSPrimitiveValue.h:
* css/CSSReflectValue.cpp:
(WebCore::CSSReflectValue::customCSSText):
* css/CSSReflectValue.h:
* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSLinearTimingFunctionValue::customCSSText):
(WebCore::CSSCubicBezierTimingFunctionValue::customCSSText):
(WebCore::CSSStepsTimingFunctionValue::customCSSText):
* css/CSSTimingFunctionValue.h:
* css/CSSUnicodeRangeValue.cpp:
(WebCore::CSSUnicodeRangeValue::customCSSText):
* css/CSSUnicodeRangeValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::cssText):
* css/CSSValueList.cpp:
(WebCore::CSSValueList::customCSSText):
* css/CSSValueList.h:
* css/FontFeatureValue.cpp:
(WebCore::FontFeatureValue::customCSSText):
* css/FontFeatureValue.h:
* css/FontValue.cpp:
(WebCore::FontValue::customCSSText):
* css/FontValue.h:
* css/ShadowValue.cpp:
(WebCore::ShadowValue::customCSSText):
* css/ShadowValue.h:
* css/WebKitCSSArrayFunctionValue.cpp:
(WebCore::WebKitCSSArrayFunctionValue::customCSSText):
* css/WebKitCSSArrayFunctionValue.h:
* css/WebKitCSSFilterValue.cpp:
(WebCore::WebKitCSSFilterValue::customCSSText):
* css/WebKitCSSFilterValue.h:
* css/WebKitCSSMatFunctionValue.cpp:
(WebCore::WebKitCSSMatFunctionValue::customCSSText):
* css/WebKitCSSMatFunctionValue.h:
* css/WebKitCSSMixFunctionValue.cpp:
(WebCore::WebKitCSSMixFunctionValue::customCSSText):
* css/WebKitCSSMixFunctionValue.h:
* css/WebKitCSSSVGDocumentValue.cpp:
(WebCore::WebKitCSSSVGDocumentValue::customCSSText):
* css/WebKitCSSSVGDocumentValue.h:
* css/WebKitCSSShaderValue.cpp:
(WebCore::WebKitCSSShaderValue::customCSSText):
* css/WebKitCSSShaderValue.h:
* css/WebKitCSSTransformValue.cpp:
(WebCore::WebKitCSSTransformValue::customCSSText):
* css/WebKitCSSTransformValue.h:
* svg/SVGColor.cpp:
(WebCore::SVGColor::customCSSText):
* svg/SVGColor.h:
* svg/SVGPaint.cpp:
(WebCore::SVGPaint::customCSSText):
* svg/SVGPaint.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Actually include new results

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove HTMLDialogElement layout tests after r154835
https://bugs.webkit.org/show_bug.cgi?id=120680

Reviewed by Darin Adler.

* fast/dom/HTMLDialogElement/: Removed.
* platform/efl/TestExpectations:
* platform/gtk/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@155062 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Upload demo and images for a potential blog post.

* blog-files/regions: Added.
* blog-files/regions/pizza-is-amazing.png: Added.
* demos/regions: Added.
* demos/regions/pizza-regions-manifesto-regionstyling.html: Added.
* demos/regions/pizza-regions-manifesto.html: Added.
* demos/regions/yellow-pizza.jpg: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155063 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JSGenericTypedArrayViewConstructor.h is referenced twice in the XCode project build section, causing warnings
https://bugs.webkit.org/show_bug.cgi?id=120698

Reviewed by Darin Adler.

* JavaScriptCore.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155064 268f45cc-cd09-0410-ab3c-d52691b4dbfc
FloatingObjects should manage cleaning it's line box tree pointers itself
https://bugs.webkit.org/show_bug.cgi?id=120692

Reviewed by David Hyatt.

This is another step in properly encapsulating FloatingObjects.
Instead of having RenderBlock walk and clear the line box tree
pointers, create a method for the behavior, and have RenderBlock call
that.

In addtion, add a proper destructor to FloatingObjects, so that
RenderBlock does not have to explicitly delete the set in
FloatingObjects.

And as a bonus, fix the ordering of an if to avoid the expensive
descendantChild check.

This is a port of a Blink patch by Eric Seidel.

No new tests, no behavior change.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::~RenderBlock):
(WebCore::RenderBlock::deleteLineBoxTree):
(WebCore::RenderBlock::repaintOverhangingFloats):
(WebCore::RenderBlock::FloatingObjects::~FloatingObjects):
(WebCore::RenderBlock::FloatingObjects::clearLineBoxTreePointers):
(WebCore::RenderBlock::FloatingObjects::clear):
* rendering/RenderBlock.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155065 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2][GTK] ASSERTION in WebKit::LayerTreeHostGtk::invalidate
https://bugs.webkit.org/show_bug.cgi?id=117733

Reviewed by Martin Robinson.

If the GL context cannot be created then an invalid
LayerTreeHostGtk object will be returned.

This patch disables accelerated compositing if the system doesn't
support it.

* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewUpdateSettings):
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseUpdatePreferences):
(webkitWebViewBaseCreateWebPage):
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155066 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Check that XMLHttpRequest.response returns null or a json object as specified in the spec according to readyState value.
https://bugs.webkit.org/show_bug.cgi?id=120690

Reviewed by Darin Adler.

Merge https://chromium.googlesource.com/chromium/blink/+/d667a115b0fd8f5e11a24d8db44388a990abf543

* http/tests/xmlhttprequest/resources/test.json: Added.
* http/tests/xmlhttprequest/response-json-and-readystate-expected.txt: Added.
* http/tests/xmlhttprequest/response-json-and-readystate.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155067 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed Windows build fix.

* WebCore.vcxproj/WebCoreCommon.props:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[mac] PDFDocumentImage should use PDFKit to draw
https://bugs.webkit.org/show_bug.cgi?id=120651
<rdar://problem/12810731>

Reviewed by Alexey Proskuryakov.

Use PDFKit to draw PDF-in-<img> on Mac, so that annotations in PDF are painted.

Test: fast/images/pdf-as-image-with-annotations.html

* WebCore.xcodeproj/project.pbxproj:
Add PDFDocumentImageMac.mm.

* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::PDFDocumentImage):
We don't need to initialize m_document anymore because it's now a RetainPtr.
Initialize m_hasPage to false.

(WebCore::PDFDocumentImage::~PDFDocumentImage):
We don't need to manually release our CGPDFDocumentRef anymore because it's now a RetainPtr.

(WebCore::PDFDocumentImage::size):
Use expandedIntSize for explicitness.

(WebCore::PDFDocumentImage::applyRotationForPainting):
Rename adjustCTM to applyRotationForPainting, and move the one non-rotation related transformation out.
We need to do this because PDFKit applies the rotation transformation itself, so we don't need to.
Also, explicitly use std::min instead of importing the whole std namespace.

(WebCore::PDFDocumentImage::dataChanged):
Assert that we don't re-enter dataChanged after we've created a document,
because it seems like that shouldn't happen - we only create a document when
we've supposedly received all data, and it would be nice if we didn't have
all this varying code to deal with SharedBuffers changing out from under each other.
Factor the code to create a CGPDFDocumentRef out into createPDFDocument, so we can
replace it with a different implementation that creates a PDFDocument.

(WebCore::PDFDocumentImage::setCurrentPage):
Make all page-number-related things unsigned, since they are in CG and PDFKit,
and add m_hasPage to denote whether we've acquired a valid page yet.
Factor code to retrieve the PDF box bounds into computeBoundsForCurrentPage.
Remove setCurrentPage itself, as we never use a page other than the first page;
we will call computeBoundsForCurrentPage and set hasPage in dataChanged, now.

(WebCore::PDFDocumentImage::draw):
Fix a weird comment.
Factor code that actually draws the PDF out into drawPDFPage.

The rest of the functions in this file are only built for USE(CG) && !PLATFORM(MAC):

(WebCore::PDFDocumentImage::createPDFDocument):
Factored out of dataChanged(); I only kept the !PLATFORM(MAC) branch.

(WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
Factored out of setCurrentPage().
Use deg2rad since we have it.

(WebCore::PDFDocumentImage::pageCount):
(WebCore::PDFDocumentImage::drawPDFPage):
Factored out of draw().
Reduced an unnecessary transform (we were effectively doing mediaBox.origin - cropBox.origin - mediaBox.origin).

* platform/graphics/cg/PDFDocumentImage.h:
Unindent all the things, as we don't indent the first level inside a namespace scope.
Forward-declare PDFDocument.
Make m_currentPage unsigned as it should be.
Add m_hasPage.
Make m_document a PDFDocument on PLATFORM(MAC) and a CGPDFDocumentRef on other platforms.

* platform/graphics/mac/PDFDocumentImageMac.mm: Added.
Soft-link in PDFKit and specifically the PDFDocument class.

(WebCore::PDFDocumentImage::createPDFDocument):
Create our PDFDocument from the SharedBuffer's NSData directly. This shouldn't be a problem
(with respect to the SharedBuffer's data being appended to in secret), because we've waited
for the document to finish loading before getting here.

(WebCore::PDFDocumentImage::computeBoundsForCurrentPage):
Ask PDFKit for the page's media and crop boxes; it automatically performs the correct fallback.
Ask PDFKit for the page's rotation.

(WebCore::PDFDocumentImage::pageCount):
Ask PDFKit for the page count.

(WebCore::PDFDocumentImage::drawPDFPage):
Paint the current page of the PDF. Note that we do not apply the rotation here
via applyRotationForPainting because PDFKit will do it itself.

* platform/mac/SoftLinking.h:
I couldn't find any clients of SOFT_LINK_FRAMEWORK_IN_CORESERVICES_UMBRELLA,
so I made it the more generic SOFT_LINK_FRAMEWORK_IN_UMBRELLA, taking the name
of the umbrella framework and the subframework, so I could use it to soft link
Quartz.framework's PDFKit.framework.

* fast/images/pdf-as-image-with-annotations-expected.html: Added.
* fast/images/pdf-as-image-with-annotations.html: Added.
* fast/images/resources/annotation.pdf: Added.
Add a test that ensures that PDF-in-<img> draws simple annotations.

* platform/mac/fast/images/pdf-as-image-landscape-expected.png:
* platform/mac/fast/images/pdf-as-image-landscape-expected.txt:
Extremely minor rebaselines probably due to PDFKit handling rotation in the new implementation.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155069 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Document::updateHoverActiveState() should allow for deferred style recalcs
https://bugs.webkit.org/show_bug.cgi?id=120700

Reviewed by Simon Fraser.

Add an extra argument to Document::updateHoverActiveState() to specify if a style recalc
should be done. The default value keeps the current behavior of doing a style recalc. iOS
touch handling code will pass in DeferRecalcStyleIfNeeded to avoid the work.

No new tests because no functional changes.

* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):
* dom/Document.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Editor::m_removedAnchor is unused
https://bugs.webkit.org/show_bug.cgi?id=120701

Reviewed by Ryosuke Niwa.

* editing/Editor.h: Removed m_removedAnchor. It was not only unused, but also broken,
as we didn't reset it when navigating.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixing a typo in demo files and screenshot.

* blog-files/regions/pizza-is-amazing.png: Replaced.
* demos/regions/pizza-regions-manifesto-regionstyling.html:
* demos/regions/pizza-regions-manifesto.html:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155073 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unnecessary RenderView.h inclusion from headers.
<https://webkit.org/b/120365>

Reviewed by Anders Carlsson.

RenderView.h was overzealously included by RenderText and RenderTextTrackCue,
making it unpleasant to edit on my laptop.

* rendering/RenderText.h:
* rendering/RenderTextTrackCue.h:

    Don't include RenderView.h here, do it in .cpp files.


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