RenderView::frameView() should return a reference.
<https://webkit.org/b/120208>

Reviewed by Antti Koivisto.

A RenderView should always have a corresponding FrameView, so make frameView()
return a reference. Also remove a myriad of now-impossible null checks.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
RenderLayerCompositor::m_renderView should be a reference.
<https://webkit.org/b/120210>

Reviewed by Antti Koivisto.

The RenderLayerCompositor is always created by a RenderView passing itself to the constructor.
By making m_renderView a reference, we flush out some unnecessary null checks.
We also gain a pointer-free path to Settings through m_renderView.frameView().frame().settings()
so we don't have to make those blocks conditional anymore, reducing ambiguity.

* rendering/RenderLayerCompositor.cpp:
* rendering/RenderLayerCompositor.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::compositor):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154489 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Assertion failures when loading XSL stylesheets with NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=120186
<rdar://problem/14080273>

Reviewed by Brady Eidson.

Covered by many existing tests.

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::loadResourceSynchronously): Pass frame ID and page ID.
They are mostly needed for authentication, which is not supported with sync requests,
but it will be supported some day.

* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
* WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
(WebKit::WebFrameNetworkingContext::webFrameLoaderClient):
Added a way to get frame loader client from WebKit NetworkingContext subclass.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore fails to link due to changes in Objective-C++ ABI in trunk clang
<http://webkit.org/b/120183>
<rdar://problem/14764114>

Reviewed by Eric Carlson.

The trunk version of clang made an ABI change for Objective-C++
parameters that caused WebCore to fail to link.  The short-term
fix is to change the parameter type from id<protocol> to just id
and add an ASSERT that the parameter still conforms to the
protocol.

* platform/DragData.h:
(DragDataRef): Change typedef from id<NSDragInfo> to id.
* platform/mac/DragDataMac.mm:
(WebCore::DragData::DragData): Add ASSERT that checks that the
DragDataRef object implements the NSDragInfo protocol.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154493 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Attempt to make it more clear what FloatIntervalSearchAdaptor::collectIfNeeded is doing
https://bugs.webkit.org/show_bug.cgi?id=119816

Reviewed by David Hyatt.

This is a port from Blink of
https://src.chromium.org/viewvc/blink?revision=155885&view=revision
Original Patch by Eric Seidel

Original comments:

"It seemed to me that template specifications would be clearer than an
if.  They also allow for compile-time error checking were a 3rd type
of float to come into existance in CSS4. :p

For any unfamiliar with this method, this the object used for
performing a search on a RedBlackTree in WTF.

We create one of these adaptors, specifying that we want to search for
values in a specific (logical) Y interval, and this adaptor is called
back for any values in the RBTree cooresponding to that interval
range.

The job of this adaptor is to collect the various values we care
about, including the left or right-most offset of the floats in that
Y-range as well as what the last (document order) float seen in that
range.

It also collects the remaining available height for the block but I'm
less clear on how that parameter is used."

Note that in addition to the original change, I have made the
updateOffsetIfNeeded and rangesIntersect methods inline, as this was
shown to be a performance win in
https://src.chromium.org/viewvc/blink?revision=156064&view=revision
and it seemed a rather trivial change to be subject to a separate
patch when porting.

No new tests, no behavior change.

* rendering/RenderBlock.cpp:
(WebCore::::updateOffsetIfNeeded):
(WebCore::::collectIfNeeded):
* rendering/RenderBlock.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154494 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119945> Some cleanup for PasteboardIOS

Reviewed by Andreas Kling.

* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::setFrame): Moved this function up near the
create functions and constructors.
(WebCore::documentFragmentWithRTF): Tweaked formatting.
(WebCore::Pasteboard::documentFragmentForPasteboardItemAtIndex):
Ditto.
(WebCore::utiTypeFromCocoaType): Changed to use early return and removed
an unneeded local variable.
(WebCore::cocoaTypeFromHTMLClipboardType): Renamed the quaint qType and
pbType local variables, and tweaked formatting.
(WebCore::Pasteboard::clear): Tweaked comment.
(WebCore::Pasteboard::readString): Tweaked formatting.
(WebCore::addHTMLClipboardTypesForCocoaType): Tweaked formatting.
(WebCore::Pasteboard::writeString): Streamlined logic and tweaked formatting
(WebCore::Pasteboard::types): Renamed pbType to just type.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/113895> Webkit exposes aria-expanded="undefined" as aria-expanded="false" (AXExpanded = NO)

