[CSS Regions] Overflow above the first region is not properly painted for regions with padding
https://bugs.webkit.org/show_bug.cgi?id=128590

Reviewed by Andrei Bucur.

Source/WebCore:

Painting is done using the layer of the region's container, so offsetting using the content box
of the region itself is incorrect.

Test: fast/regions/region-padding-overflow-hidden.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::regionContainer):
(WebCore::RenderRegion::regionContainerLayer):
* rendering/RenderRegion.h:

LayoutTests:

Added test for the correct painting of overflow above the first region
when the region has padding.

* fast/regions/region-padding-overflow-hidden-expected.html: Added.
* fast/regions/region-padding-overflow-hidden.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WinCairo] Compile error, deleted file in WTF.
https://bugs.webkit.org/show_bug.cgi?id=128601

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-02-11
Reviewed by Csaba Osztrogonác.

* WTF.vcxproj/WTF.vcxproj: Removed reference to deleted file.
* WTF.vcxproj/WTF.vcxproj.filters: Ditto.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
O_CLOEXEC in shm_open does not work on FreeBSD
https://bugs.webkit.org/show_bug.cgi?id=128572

Reviewed by Darin Adler.

The O_CLOEXEC is not supported by shm_open() and is also not
necessary since FD_CLOEXEC is already set by default when the new
file descriptor is created.

* Platform/unix/SharedMemoryUnix.cpp:
(WebKit::SharedMemory::create):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Obj-C API: JSExport doesn't work for methods that contain protocols in their type signature
https://bugs.webkit.org/show_bug.cgi?id=128540

Reviewed by Oliver Hunt.

The bug is in parseObjCType in ObjcRuntimeExtras.h. When we see an '@' in the
type signature of a method, we assume that what follows the '@' is a class name,
so we call objc_getClass, and if that returns nil then we give up on the method
and don't export it.

This assumption doesn't work in the case of id<Protocol> because it's the name
of the protocol that follows the '@', not the name of a class. We should have
another fallback case for protocol names.

There's another case that also doesn't work, and that's the case of a named class
with a specified prototype in a method signature (e.g. NSObject<MyProtocol>).
There the substring of the type signature that represents the class is "NSObject<MyProtocol>",
which will also cause objc_getClass to return nil.

* API/ObjcRuntimeExtras.h:
(parseObjCType):
* API/tests/DateTests.mm: Also fixed an issue I noticed where we don't use an autorelease pool
for the DateTests.
* API/tests/JSExportTests.h: Added.
* API/tests/JSExportTests.mm: Added.
(-[TruthTeller returnTrue]):
(-[ExportMethodWithIdProtocol methodWithIdProtocol:]):
(-[ExportMethodWithClassProtocol methodWithClassProtocol:]):
(+[JSExportTests exportInstanceMethodWithIdProtocolTest]):
(+[JSExportTests exportInstanceMethodWithClassProtocolTest]):
(runJSExportTests):
* API/tests/testapi.mm:
* JavaScriptCore.xcodeproj/project.pbxproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IDB: storage/indexeddb/mozilla/cursor-update-updates-indexes.html ASSERTs
<rdar://problem/16034112> and https://bugs.webkit.org/show_bug.cgi?id=128581

Reviewed by Alexey Proskuryakov.

Source/WebKit2:

* DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
(WebKit::UniqueIDBDatabase::getRecordFromBackingStore): Always store keyPath for Index get results.

LayoutTests:

* platform/mac-wk2/TestExpectations: Add the test to the enabled list.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[New Multicolumn] Make columns work with line grids
https://bugs.webkit.org/show_bug.cgi?id=128555

Reviewed by Antti Koivisto.

Added line-snap-into-columns.html and line-snap-inside-columns.html

Source/WebCore: 

* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
* rendering/LayoutState.h:
(WebCore::LayoutState::pageOffset):
(WebCore::LayoutState::setLineGridPaginationOrigin):
Change the LayoutState to call into the renderer to compute the line
grid pagination origin instead of doing it directly. Added the
appropriate getters and setters to enable the renderer to do this.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeLineGridPaginationOrigin):
 * rendering/RenderBlock.h:
