Text Autosizing: simplify and clean-up preOrderTraversal skipping containers
https://bugs.webkit.org/show_bug.cgi?id=107446

Patch by Tim Volodine <timvolodine@chromium.org> on 2013-01-26
Reviewed by Julien Chaffraix.

Simplify nextInPreOrderSkippingDescendantsOfContainers implementation
using RenderObject tree traversal methods.

No new tests because functionality is unchanged.

* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::nextInPreOrderSkippingDescendantsOfContainers):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move LegacyProcess entry points into new EntryPoint directories
https://bugs.webkit.org/show_bug.cgi?id=108008

Reviewed by Anders Carlsson.

Also refactors to remove the need for the overly general WebKitMain, by putting the
framework lazy loading into a helper function each legacy process can call (in ChildProcessMainBootstrapper.h)

* Configurations/NetworkProcess.xcconfig:
* Configurations/PluginProcess.xcconfig:
* Configurations/SharedWorkerProcess.xcconfig:
* Configurations/WebProcess.xcconfig:
* NetworkProcess/EntryPoint: Added.
* NetworkProcess/EntryPoint/mac: Added.
* NetworkProcess/EntryPoint/mac/LegacyProcess: Added.
* NetworkProcess/EntryPoint/mac/LegacyProcess/Info.plist: Copied from Source/WebKit2/NetworkProcess/Info.plist.
* NetworkProcess/EntryPoint/mac/LegacyProcess/NetworkProcessMain.mm: Copied from Source/WebKit2/NetworkProcess/mac/NetworkProcessMainMac.mm.
(NetworkProcessMain):
* NetworkProcess/EntryPoint/mac/LegacyProcess/NetworkProcessMainBootstrapper.cpp: Added.
(main):
* NetworkProcess/Info.plist: Removed.
* NetworkProcess/NetworkProcessMain.h: Removed.
* NetworkProcess/mac/NetworkProcessMainMac.mm: Removed.
* PluginProcess/EntryPoint: Added.
* PluginProcess/EntryPoint/mac: Added.
* PluginProcess/EntryPoint/mac/LegacyProcess: Added.
* PluginProcess/EntryPoint/mac/LegacyProcess/Info.plist: Copied from Source/WebKit2/PluginProcess/Info.plist.
* PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm: Copied from Source/WebKit2/PluginProcess/mac/PluginProcessMainMac.mm.
(PluginProcessMain):
* PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMainBootstrapper.cpp: Added.
(main):
* PluginProcess/Info.plist: Removed.
* PluginProcess/PluginProcessMain.h: Removed.
* PluginProcess/mac/PluginProcessMainMac.mm: Removed.
* Shared/EntryPointUtilities: Added.
* Shared/EntryPointUtilities/mac: Added.
* Shared/EntryPointUtilities/mac/LegacyProcess: Added.
* Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.h: Copied from Source/WebKit2/Shared/mac/ChildProcessMain.h.
* Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.mm: Copied from Source/WebKit2/Shared/mac/ChildProcessMain.mm.
* Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMainBootstrapper.h: Added.
(closeUnusedFileDescriptors):
(getBootstrapMainFunction):
* Shared/EntryPointUtilities/mac/XPCService: Added.
* Shared/mac/ChildProcessMain.h: Removed.
* Shared/mac/ChildProcessMain.mm: Removed.
* SharedWorkerProcess/EntryPoint: Added.
* SharedWorkerProcess/EntryPoint/mac: Added.
* SharedWorkerProcess/EntryPoint/mac/LegacyProcess: Added.
* SharedWorkerProcess/EntryPoint/mac/LegacyProcess/Info.plist: Copied from Source/WebKit2/SharedWorkerProcess/Info.plist.
* SharedWorkerProcess/EntryPoint/mac/LegacyProcess/SharedWorkerProcessMain.mm: Copied from Source/WebKit2/SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm.
(SharedWorkerProcessMain):
* SharedWorkerProcess/EntryPoint/mac/LegacyProcess/SharedWorkerProcessMainBootstrapper.cpp: Added.
(main):
* SharedWorkerProcess/Info.plist: Removed.
* SharedWorkerProcess/SharedWorkerProcessMain.h: Removed.
* SharedWorkerProcess/mac/SharedWorkerProcessMainMac.mm: Removed.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/EntryPoint/mac/LegacyProcess/Info.plist: Copied from Source/WebKit2/WebProcess/Info.plist.
* WebProcess/EntryPoint/mac/LegacyProcess/WebContentProcessMain.mm: Copied from Source/WebKit2/WebProcess/mac/WebProcessMainMac.mm.
(WebKit::WebContentProcessMainDelegate::WebContentProcessMainDelegate):
(WebKit):
(WebContentProcessMain):
* WebProcess/EntryPoint/mac/LegacyProcess/WebContentProcessMainBootstrapper.cpp: Added.
(main):
* WebProcess/Info.plist: Removed.
* WebProcess/WebKitMain.cpp: Removed.
* WebProcess/WebProcessMain.h: Removed.
* WebProcess/mac/WebProcessMainMac.mm: Removed.
* mac/MainMacProcess.cpp: Removed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140914 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Hoist command line parsing into ChildProcessMain
https://bugs.webkit.org/show_bug.cgi?id=108010