Reviewed by Darin Adler.

Source/WebCore:

Don't support the ARIA expanded attribute unless the value is one of the defined ARIA values (true/false).

Test: platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::supportsARIAExpanded):

LayoutTests:

* platform/mac/accessibility/aria-expanded-not-exposed-when-undefined-expected.txt: Added.
* platform/mac/accessibility/aria-expanded-not-exposed-when-undefined.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154496 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix srcset's image candidate algorithm when DPR exceeds all candidates
https://bugs.webkit.org/show_bug.cgi?id=120168

Source/WebCore:

When the DPR exceeded the 'x' qualifier of all image candidates, none was chosen.

From the srcset spec: "If there are any entries in candidates that have an associated pixel density that is less than a
user-agent-defined value giving the nominal pixel density of the display, then remove them, unless that would remove all the
entries, in which case remove only the entries whose associated pixel density is less than the greatest such pixel density."

Fixed by returning the last one in the list of candidates sorted by their qualifier, in case none of them is equal or greater than
DPR.

Patch by Yoav Weiss <yoav@yoav.ws> on 2013-08-23
Reviewed by Andreas Kling.

Test: fast/hidpi/image-srcset-fraction.html

* html/parser/HTMLParserIdioms.cpp:
(WebCore::bestFitSourceForImageAttributes):

LayoutTests:

From the srcset spec: "If there are any entries in candidates that have an associated pixel density that is less than a
user-agent-defined value giving the nominal pixel density of the display, then remove them, unless that would remove all the
entries, in which case remove only the entries whose associated pixel density is less than the greatest such pixel density."

This test verifies that when all the candidates' qualifiers are smaller than the DPR, the highest one is returned.

Patch by Yoav Weiss <yoav@yoav.ws> on 2013-08-23
Reviewed by Andreas Kling.

* fast/hidpi/image-srcset-fraction-expected.txt: Added.
* fast/hidpi/image-srcset-fraction.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support in memory compression of rarely used data
https://bugs.webkit.org/show_bug.cgi?id=120143

Reviewed by Gavin Barraclough.

Source/JavaScriptCore:

Include zlib in LD_FLAGS and make UnlinkedCodeBlock make use of CompressibleVector.  This saves ~200k on google maps.

* Configurations/JavaScriptCore.xcconfig:
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::expressionRangeForBytecodeOffset):
(JSC::UnlinkedCodeBlock::addExpressionInfo):
* bytecode/UnlinkedCodeBlock.h:

Source/WTF:

Adds a set of utility functions to wrap the use of zlib over a generic
type or a Vector<> as well as adding CompressibleVector that wraps
either a Vector<> or compressed data.

* GNUmakefile.list.am:
* WTF.pro:
* WTF.vcxproj/WTF.vcxproj:
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CheckedArithmetic.h:
* wtf/Compression.cpp: Added.
(WTF::zAlloc):
(WTF::zFree):
(WTF::GenericCompressedData::create):
(WTF::GenericCompressedData::decompress):
* wtf/Compression.h: Added.
(WTF::GenericCompressedData::compressedSize):
(WTF::GenericCompressedData::originalSize):
(WTF::GenericCompressedData::GenericCompressedData):
(WTF::CompressedVector::create):
(WTF::CompressedVector::decompress):
(WTF::CompressedVector::size):
(WTF::CompressibleVector::CompressibleVector):
(WTF::CompressibleVector::shrinkToFit):
(WTF::CompressibleVector::size):
(WTF::CompressibleVector::operator[]):
(WTF::CompressibleVector::at):
(WTF::CompressibleVector::begin):
(WTF::CompressibleVector::end):
(WTF::CompressibleVector::data):
(WTF::CompressibleVector::decompressIfNecessary):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154498 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Re-sort xcode project file

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<https://webkit.org/b/119864> [CSS Shapes] Remove extraneous window.internals calls in layout tests

Reviewed by Alexandru Chiculita.

Removing calls to window.internals.settings.setCSSShapesEnabled from these files, as
CSS Shapes is enabled by default in test builds.

