[GTK] Move generated ColorData.cpp, WebKitFontFamilyNames.(cpp|h) build targets into libPlatform
https://bugs.webkit.org/show_bug.cgi?id=115921

Reviewed by Gustavo Noronha Silva.

.: 

* GNUmakefile.am: Add GENSOURCES_PLATFORM, platform_built_sources variables.

Source/Platform: 

* GNUmakefile.am: Move the ANGLE include directories under the new platform_cppflags variable,
adding the DerivedSources/Platform directory. Add the generated sources' build targets to libPlatform
under nodist_libPlatform_la_SOURCES. Add platform_cppflags to the list of libPlatformGtk CPPFLAGS.
Add generation rules for the ColorData.cpp and WebKitFontFamilyNames.(cpp|h) source files, now generated
into the DerivedSources/Platform directory.

Source/WebCore: 

No new tests - no new functionality.

* GNUmakefile.am: Add platform_cppflags to the list of CPPFLAGS for libWebCoreSVG, libWebCore,
libWebCorePlatform, libWebCoreGtk. Remove generation rules for ColorData.cpp and WebKitFontFamilyNames.(cpp|h).
* GNUmakefile.list.am: Include the ColorData.cpp and WebKitFontFamilyNames.(cpp|h) build targers under
platform_built_sources.
* bindings/gobject/GNUmakefile.am: Add platform_cppflags to the list of libWebCoreDOM CPPFLAGS.

Source/WebKit/gtk: 

* GNUmakefile.am: Add platform_cppflags to the list of CPPFLAGS for libwebkit2gtk, libWebCoreGtk2,
libPlatformGtk2 and WebKitPluginProcess.

Source/WebKit2: 

* GNUmakefile.am: Add platform_cppflags to the list of libwebkit2gtk CPPFLAGS.

Tools: 

* GNUmakefile.am: Add platform_cppflags to the list of CPPFLAGS for libWebCoreInternals and DumpRenderTree.
* TestWebKitAPI/GNUmakefile.am: Add platform_cppflags to the list of TestGtk CPPFLAGS.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150074 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] captions menu is not positioned correctly in full-screen
https://bugs.webkit.org/show_bug.cgi?id=116103

Update the positioning properties of the captions menu in full-screen
following the fix for https://webkit.org/b/115968.

Reviewed by Darin Adler.

* css/fullscreenQuickTime.css:
(video:-webkit-full-screen::-webkit-media-controls-closed-captions-container):
Add 50px to the bottom position since we're now positioned relative to the
media element, and use a calc() command to be right-aligned to the captions
icon in the media controller. The max-width and max-height properties follow
the same technique used for the non-full-screen mode.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150075 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Handle network errors when starting a new job
https://bugs.webkit.org/show_bug.cgi?id=116101

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2013-05-14
Reviewed by Rob Buis.

Make startJob() return a network status that can be used by the
caller to create a network error.

* platform/network/blackberry/NetworkJob.cpp:
(WebCore::NetworkJob::initialize): createNetworkStream() should
always return a valid pointer so use an ASSERT instead of an early
return to make sure we have a valid stream.
(WebCore::NetworkJob::startNewJobWithRequest): Only return true if
the network job was started successfully.
* platform/network/blackberry/NetworkJob.h:
(NetworkJob): Make initialize method void instead of bool since it
can't fail.
* platform/network/blackberry/NetworkManager.cpp:
(WebCore::NetworkManager::startJob): Return a network error or
StatusSuccess.
* platform/network/blackberry/NetworkManager.h:
(NetworkManager):
* platform/network/blackberry/ResourceHandleBlackBerry.cpp:
(WebCore::ResourceHandle::start): Return true if job was started
successfully.
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
Check return value of startJob and fill the ResourceError with the
network status returned to finish the load.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150076 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Update ORWT to know about the Windows 8 SDK and Debug Tools.
https://bugs.webkit.org/show_bug.cgi?id=116079

Reviewed by David Kilzer.