Reviewed by Dan Bernstein.

* NetworkProcess/EntryPoint/mac/LegacyProcess/NetworkProcessMain.mm:
(NetworkProcessMain):
* PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
(PluginProcessMain):
* Shared/EntryPointUtilities/mac/LegacyProcess/ChildProcessMain.h:
(WebKit::ChildProcessMain):
* SharedWorkerProcess/EntryPoint/mac/LegacyProcess/SharedWorkerProcessMain.mm:
(SharedWorkerProcessMain):
* WebProcess/EntryPoint/mac/LegacyProcess/WebContentProcessMain.mm:
(WebContentProcessMain):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140915 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt]Qt build fix
https://bugs.webkit.org/show_bug.cgi?id=108013

Changes on process initialization classes broke webkit building with Qt5. This
patch fix it.

Patch by Adenilson Cavalcanti <cavalcantii@gmail.com> on 2013-01-26
Reviewed by Sam Weinig.

* PluginProcess/qt/PluginProcessMainQt.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140916 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed fix after r140451 to make GIT-SVN repositories happy.

* WTF.vcproj/WTF.sln:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the test for CHANNEL_MESSAGING in idl files
https://bugs.webkit.org/show_bug.cgi?id=108006

Patch by Laszlo Gombos <l.gombos@samsung.com> on 2013-01-26
Reviewed by Alexey Proskuryakov.

No new tests, this is a build fix.

* workers/WorkerContext.idl: Make sure ENABLE_CHANNEL_MESSAGING is
defined before using it to be consitent with other guards inside idl
files.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140918 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Refactor XPCService initialization to make it easier to add more services
https://bugs.webkit.org/show_bug.cgi?id=108015

Reviewed by Dan Bernstein.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceBootstrapper.Development.h: Added.
(WebKit::XPCServiceEventHandler):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceBootstrapper.h: Added.
(WebKit::XPCServiceEventHandler):
Move bootstrapping to Shared (like we have for the legacy process). For now, we use
a macro to define the actual initialization point function to use, in the future, we
could consider alternatives, such as getting the function name from the bundle.

* WebKit2.xcodeproj/project.pbxproj:
Update files.

* WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebContentServiceMain.Development.mm:
* WebProcess/EntryPoint/mac/XPCService/WebContentService/WebContentServiceMain.mm:
Simplify to use the new XPCServiceBootstrapper.

* WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm: Copied from Source/WebKit2/WebProcess/mac/WebProcessServiceEntryPoints.mm.
(initializeWebContentService):
* WebProcess/mac/WebProcessServiceEntryPoints.h: Removed.
* WebProcess/mac/WebProcessServiceEntryPoints.mm: Removed.
Move the entry point to where it belongs and extract the bootstrapping parts.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the development build.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceBootstrapper.Development.h:
(WebKit::XPCServiceEventHandler):
Use the right stringizer.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140920 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Remove code for handling NetworkProcess authentication challenges in WebProcess
        https://bugs.webkit.org/show_bug.cgi?id=108003

        Reviewed by Sam Weinig.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140921 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Simplify environment creation in XPC service re-exec
https://bugs.webkit.org/show_bug.cgi?id=108017

Reviewed by Dan Bernstein.

* Shared/EntryPointUtilities/mac/XPCService/XPCServiceBootstrapper.Development.h:
(WebKit::XPCServiceEventHandler):
There is no need to copy these strings.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140922 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r140880.
http://trac.webkit.org/changeset/140880
https://bugs.webkit.org/show_bug.cgi?id=108023