* fast/regions/shape-inside/shape-inside-on-additional-regions.html:
* fast/regions/shape-inside/shape-inside-on-first-region-block-content.html:
* fast/regions/shape-inside/shape-inside-on-first-region-inline-content.html:
* fast/regions/shape-inside/shape-inside-on-regions-block-content-basic-overflow-shape-top-offset.html:
* fast/regions/shape-inside/shape-inside-on-regions-block-content-overflow-bottom-positioned-multiple-shapes.html:
* fast/regions/shape-inside/shape-inside-on-regions-block-content-overflow-multiple-shapes.html:
* fast/regions/shape-inside/shape-inside-on-regions-block-content-polygon-with-adjustment-expected.html:
* fast/regions/shape-inside/shape-inside-on-regions-block-content-polygon-with-adjustment.html:
* fast/regions/shape-inside/shape-inside-on-regions-expected.html:
* fast/regions/shape-inside/shape-inside-on-regions-inline-content-basic-overflow-shape-top-offset.html:
* fast/regions/shape-inside/shape-inside-on-regions-inline-content-overflow-bottom-positioned-multiple-shapes.html:
* fast/regions/shape-inside/shape-inside-on-regions-inline-content-overflow-multiple-shapes.html:
* fast/regions/shape-inside/shape-inside-on-regions-inline-content-polygon-with-adjustment-expected.html:
* fast/regions/shape-inside/shape-inside-on-regions-inline-content-polygon-with-adjustment.html:
* fast/regions/shape-inside/shape-inside-on-regions-inline-content.html:
* fast/regions/shape-inside/shape-inside-on-regions.html:
* fast/regions/shape-inside/shape-inside-on-second-region-block-content.html:
* fast/regions/shape-inside/shape-inside-on-second-region-inline-content.html:
* fast/regions/shape-inside/shape-inside-recursive-layout.html:
* fast/regions/shape-inside/shape-inside-with-region-borders.html:
* fast/regions/shape-inside/shape-inside-with-region-padding.html:
* fast/shapes/css-shapes-disabled.html:
* fast/shapes/parsing/script-tests/parsing-shape-inside.js:
* fast/shapes/parsing/script-tests/parsing-shape-lengths.js:
* fast/shapes/parsing/script-tests/parsing-shape-margin.js:
* fast/shapes/parsing/script-tests/parsing-shape-outside.js:
* fast/shapes/parsing/script-tests/parsing-shape-padding.js:
* fast/shapes/resources/multi-segment-polygon.js:
* fast/shapes/resources/simple-polygon.js:
* fast/shapes/resources/simple-rectangle.js:
* fast/shapes/shape-inside/shape-inside-animation.html:
* fast/shapes/shape-inside/shape-inside-bottom-edge.html:
* fast/shapes/shape-inside/shape-inside-box-sizing.html:
* fast/shapes/shape-inside/shape-inside-circle-padding.html:
* fast/shapes/shape-inside/shape-inside-circle.html:
* fast/shapes/shape-inside/shape-inside-coincident-vertices-expected.html:
* fast/shapes/shape-inside/shape-inside-coincident-vertices.html:
* fast/shapes/shape-inside/shape-inside-collinear-vertices-expected.html:
* fast/shapes/shape-inside/shape-inside-collinear-vertices.html:
* fast/shapes/shape-inside/shape-inside-counterclockwise-polygon-expected.html:
* fast/shapes/shape-inside/shape-inside-counterclockwise-polygon.html:
* fast/shapes/shape-inside/shape-inside-dynamic-nested-expected.html:
* fast/shapes/shape-inside/shape-inside-dynamic-nested.html:
* fast/shapes/shape-inside/shape-inside-dynamic-shape.html:
* fast/shapes/shape-inside/shape-inside-dynamic-text.html:
* fast/shapes/shape-inside/shape-inside-ellipse-padding.html:
* fast/shapes/shape-inside/shape-inside-ellipse.html:
* fast/shapes/shape-inside/shape-inside-empty.html:
* fast/shapes/shape-inside/shape-inside-first-fit-001-horizontal.html:
* fast/shapes/shape-inside/shape-inside-first-fit-001-vertical.html:
* fast/shapes/shape-inside/shape-inside-first-fit-002.html:
* fast/shapes/shape-inside/shape-inside-first-fit-003.html:
* fast/shapes/shape-inside/shape-inside-first-fit-004-expected.html:
* fast/shapes/shape-inside/shape-inside-first-fit-004.html:
* fast/shapes/shape-inside/shape-inside-first-fit-reflex.html:
* fast/shapes/shape-inside/shape-inside-inline-elements.html:
* fast/shapes/shape-inside/shape-inside-multiple-blocks-vertical.html:
* fast/shapes/shape-inside/shape-inside-multiple-blocks.html:
* fast/shapes/shape-inside/shape-inside-on-nested-container-with-unresolved-height.html:
* fast/shapes/shape-inside/shape-inside-overflow-fixed-dimensions-block-content.html:
* fast/shapes/shape-inside/shape-inside-overflow-fixed-dimensions.html:
* fast/shapes/shape-inside/shape-inside-overflow.html:
* fast/shapes/shape-inside/shape-inside-partial-fill-001.html:
* fast/shapes/shape-inside/shape-inside-partial-fill-002.html:
* fast/shapes/shape-inside/shape-inside-percentage-auto.html:
* fast/shapes/shape-inside/shape-inside-percentage.html:
* fast/shapes/shape-inside/shape-inside-polygon-layout.html:
* fast/shapes/shape-inside/shape-inside-polygon-padding-001.html:
* fast/shapes/shape-inside/shape-inside-polygon-padding-002.html:
* fast/shapes/shape-inside/shape-inside-polygon-padding-003.html:
* fast/shapes/shape-inside/shape-inside-polygon-rectangle.html:
* fast/shapes/shape-inside/shape-inside-polygon-zoom.html:
* fast/shapes/shape-inside/shape-inside-rectangle-padding.html:
* fast/shapes/shape-inside/shape-inside-rectilinear-polygon-001-expected.html:
* fast/shapes/shape-inside/shape-inside-rectilinear-polygon-001.html:
* fast/shapes/shape-inside/shape-inside-rectilinear-polygon-002-expected.html:
* fast/shapes/shape-inside/shape-inside-rectilinear-polygon-002.html:
* fast/shapes/shape-inside/shape-inside-rectilinear-polygon-003-expected.html:
* fast/shapes/shape-inside/shape-inside-rectilinear-polygon-003.html:
* fast/shapes/shape-inside/shape-inside-rectilinear-polygon-004-expected.html:
* fast/shapes/shape-inside/shape-inside-rectilinear-polygon-004.html:
* fast/shapes/shape-inside/shape-inside-regular-polygon16-expected.html:
* fast/shapes/shape-inside/shape-inside-regular-polygon16.html:
* fast/shapes/shape-inside/shape-inside-regular-polygon8-expected.html:
* fast/shapes/shape-inside/shape-inside-regular-polygon8.html:
* fast/shapes/shape-inside/shape-inside-rounded-rectangle-001.html:
* fast/shapes/shape-inside/shape-inside-rounded-rectangle-fit-001-expected.html:
* fast/shapes/shape-inside/shape-inside-rounded-rectangle-fit-001.html:
* fast/shapes/shape-inside/shape-inside-rounded-rectangle-fit-002-expected.html:
* fast/shapes/shape-inside/shape-inside-rounded-rectangle-fit-002.html:
* fast/shapes/shape-inside/shape-inside-rounded-rectangle-fit-003-expected.html:
* fast/shapes/shape-inside/shape-inside-rounded-rectangle-fit-003.html:
* fast/shapes/shape-inside/shape-inside-rounded-rectangle-large-radius-expected.html:
* fast/shapes/shape-inside/shape-inside-rounded-rectangle-large-radius.html:
* fast/shapes/shape-inside/shape-inside-rounded-rectangle-padding.html:
* fast/shapes/shape-inside/shape-inside-shape-logical-top.html:
* fast/shapes/shape-inside/shape-inside-sibling-block-dimension-change-needs-relayout-expected.html:
* fast/shapes/shape-inside/shape-inside-sibling-block-dimension-change-needs-relayout.html:
* fast/shapes/shape-inside/shape-inside-text.html:
* fast/shapes/shape-inside/shape-inside-vertical-text.html:
* fast/shapes/shape-outside-floats/shape-outside-floats-diamond-margin-polygon.html:
* fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-bottom.html:
* fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-left.html:
* fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-right.html:


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