* Scripts/old-run-webkit-tests:
(setUpWindowsCrashLogSaving): Locate ntsd.exe and use it.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150077 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[CSSRegions] Improve hit testing for empty regions
https://bugs.webkit.org/show_bug.cgi?id=115534

Reviewed by David Hyatt.

As a better follow up after WebKit bug https://bugs.webkit.org/show_bug.cgi?id=107752,
we can improve the code by not doing hit testing on the render flow thread object when
we are trying to hit test the render flow thread background. In this case, we should just bail out.
No new tests, covered by existing regions tests.

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::nodeAtPoint):
(WebCore):
(WebCore::RenderFlowThread::hitTestFlowThreadPortionInRegion):
* rendering/RenderFlowThread.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150078 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Win] REGRESSION(r149944): mmap is not available on Windows
https://bugs.webkit.org/show_bug.cgi?id=116015

Reviewed by Anders Carlsson.

Use fastAlloc/fastFree for platforms other than OS(DARWIN) where
using mmap is not necessary and maybe not available.

* Platform/CoreIPC/ArgumentEncoder.cpp:
(CoreIPC::allocBuffer):
(CoreIPC::freeBuffer):
(CoreIPC::ArgumentEncoder::~ArgumentEncoder):
(CoreIPC::ArgumentEncoder::grow):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150079 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Switch to embedded manifest commands for launcher executables.
https://bugs.webkit.org/show_bug.cgi?id=116109

Reviewed by Darin Adler.

* WinLauncher/WinLauncher.vcxproj/WinLauncher.vcxproj: Remove the
now-unused WinLauncher.exe.manifest file.
* WinLauncher/WinLauncher.vcxproj/WinLauncher.vcxproj.filters: Ditto.
* win/DLLLauncher/DLLLauncherMain.cpp: Add embedded manifest command
when building with VS2010 or newer.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Snapshotted plug-ins shadow tree should reset style inheritance
https://bugs.webkit.org/show_bug.cgi?id=116098

Reset the styles such that only injected user-agent stylesheets affect
the rendering of snapshotted plug-ins' shadow content.

Reviewed by Darin Adler.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150081 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Hook up frame render begin/end in PerformanceMonitor
https://bugs.webkit.org/show_bug.cgi?id=116110

Patch by Andrew Lo <anlo@rim.com> on 2013-05-14
Reviewed by Rob Buis.

Internally reviewed by Jeff Rogers, Jonathan Jiang.
Internal PR 299155.

Mark frame render begin & end for BlackBerry performance monitoring
in blitVisibleContents.

* Api/BackingStore.cpp:
(BlackBerry::WebKit::BackingStorePrivate::blitVisibleContents):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r150023.
http://trac.webkit.org/changeset/150023
https://bugs.webkit.org/show_bug.cgi?id=116120