Caused mathml/presentation and tests to crash and fail
(Requested by keishi on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2013-01-26

Source/WebCore:

* mathml/MathMLTextElement.cpp:
* mathml/MathMLTextElement.h:
(MathMLTextElement):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::RenderMathMLBlock):
(WebCore::RenderMathMLBlock::computePreferredLogicalWidths):
(WebCore):
(WebCore::RenderMathMLBlock::computeChildrenPreferredLogicalHeights):
(WebCore::RenderMathMLBlock::preferredLogicalHeightAfterSizing):
* rendering/mathml/RenderMathMLBlock.h:
(RenderMathMLBlock):
(WebCore::RenderMathMLBlock::isPreferredLogicalHeightDirty):
(WebCore::RenderMathMLBlock::preferredLogicalHeight):
(WebCore::RenderMathMLBlock::setPreferredLogicalHeight):
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::makeFences):
(WebCore::RenderMathMLFenced::styleDidChange):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
(WebCore):
(WebCore::RenderMathMLOperator::glyphHeightForCharacter):
(WebCore::RenderMathMLOperator::updateFromElement):
(WebCore::RenderMathMLOperator::createGlyph):
(WebCore::RenderMathMLOperator::firstLineBoxBaseline):
* rendering/mathml/RenderMathMLOperator.h:
(RenderMathMLOperator):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::index):
(WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
(WebCore):
(WebCore::RenderMathMLRoot::layout):
* rendering/mathml/RenderMathMLRoot.h:
(RenderMathMLRoot):
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::computePreferredLogicalWidths):
(WebCore::RenderMathMLRow::layout):
* rendering/mathml/RenderMathMLRow.h:
(RenderMathMLRow):

LayoutTests:

* mathml/differentiable-manifold.html: Removed.
* platform/chromium-linux/mathml/differentiable-manifold-expected.png: Removed.
* platform/chromium-linux/mathml/differentiable-manifold-expected.txt: Removed.
* platform/chromium-linux/mathml/presentation/fenced-expected.txt:
* platform/chromium-linux/mathml/presentation/fenced-mi-expected.png:
* platform/chromium-linux/mathml/presentation/fenced-mi-expected.txt:
* platform/chromium-linux/mathml/presentation/mo-expected.txt:
* platform/chromium-linux/mathml/presentation/mo-stretch-expected.png:
* platform/chromium-linux/mathml/presentation/mo-stretch-expected.txt:
* platform/chromium-linux/mathml/presentation/over-expected.txt:
* platform/chromium-linux/mathml/presentation/row-alignment-expected.txt:
* platform/chromium-linux/mathml/presentation/row-expected.png:
* platform/chromium-linux/mathml/presentation/row-expected.txt:
* platform/chromium-linux/mathml/presentation/sub-expected.png:
* platform/chromium-linux/mathml/presentation/sub-expected.txt:
* platform/chromium-linux/mathml/presentation/subsup-expected.txt:
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140923 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for running the networking process as an XPCService
https://bugs.webkit.org/show_bug.cgi?id=108025

Reviewed by Dan Bernstein.

* Configurations/NetworkService.Development.xcconfig: Copied from Source/WebKit2/Configurations/WebContentService.Development.xcconfig.
* Configurations/NetworkService.xcconfig: Copied from Source/WebKit2/Configurations/WebContentService.xcconfig.
Add configurations.

* NetworkProcess/EntryPoint/mac/XPCService: Added.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService: Added.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development: Added.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/Info.plist: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/Info.plist.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService.Development/NetworkServiceMain.Development.mm: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService.Development/WebContentServiceMain.Development.mm.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/Info.plist.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkService/NetworkServiceMain.mm: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentService/WebContentServiceMain.mm.
* NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm: Copied from Source/WebKit2/WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm.
(initializeNetworkService):
Add entry points.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
(WebKit::connectToServiceForDevelopment):
(WebKit::createServiceForDevelopment):
(WebKit::createService):
(WebKit::createProcess):
(WebKit::ProcessLauncher::launchProcess):
Rework service creation to work for arbitrary services.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::~NetworkProcessProxy):
(WebKit::NetworkProcessProxy::getLaunchOptions):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/mac/NetworkProcessProxyMac.mm:
(WebKit::shouldUseXPC):
(WebKit::NetworkProcessProxy::platformGetLaunchOptions):
Opt into xpc using the same rules as the WebProcess.