An implementation for the old multi-column code. The logic is the
same with tweaks made now that the method is on the renderer instead.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::pageLogicalTopForOffset):
Fix a bug with flow threads and pageLogicalTopForOffset. Normal CSS region-based
flow threads are never embedded in an enclosing pagination context, so they
didn't add in the firstPageLogicalTop (or subtract it when computing the region
hit). Multi-column flow threads do need to subtract out the firstPageLogicalTop,
since it can occur somewhere on the page.
        
Ultimately regions will need to get smarter here too if they want to work with
line grids, but for now I just fixed multi-column.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::isUnsplittableForPagination):
Undo this change, since it prevents the inheritance of line grids into the
multi-column layout.

* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::computeLineGridPaginationOrigin):
* rendering/RenderMultiColumnFlowThread.h:
An implementation for the new multi-column code. The logic is the
same as the old code. Code duplication is ok, since the old multi-column method
in RenderBlock will just be deleted once the new code is turned on, and it's easier
not to intertwine them.

LayoutTests: 

* fast/multicol/newmulticol/line-grid-inside-columns-expected.html: Added.
* fast/multicol/newmulticol/line-grid-inside-columns.html: Added.
* fast/multicol/newmulticol/line-grid-into-columns-expected.html: Added.
* fast/multicol/newmulticol/line-grid-into-columns.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LICM should gracefully handle unprofiled code
https://bugs.webkit.org/show_bug.cgi?id=127848

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore: 

* dfg/DFGLICMPhase.cpp:
(JSC::DFG::LICMPhase::run):

LayoutTests: 

* js/regress/script-tests/unprofiled-licm.js: Added.
(foo):
* js/regress/unprofiled-licm-expected.txt: Added.
* js/regress/unprofiled-licm.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSS Regions] clipping rectangle for "overflow: hidden" should be based on the padding box, not the content box
https://bugs.webkit.org/show_bug.cgi?id=119546

Reviewed by Anders Carlsson.

Added tests for the correct painting of region overflow over the region's padding.
This problem was solved by https://bugs.webkit.org/show_bug.cgi?id=118665 and
https://bugs.webkit.org/show_bug.cgi?id=128590.
Two writing modes (horiz-bt and vert-rl) are still not working properly and a separate
issue has been created for them (https://bugs.webkit.org/show_bug.cgi?id=128600).

* fast/regions/clip-to-padding-box-expected.html: Added.
* fast/regions/clip-to-padding-box-margins-expected.html: Added.
* fast/regions/clip-to-padding-box-margins.html: Added.
* fast/regions/clip-to-padding-box-vertical-lr-expected.html: Added.
* fast/regions/clip-to-padding-box-vertical-lr.html: Added.
* fast/regions/clip-to-padding-box.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LLInt typo error after r139004.
https://bugs.webkit.org/show_bug.cgi?id=128592

Reviewed by Michael Saboff.

* offlineasm/arm.rb: change immediate to register in the condition


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@163881 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Correct some uses of 'auto'
https://bugs.webkit.org/show_bug.cgi?id=128578

Reviewed by Anders Carlsson.

Correct the following instances of "for (auto ...)" to use reference or
const references to avoid copies.

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::elementsFromAttribute):
* css/CSSGridTemplateValue.cpp:
(WebCore::stringForPosition):
* dom/Node.cpp:
(WebCore::NodeListsNodeData::invalidateCaches):
* inspector/PageInjectedScriptManager.cpp:
(WebCore::PageInjectedScriptManager::discardInjectedScriptsFor):
* page/WheelEventDeltaTracker.cpp:
(WebCore::WheelEventDeltaTracker::dominantScrollGestureDirection):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
* platform/graphics/mac/WebLayer.mm:
(WebCore::drawLayerContents):
* platform/ios/TileGrid.mm:
(WebCore::TileGrid::dropTilesBetweenRects):
(WebCore::TileGrid::dropDistantTiles):
(WebCore::TileGrid::dropInvalidTiles):
* rendering/InlineTextBox.cpp:
(WebCore::translateIntersectionPointsToSkipInkBoundaries):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::restoreTo):


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

* WebCoreSupport/WebChromeClient.mm: Fixed incorrectly nested ifdefs.



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