Causes table layout issues (Bug 116118) and crashes on
buildbot waterfall pages. (Requested by ddkilzer on #webkit).

Source/WebCore:

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
* rendering/RenderTableSection.h:
(RenderTableSection):

LayoutTests:

* fast/css/vertical-align-baseline-rowspan-007-expected.html:
* fast/css/vertical-align-baseline-rowspan-007.htm:
* fast/css/vertical-align-baseline-rowspan-008-expected.html:
* fast/table/table-rowspan-height-distribution-in-rows.html: Removed.
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/qt/fast/table/table-rowspan-height-distribution-in-rows-expected.png: Removed.
* platform/qt/fast/table/table-rowspan-height-distribution-in-rows-expected.txt: Removed.
* platform/qt/tables/mozilla/bugs/bug17548-expected.png:
* platform/qt/tables/mozilla/bugs/bug17548-expected.txt:
* platform/qt/tables/mozilla/bugs/bug220536-expected.png:
* platform/qt/tables/mozilla/bugs/bug220536-expected.txt:
* platform/qt/tables/mozilla/bugs/bug7714-expected.png:
* platform/qt/tables/mozilla/bugs/bug7714-expected.txt:
* platform/qt/tables/mozilla/core/bloomberg-expected.png:
* platform/qt/tables/mozilla/core/bloomberg-expected.txt:
* platform/qt/tables/mozilla/other/test6-expected.png:
* platform/qt/tables/mozilla/other/test6-expected.txt:
* platform/qt/tables/mozilla_expected_failures/bugs/bug1010-expected.png:
* platform/qt/tables/mozilla_expected_failures/bugs/bug1010-expected.txt:
* platform/qt/tables/mozilla_expected_failures/bugs/bug23847-expected.png:
* platform/qt/tables/mozilla_expected_failures/bugs/bug58402-2-expected.png:
* platform/qt/tables/mozilla_expected_failures/bugs/bug58402-2-expected.txt:
* platform/qt/tables/mozilla_expected_failures/bugs/bug6933-expected.png:
* platform/qt/tables/mozilla_expected_failures/bugs/bug6933-expected.txt:
* tables/mozilla/core/bloomberg-expected.txt:
* tables/mozilla_expected_failures/bugs/bug23847-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150083 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Heap-use-after-free in WebCore::RenderBox::exclusionShapeOutsideInfo
https://bugs.webkit.org/show_bug.cgi?id=115566

Patch by Bem Jones-Bey <bjonesbe@adobe.com> on 2013-05-14
Reviewed by David Hyatt.

Source/WebCore:

When a portion of the render tree is being detached, anonymous blocks
will be combined as their children are deleted. In this process, the
anonymous block later in the tree is merged into the one preceeding it.
It can happen that the later block contains floats that the previous
block did not contain, and thus are not in the floating objects list for
the new block. This can result in the new block containing floats that
are not in it's floating objects list, but are in the floating objects
lists of siblings and parents. This can cause problems when the float
itself is deleted, since the deletion code assumes that if a float is not
in it's containing block's floating objects list, it isn't in any
floating objects list, causing dangling pointers in the floating objects
lists of the siblings and parents. In order to preserve this condition
(removing it has serious performance implications), we need to copy the
floating objects from the old block to the new block.  The float's
metrics will likely all be wrong, but since the new block is already
marked for layout, this will get fixed before anything gets displayed.

Test: fast/block/float/float-append-child-crash.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::moveAllChildrenIncludingFloatsTo): Copy
    floating objects list in addition to children.
(WebCore::RenderBlock::FloatingObject::clone): Added.
(WebCore::RenderBlock::removeChild): Use new method to copy children.
* rendering/RenderBlock.h:
(RenderBlock): Add method.

LayoutTests:

Cleaned up test from the fuzzer. Will only crash if run under a memory
checking tool like ASAN.

* fast/block/float/float-append-child-crash-expected.txt: Added.
* fast/block/float/float-append-child-crash.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150084 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Assertion failure in GlyphPage::setGlyphDataForIndex: (!glyph || fontData == m_fontDataForAllGlyphs)
<http://webkit.org/b/116113>
<rdar://problem/13833790>

Reviewed by Dan Bernstein.

If we're filling a full GlyphPage with a SimpleFontData that is actually a composite font reference,
we need to make sure we have per-glyph font data pointers, since it may end up using them.

Added GlyphPage::mayUseMixedFontDataWhenFilling() which can be implemented by the platform to let
GlyphPageTreeNode know that it should allocate a full-sized GlyphPage for mixed font data pointers
in case the font is a composite font reference, or if there are CJK ideographs in the text.

This code can be made smarter, but that's outside the scope of this change.
Fixes heavy asserting on bots running unreleased software.

* platform/graphics/GlyphPage.h:
(GlyphPage):
(WebCore::GlyphPage::mayUseMixedFontDataWhenFilling):
* platform/graphics/GlyphPageTreeNode.cpp:
(WebCore::GlyphPageTreeNode::initializePage):
* platform/graphics/mac/GlyphPageTreeNodeMac.cpp:
(WebCore::shouldUseCoreText):
(WebCore::GlyphPage::mayUseMixedFontDataWhenFilling):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150085 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: REGRESSION: united.com has overlapping elements and is broken by flex box changes.
https://bugs.webkit.org/show_bug.cgi?id=115329
<rdar://problem/13690610>
        