* WebKit2.xcodeproj/project.pbxproj:
Update files.

* WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
(initializeWebContentService):
Fix the comment to refer to the shim correctly.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Don't use goma to preprocess bindings idl files
https://bugs.webkit.org/show_bug.cgi?id=107984

Reviewed by Adam Barth.

On Linux and Mac, use a local gcc or clang to preprocess the bindings idl files.
On my machine, this drops the bindings generation from 137s to 24s when
using goma and -j400.

No new tests, this is a build change.

* WebCore.gyp/WebCore.gyp: Force the use of the local gcc or clang for preprocessing.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140925 268f45cc-cd09-0410-ab3c-d52691b4dbfc
        Use shared ChildProcess code to enter plug-in sandbox.

        Reviewed by Sam Weinig.

        There is one known behavior change from this refactoring: getpwuid_r is used
        instead of NSHomeDirectory for home directory, mathcing other client processes.

        * PluginProcess/PluginProcess.cpp: (WebKit::PluginProcess::enterSandbox):
        * PluginProcess/PluginProcess.h:
        PluginProcess prevents ChildProcess attempt to enter the sandbox immediately on
        launch for now, because we don't have a sandbox profile directory path yet.
        It now keeps a copy of ChildProcessInitializationParameters, so that
        ChildProcess::initializeSandbox() could be called later.

        * PluginProcess/mac/PluginProcessMac.mm:
        (WebKit::PluginProcess::platformInitializeProcess): Store a copy of ChildProcessInitializationParameters
        for later.
        (WebKit::loadSandboxProfile): Build a sandbox profile from a common prefix and
        a plugin-specific part.
        (WebKit::PluginProcess::platformInitializePluginProcess): We can enter the sandbox now.
        (WebKit::PluginProcess::enterSandbox): Prepare SandboxInitializationParameters,
        and call ChildProcess::initializeSandbox().

        * Shared/mac/ChildProcessMac.mm:
        (WebKit::ChildProcess::initializeSandbox): Actually handle system directory suffix
        from parameters.

        * WebKit2.xcodeproj/project.pbxproj:
        * WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.h: Removed.
        * WebProcess/Plugins/Netscape/mac/NetscapeSandboxFunctions.mm: Removed.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140926 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Check notification permissions in the show() method
https://bugs.webkit.org/show_bug.cgi?id=108009

Reviewed by Adam Barth.

Source/WebCore:

Tests: fast/notifications/notifications-constructor-with-permission.html
       fast/notifications/notifications-constructor-without-permission.html

* Modules/notifications/Notification.cpp:
(WebCore::Notification::show):
(WebCore::Notification::taskTimerFired):

LayoutTests:

* fast/notifications/notifications-constructor-with-permission-expected.txt: Added.
* fast/notifications/notifications-constructor-with-permission.html: Added.
* fast/notifications/notifications-constructor-without-permission-expected.txt: Added.
* fast/notifications/notifications-constructor-without-permission.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140927 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] add missing plumbing for Notification.requestPermission
https://bugs.webkit.org/show_bug.cgi?id=108012

Reviewed by Adam Barth.

Source/WebKit/chromium:

* src/NotificationPresenterImpl.cpp:
(WebKit):
(WebKit::VoidCallbackClient::VoidCallbackClient):
(NotificationPermissionCallbackClient):
(WebKit::NotificationPermissionCallbackClient::NotificationPermissionCallbackClient):
(WebKit::NotificationPermissionCallbackClient::permissionRequestComplete):
(WebKit::NotificationPermissionCallbackClient::~NotificationPermissionCallbackClient):
(WebKit::NotificationPresenterImpl::requestPermission):
* src/NotificationPresenterImpl.h:
(NotificationPresenterImpl):

LayoutTests:

* fast/notifications/notifications-constructor-request-permission-expected.txt: Added.
* fast/notifications/notifications-constructor-request-permission.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add support for launching WebKit2 plugins using XPC
https://bugs.webkit.org/show_bug.cgi?id=108040

Reviewed by Dan Bernstein.

* Configurations/PluginService.32.xcconfig: Copied from Source/WebKit2/Configurations/WebContentService.xcconfig.
* Configurations/PluginService.64.xcconfig: Copied from Source/WebKit2/Configurations/WebContentService.xcconfig.
* Configurations/PluginService.Development.xcconfig: Copied from Source/WebKit2/Configurations/WebContentService.xcconfig.
Add configurations.

* PluginProcess/EntryPoint/mac/XPCService: Added.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32: Added.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32/Info.plist: Copied from Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32/PluginService.32.Main.mm: Copied from Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/NetworkServiceMain.mm.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.64: Added.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.64/Info.plist: Copied from Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info.plist.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.64/PluginService.64.Main.mm: Copied from Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkService/NetworkServiceMain.mm.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.Development: Added.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/Info.plist: Added.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.Development/PluginService.Development.Main.mm: Added.
(main):
* PluginProcess/EntryPoint/mac/XPCService/PluginServiceEntryPoint.mm: Copied from Source/WebKit2/NetworkProcess/EntryPoint/mac/XPCService/NetworkServiceEntryPoint.mm.
(initializePluginService):
Add entry points.

* UIProcess/Launcher/mac/ProcessLauncherMac.mm:
(WebKit::serviceName):
Add plugin process service names and move into correct #ifdef.

* UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
(WebKit::shouldUseXPC):
(WebKit::PluginProcessProxy::platformInitializeLaunchOptions):
Opt into xpc using the same rules as the WebProcess.

* WebKit2.xcodeproj/project.pbxproj:
Add files.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140929 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fixing atomicIncrement implementation for Windows by dropping support before XP SP2.
https://bugs.webkit.org/show_bug.cgi?id=106740

Patch by Zoltan Arvai <zarvai@inf.u-szeged.hu> on 2013-01-27
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

* config.h:

Source/WebCore:

* WebCorePrefix.h:
* config.h:

Source/WebKit/win:

* WebKitPrefix.h:

Source/WebKit2:

* config.h:

Source/WTF:

Adding int64_t type atomicIncrement and atomicDecrement implementations for Windows
into Atomics.h required by WebKit2 after r139514. Separating WinCE implementation
that does not support WebKit2 and has no support for 64 bit interlocked methods.

Increasing WINVER and _WIN32_WINNT to XP SP2, because the 64 bit type interlocked methods
are not supported on previous versions on 32 bit target.

* config.h:
* wtf/Atomics.h:
(WTF):
(WTF::atomicIncrement):
(WTF::atomicDecrement):

Tools:

* DumpRenderTree/config.h:
* WinLauncher/stdafx.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Elements must be reattached when inserted/removed from top layer
https://bugs.webkit.org/show_bug.cgi?id=105489

Relanding r139402 as the apparent perf regression has been explained as not real (bug 106726).

Reviewed by Julien Chaffraix.

Source/WebCore:

Ensure a reattach occurs when an element is inserted/removed from top layer, so its renderer can be inserted correctly:
as a child of RenderView in top layer sibling order if it's in the top layer, and in the usual place otherwise.

We previously relied on style recalc to catch when an element is inserted/removed from the top layer, because it
only happens on dialog.show/close which toggle display: none. But that is incorrect because, for example, close()
followed immediately by show() results in no style change.

Tests: fast/dom/HTMLDialogElement/removed-element-is-removed-from-top-layer.html
       fast/dom/HTMLDialogElement/top-layer-stacking-correct-order-remove-readd.html

* dom/Element.cpp:
(WebCore::Element::removedFrom): Call Document::removeFromTopLayer to let the element be removed from the top layer vector.
removeFromTopLayer calls Element::setIsInTopLayer(false) itself if needed.
(WebCore::Element::setIsInTopLayer): Ensure a reattach occurs if the element is already attached.

LayoutTests:

* fast/dom/HTMLDialogElement/removed-element-is-removed-from-top-layer-expected.html: Added.
* fast/dom/HTMLDialogElement/removed-element-is-removed-from-top-layer.html: Added.
This tests that a top layer element removed from the document does not reappear in the top layer if readded.
This test actually would pass before this patch, but just by good fortune (see bug).
* fast/dom/HTMLDialogElement/top-layer-stacking-correct-order-remove-readd-expected.html: Added.
* fast/dom/HTMLDialogElement/top-layer-stacking-correct-order-remove-readd.html: Added.
This tests that top layer ordering is correct after removing and readding an element to the top layer.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140931 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Attempt to fix expectation entry.

Unreviewed. Gardening.

* platform/chromium/TestExpectations:

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