The new flexbox spec says that flex-basis omitted in the flex shorthand defaults to
0 when flex-grow/shrink are set. This has undesirable behavior when objects don't
end up flexing at all, and it's something the spec is going to eventually address.
        
For now, though, to fix the regression, I'm making a targeted "hack" to deliberately
violate the spec, but to do so as minimally as possible. This hack detects if there
is infinite available space on a line, and if so, it treats a flex-basis of 0 like
auto.
        
This means that when height is constrained and set by a container, flexing will do
the right thing. Basically any time you end up actually flexing, the spec behavior
should happen. If you're just laying out at intrinsic sizes, though, and no flexing
is going to occur, we ignore a flex-basis of 0 and just use the child's normal size.
        
Note that widths don't have to be patched because the preferred logical widths
algorithm is broken right now and not checking flex-basis. If it did, we'd have seen
the same bug in the width direction.
        
This width issue is covered by https://bugs.webkit.org/show_bug.cgi?id=116117
        
Reviewed by Simon Fraser.

Added fast/flexbox/auto-height-with-flex.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::mainAxisContentExtent):
Make sure we return LayoutUnit::max when you have infinite free space and not
max - borderPadding.

(WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild):
Only clear override size if it was set. Only mark for relayout if we did
an override size clear (i.e., if we were actually flexed). Add a new parameter,
hasInfiniteLineLength, that - if set - causes us to special case flex-basis:0
and treat it like flex-basis:auto.

(WebCore::RenderFlexibleBox::layoutFlexItems):
Define hasInfiniteLineLength and pass it to all the functions that need it.

(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
Remove the code that marks for layout and does a layout so early. This code
is moving (and changing) to preferredMainAxisContentExtentForChild.

(WebCore::RenderFlexibleBox::computeNextFlexLine):
Computes whether or not we have infinite line length now.

(WebCore::RenderFlexibleBox::freezeViolations):
(WebCore::RenderFlexibleBox::resolveFlexibleLengths):
Propagate hasInfiniteLineLength through to preferredMainAxisContentExtentForChild.

* rendering/RenderFlexibleBox.h:
(RenderFlexibleBox):
Add hasInfiniteLineLength parameter to a bunch of functions.

LayoutTests: REGRESSION (r147261): Many overlaid elements on united.com's account page
https://bugs.webkit.org/show_bug.cgi?id=116107
<rdar://problem/13690610> 

Reviewed by Simon Fraser.

* fast/flexbox/auto-height-with-flex-expected.html: Added.
* fast/flexbox/auto-height-with-flex.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Get rid of Gradient::getColor()
https://bugs.webkit.org/show_bug.cgi?id=116089

Patch by Benjamin Poulain <bpoulain@apple.com> on 2013-05-14
Reviewed by Andreas Kling.

This code is now useless, remove it.

* html/canvas/CanvasGradient.h:
(CanvasGradient):
* platform/graphics/Gradient.cpp:
(WebCore::Gradient::Gradient):
(WebCore::Gradient::hash):
* platform/graphics/Gradient.h:
(Gradient):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150088 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [Mac] Add a testing shim for secure event input functions
        https://bugs.webkit.org/show_bug.cgi?id=116122

        Reviewed by Mark Rowe.

        Added a new target with a dynamic library that interposes secure event input functions.
        We need this to avoid interfering with user session state.

        * Configurations/WebCoreTestShim.xcconfig: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mac/DynamicLinkerInterposing.h: Moved from Source/WebKit2/Shared/mac/DyldInterpose.h.
        * testing/WebCoreTestShimLibrary.cpp: Added.
        (shimEnableSecureEventInput):
        (shimDisableSecureEventInput):
        (shimIsSecureEventInputEnabled):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150089 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        [Mac] Add tests for secure event input
        https://bugs.webkit.org/show_bug.cgi?id=116121

        Reviewed by Mark Rowe.

        * editing/secure-input: Added.
        * editing/secure-input/password-input-changed-type-expected.txt: Added.
        * editing/secure-input/password-input-changed-type.html: Added.
        * editing/secure-input/password-input-focusing-expected.txt: Added.
        * editing/secure-input/password-input-focusing-to-different-frame-expected.txt: Added.
        * editing/secure-input/password-input-focusing-to-different-frame.html: Added.
        * editing/secure-input/password-input-focusing.html: Added.
        * editing/secure-input/removed-password-input-expected.txt: Added.
        * editing/secure-input/removed-password-input.html: Added.
        * editing/secure-input/reset-state-on-navigation-expected.txt: Added.
        * editing/secure-input/reset-state-on-navigation.html: Added.
        * editing/secure-input/resources: Added.
        * editing/secure-input/resources/reset-state-on-navigation-target.html: Added.
        * platform/efl/TestExpectations:
        * platform/gtk/TestExpectations:
        * platform/mac-wk2/TestExpectations:
        * platform/mac/TestExpectations:
        * platform/qt/TestExpectations:
        * platform/win/TestExpectations:
        * platform/wincairo/TestExpectations:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150090 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Improve Fatfinger phase.
https://bugs.webkit.org/show_bug.cgi?id=107403

Patch by Tiancheng Jiang <tijiang@rim.com> on 2013-05-14
Reviewed by Rob Buis.

Internally reviewed by Genevieve Mak.
BlackBerry PR 324965.

Cache and reuse intersected nodes as long as hit position has not been
changed.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::hitTestResult):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::findBestPoint):
(BlackBerry::WebKit::FatFingers::findIntersectingRegions):
(BlackBerry::WebKit::FatFingers::getNodesFromRect):
* WebKitSupport/FatFingers.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150091 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Windows] Identify proper run environment for scripts.
https://bugs.webkit.org/show_bug.cgi?id=116114

Reviewed by David Kilzer.

Determine (based on Visual Studio version) which path to use for
executables (bin versus bin32).

* Scripts/webkitdirs.pm:
(determineVisualStudioInstallDir): Added.
(determineVisualStudioVersion): Added.
(determineConfigurationProductDir): Modified to choose proper bin
or bin32 directory.
(visualStudioVersion): Added
(setupCygwinEnv): Modified to use new determineVisualStudioInstallDir


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150092 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[wk2] Not updating tiled backing coverage when main frame scrollability changes
https://bugs.webkit.org/show_bug.cgi?id=116123
<rdar://problem/13836559>

Reviewed by Simon Fraser.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
(TiledCoreAnimationDrawingArea):
Add updateMainFrameClipsToExposedRect.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
Remove m_clipsToExposedRect. We don't actually need it.

(WebKit::TiledCoreAnimationDrawingArea::mainFrameScrollabilityChanged):
Call updateMainFrameClipsToExposedRect so that we can always update
tiled backing coverage and can factor out our calls to setClipsToExposedRect.

(WebKit::TiledCoreAnimationDrawingArea::updateMainFrameClipsToExposedRect):
Factor out setClipsToExposedRect calls to here, and also call
FrameView::adjustTiledBackingCoverage so that the FrameView's tiled
backing is informed to allow overdraw in the UI-process-scrolling case.

(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
Use updateMainFrameClipsToExposedRect.

Export FrameView::adjustTiledBackingCoverage.

* WebCore.exp.in:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150093 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a preference that can disable the fake SYSV SHM shim
https://bugs.webkit.org/show_bug.cgi?id=116127
<rdar://problem/13810524>

Patch by Simon Cooper <scooper@apple.com> on 2013-05-14
Reviewed by Alexey Proskuryakov.

* PluginProcess/mac/PluginProcessShim.mm:
(WebKit::shim_disabled):
(WebKit::shim_shmdt):
(WebKit::shim_shmat):
(WebKit::shim_shmget):
(WebKit::shim_shmctl):

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