[CSS Regions] Inconsistent text selection behavior in regions
https://bugs.webkit.org/show_bug.cgi?id=76456

Patch by Raul Hudea <rhudea@adobe.com> on 2012-02-13
Reviewed by David Hyatt.

Source/WebCore:

Use the proper bounding rect when doing hit testing on flow threads.
Based on initial patch by Alexandru Chiculita.

Test: fast/regions/hit-test-region.html

* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::hitTestRegion):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTest):
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::nodeAtPoint):

LayoutTests:

* fast/regions/hit-test-region-expected.txt: Added.
* fast/regions/hit-test-region.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107605 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Refactor Mac platform implementation of the Pasteboard class to use Platform Strategies.
https://bugs.webkit.org/show_bug.cgi?id=78282

This patch removes any accesss to the NSPasteboard object from the Pasteboard class which
now makes use of a new pasteboardStrategy object that is implemented both in WebKit and
WebKit2. The actual access to NSPasteboard is now performed inside the PlatformPasteboard
class. Currently both WebKit and WebKit2 use the same implementation of the PasteboardStrategy
interface but this one more step in the direction of removing access to NSPasteboard from
the WebProcess.
As part of the refactoring the I've reduced to a minimum the use of OBJ-C classes.

Reviewed by Anders Carlsson.

No new tests. No change in behavior, just code refactoring.

* WebCore.exp.in: Added exported class PlatformPasteboard.
* WebCore.xcodeproj/project.pbxproj: Added new files to the build.
* editing/mac/EditorMac.mm:
(WebCore::Editor::writeSelectionToPasteboard): New method signature that doesn't use OBJ-C types.
* platform/Pasteboard.h:

* platform/PasteboardStrategy.h: Added PasteboardStrategy abstract class.
* platform/PlatformPasteboard.h: Added. This class implements access to NSPasteboard.
* platform/PlatformStrategies.h:
(WebCore::PlatformStrategies::pasteboardStrategy): Added.
* platform/mac/DragDataMac.mm:
(WebCore::DragData::canSmartReplace):
(WebCore::insertablePasteboardTypes): 
(WebCore::DragData::asURL):
* platform/mac/PasteboardMac.mm:
(WebCore::selectionPasteboardTypes): Changed to use Vector<String> instead of NSArray.
(WebCore::writableTypesForURL): Ditto.
(WebCore::createWritableTypesForImage): Ditto.
(WebCore::writableTypesForImage): Ditto.
(WebCore::Pasteboard::Pasteboard): Removed access to NSPasteboard.
(WebCore::Pasteboard::clear): Modified to use platformStrategies()->pasteboardStrategy().
(WebCore::Pasteboard::writeSelectionForTypes): Ditto.
(WebCore::Pasteboard::writePlainText): Ditto.
(WebCore::Pasteboard::writeSelection): Ditto.
(WebCore::writeURLForTypes): Ditto.
(WebCore::Pasteboard::writeURL): Ditto.
(WebCore::writeFileWrapperAsRTFDAttachment): Ditto.
(WebCore::Pasteboard::writeImage): Ditto.
(WebCore::Pasteboard::writeClipboard): Ditto.
(WebCore::Pasteboard::canSmartReplace): Ditto.
(WebCore::Pasteboard::plainText): Ditto.
(WebCore::documentFragmentWithRTF): Ditto.
(WebCore::Pasteboard::documentFragment): Ditto.
* platform/mac/PlatformPasteboardMac.mm: Added.
(WebCore::PlatformPasteboard::PlatformPasteboard):
(WebCore::PlatformPasteboard::getTypes):
(WebCore::PlatformPasteboard::bufferForType):
(WebCore::PlatformPasteboard::getPathnamesForType):
(WebCore::PlatformPasteboard::stringForType):
(WebCore::PlatformPasteboard::copy):
(WebCore::PlatformPasteboard::setTypes):
(WebCore::PlatformPasteboard::setBufferForType):
(WebCore::PlatformPasteboard::setPathnamesForType):
(WebCore::PlatformPasteboard::setStringForType):

Source/WebKit/mac:  Refactor Mac platform implementation of the Pasteboard class to use Platform Strategies.
 https://bugs.webkit.org/show_bug.cgi?id=78282
 
 This patch removes any accesss to the NSPasteboard object from the Pasteboard class which
 now makes use of a new pasteboardStrategy object that is implemented both in WebKit and
 WebKit2. The actual access to NSPasteboard is now performed inside the PlatformPasteboard
 class. Currently both WebKit and WebKit2 use the same implementation of the PasteboardStrategy
 interface but this one more step in the direction of removing access to NSPasteboard from
 the WebProcess.
 As part of the refactoring the I've reduced to a minimum the use of OBJ-C classes.
         
 Reviewed by Anders Carlsson.
 
 * WebCoreSupport/WebPlatformStrategies.h: Added PasteboardStrategy.
 * WebCoreSupport/WebPlatformStrategies.mm: Added implementation of PasteboardStrategy interface.
 (WebPlatformStrategies::createPasteboardStrategy):
 (WebPlatformStrategies::getTypes):
 (WebPlatformStrategies::bufferForType):
 (WebPlatformStrategies::getPathnamesForType):
 (WebPlatformStrategies::stringForType):
 (WebPlatformStrategies::copy):
 (WebPlatformStrategies::setTypes):
 (WebPlatformStrategies::setBufferForType):
 (WebPlatformStrategies::setPathnamesForType):
 (WebPlatformStrategies::setStringForType):

Source/WebKit/qt: Refactor Mac platform implementation of the Pasteboard class to use Platform Strategies.
https://bugs.webkit.org/show_bug.cgi?id=78282

Build fix. Unreviewed.

* WebCoreSupport/PlatformStrategiesQt.cpp:
(WebPlatformStrategies::createPasteboardStrategy):
* WebCoreSupport/PlatformStrategiesQt.h:
(PlatformStrategiesQt):

Source/WebKit2: Refactor Mac platform implementation of the Pasteboard class to use Platform Strategies.
https://bugs.webkit.org/show_bug.cgi?id=78282

This patch removes any accesss to the NSPasteboard object from the Pasteboard class which
now makes use of a new pasteboardStrategy object that is implemented both in WebKit and
WebKit2. The actual access to NSPasteboard is now performed inside the PlatformPasteboard
class. Currently both WebKit and WebKit2 use the same implementation of the PasteboardStrategy
interface but this one more step in the direction of removing access to NSPasteboard from
the WebProcess.
As part of the refactoring the I've reduced to a minimum the use of OBJ-C classes.

Reviewed by Anders Carlsson.

* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp: Added implementation of PasteboardStrategy
interface.
(WebKit::WebPlatformStrategies::createPasteboardStrategy):
(WebKit::WebPlatformStrategies::getTypes):
(WebKit::WebPlatformStrategies::bufferForType):
(WebKit::WebPlatformStrategies::getPathnamesForType):
(WebKit::WebPlatformStrategies::stringForType):
(WebKit::WebPlatformStrategies::copy):
(WebKit::WebPlatformStrategies::setTypes):
(WebKit::WebPlatformStrategies::setBufferForType):
(WebKit::WebPlatformStrategies::setPathnamesForType):
(WebKit::WebPlatformStrategies::setStringForType):
* WebProcess/WebCoreSupport/WebPlatformStrategies.h: Added PasteboardStrategy.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
<rdar://problem/7196487> and https://bugs.webkit.org/show_bug.cgi?id=26777 Add https pages to the page cache in some cases

Reviewed by Anders Carlsson.

Source/WebCore:

Test: http/tests/navigation/https-in-page-cache.html

* history/PageCache.cpp:
(WebCore::PageCache::canCachePageContainingThisFrame): Allow HTTPS pages that do not specify cache-control: no-cache
  or cache-control: no-store into the page cache. This will match Firefox's behavior for HTTPS in their bfcache.

LayoutTests:

* http/tests/navigation/https-in-page-cache.html: Added.
* http/tests/navigation/https-in-page-cache-expected.txt: Added.
* http/tests/navigation/resources/https-in-page-cache-1.php: Added.
* http/tests/navigation/resources/https-in-page-cache-2.php: Added.
* http/tests/navigation/resources/https-in-page-cache-3.html: Added.

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

Source/WebCore: 

* WebCore.xcodeproj/project.pbxproj:

Source/WebKit/qt: 

* WebCoreSupport/PlatformStrategiesQt.cpp:
(PlatformStrategiesQt::createPasteboardStrategy):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Turn off edge antialiasing for tile cache tile layers
https://bugs.webkit.org/show_bug.cgi?id=78533
<rdar://problem/10710798>

Reviewed by Sam Weinig.

* platform/graphics/ca/mac/TileCache.mm:
(WebCore::TileCache::createTileLayer):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107609 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: [chromium] Implement Brightness and Contrast filters on composited
layers.  Fix Saturation filter.
https://bugs.webkit.org/show_bug.cgi?id=78527

Reviewed by Kenneth Russell.

Will be covered by existing tests in css3/filters, when enabled.

* platform/graphics/chromium/cc/CCRenderSurfaceFilters.cpp:
(WebCore::CCRenderSurfaceFilters::apply):

LayoutTests: Unskip the css3/filters tests, so we can get some baselines off the
bots.
https://bugs.webkit.org/show_bug.cgi?id=78527

Reviewed by Kenneth Russell.

* platform/chromium/test_expectations.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Incorrect children placement in multi-column layout.
https://bugs.webkit.org/show_bug.cgi?id=78160

Reviewed by David Hyatt.

Test: fast/multicol/span/clone-before-after-content-crash.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::clone): no longer need to take care of making
children noninline (remove fix r105769) since moveChild functions take
care of adding the child properly if type of children differ. this
function just makes sure to set the right value of childrenInline property.
(WebCore::RenderBlock::splitBlocks): similar to moveChild functions below.
(WebCore::RenderBlock::moveChildTo): when child is fullRemoveInsert (across
different parents, e.g clones), we should use addChild function to make sure
it handles the case of different type of children between fromBlock and
toBlock correctly (specifically making children non-inline/wrapping inline
children under anonymous blocks.).
(WebCore::RenderBlock::moveChildrenTo):
* rendering/RenderBlock.h:
(RenderBlock):
(WebCore::RenderBlock::moveAllChildrenTo): Rename to->toBlock.
(WebCore::RenderBlock::moveChildrenTo): Rename to->toBlock.

LayoutTests: Incorrect children placement in multi-column layout.
https://bugs.webkit.org/show_bug.cgi?id=78160

Reviewed by David Hyatt.

* fast/multicol/span/clone-before-after-content-crash-expected.txt: Added.
* fast/multicol/span/clone-before-after-content-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
NRWT's HTTP servers should support additional directories for resources
https://bugs.webkit.org/show_bug.cgi?id=78528

Reviewed by Eric Seidel.

This functionality will be used by the Chromium-Android port.

* Scripts/webkitpy/layout_tests/port/base.py:
(Port.to.start_http_server):
* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd.__init__):
* Scripts/webkitpy/layout_tests/servers/http_server.py:
(Lighttpd.__init__):
(Lighttpd._prepare_config):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107614 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r107582.
http://trac.webkit.org/changeset/107582
https://bugs.webkit.org/show_bug.cgi?id=78349

Broke three inspector interactive_ui_tests

Source/WebCore:

* English.lproj/localizedStrings.js:
* inspector/front-end/DebuggerPresentationModel.js:
(WebInspector.DebuggerPresentationModel.prototype.uiSourceCodes):
* inspector/front-end/ScriptsNavigator.js:
(WebInspector.ScriptsNavigator.prototype._removeUISourceCode.get while):
(WebInspector.ScriptsNavigator.prototype._removeUISourceCode):
(WebInspector.ScriptsNavigator.prototype._showScriptFoldersSettingChanged):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._uiSourceCodeAdded):
(WebInspector.ScriptsPanel.prototype._updateExecutionLine):
* inspector/front-end/Settings.js:
(WebInspector.ExperimentsSettings):
* inspector/front-end/SettingsScreen.js:
(WebInspector.SettingsScreen):

LayoutTests:

* http/tests/inspector/debugger-test.js:
(initialize_DebuggerTest):
* inspector/debugger/scripts-combobox-file-selector-history-expected.txt: Removed.
* inspector/debugger/scripts-combobox-file-selector-history.html: Removed.
* inspector/debugger/scripts-file-selector-expected.txt: Removed.
* inspector/debugger/scripts-file-selector.html: Removed.
* inspector/debugger/scripts-panel-expected.txt:
* inspector/debugger/scripts-panel.html:
* inspector/debugger/scripts-sorting-expected.txt:
* inspector/debugger/scripts-sorting.html:
* inspector/debugger/source-frame-count.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107615 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed gardening.  Rebaselining GPU results.

* platform/chromium-gpu-linux/media/controls-after-reload-expected.png:
* platform/chromium-gpu-linux/media/controls-strict-expected.png:
* platform/chromium-gpu-linux/media/controls-styling-expected.png:
* platform/chromium-gpu-linux/media/controls-without-preload-expected.png:
* platform/chromium-gpu-linux/media/video-aspect-ratio-expected.png:
* platform/chromium-gpu-linux/media/video-canvas-alpha-expected.png:
* platform/chromium-gpu-linux/media/video-controls-rendering-expected.png:
* platform/chromium-gpu-linux/media/video-display-toggle-expected.png:
* platform/chromium-gpu-linux/media/video-layer-crash-expected.png:
* platform/chromium-gpu-linux/media/video-playing-and-pause-expected.png:
* platform/chromium-gpu-linux/media/video-transformed-expected.png:
* platform/chromium-gpu-linux/media/video-volume-slider-expected.png:
* platform/chromium-gpu-linux/media/video-zoom-controls-expected.png:
* platform/chromium-gpu-linux/media/video-zoom-expected.png:
* platform/chromium-gpu-mac/media/controls-after-reload-expected.txt: Removed.
* platform/chromium-gpu-mac/media/video-controls-rendering-expected.png:
* platform/chromium-gpu-mac/media/video-playing-and-pause-expected.txt: Removed.
* platform/chromium-gpu-win/media/controls-strict-expected.txt: Removed.
* platform/chromium-gpu-win/media/controls-styling-expected.txt: Removed.
* platform/chromium-gpu-win/media/controls-without-preload-expected.txt: Removed.
* platform/chromium-gpu-win/media/video-controls-rendering-expected.png:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed gardening.  We don't need to pass
platform/win/inverted-colors/non-composited.html.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107617 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Let WebKit::initialize call InitWebCoreSystemInterface on mac.
https://bugs.webkit.org/show_bug.cgi?id=78246

This allows removing a bunch of code in chromium land (https://chromiumcodereview.appspot.com/9374020/),
and helps with the component build on mac (InitWebCoreSystemInterface is not an
exported function, and it shouldn't be).

Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm early-returns when it's
called twice, so it's safe to land this change, and remove the calls in client
code in a later CL.

Reviewed by Darin Fisher.

* src/WebKit.cpp:
(WebKit::initializeWithoutV8):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed, r107611 enabled layout tests in css3/filters,
but some are missing results.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107619 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add a skeleton ChromiumAndroid port to webkitpy
https://bugs.webkit.org/show_bug.cgi?id=78543

Reviewed by Eric Seidel.

This patch just adds an empty ChromiumAndroid port object to webkitpy
and wires it up to the factory objects.  An actual implementation will
follow.

* Scripts/webkitpy/layout_tests/port/chromium.py:
(ChromiumPort):
* Scripts/webkitpy/layout_tests/port/chromium_android.py: Added.
(ChromiumAndroidPort):
(ChromiumAndroidPort.__init__):
* Scripts/webkitpy/layout_tests/port/chromium_unittest.py:
(ChromiumPortTest.test_all_test_configurations):
* Scripts/webkitpy/layout_tests/port/factory.py:
(PortFactory):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed, skip http/tests/navigation/https-in-page-cache.html
because we don't enable the page cache in chromium.

* platform/chromium/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107621 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in RenderFlowThread::setRegionBoxesRegionStyle
https://bugs.webkit.org/show_bug.cgi?id=78298

Reviewed by David Hyatt.

Source/WebCore:

Test: fast/regions/set-box-style-in-region-crash.html

We have to make sure that anonymous block objects get their information in RenderFlowThread
removed properly.

* dom/Node.cpp:
(WebCore::Node::diff):
Correct a comment.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::collapseAnonymousBoxChild):
Remove the information for anonymous block from render flow thread.
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::removeFlowChildInfo):
(WebCore):
(WebCore::RenderFlowThread::setRegionRangeForBox):
Do not set region range if the flow thread does not have regions.
* rendering/RenderFlowThread.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::willBeDestroyed):
Add an assert to make sure that after we remove an object, there is no remaining info
in any render flow thread.

LayoutTests:

* fast/regions/set-box-style-in-region-crash-expected.txt: Added.
* fast/regions/set-box-style-in-region-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107622 268f45cc-cd09-0410-ab3c-d52691b4dbfc
nesting horizontal flexboxes is broken
https://bugs.webkit.org/show_bug.cgi?id=76867

Reviewed by David Hyatt.

Source/WebCore:

This is copied from RenderDeprecatedFlexibleBox and updated
for RenderFlexibleBox and to handle vertical writing mode.

Tests: css3/flexbox/preferred-widths-orthogonal.html
       css3/flexbox/preferred-widths.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computePreferredLogicalWidths):
* rendering/RenderFlexibleBox.cpp:
(WebCore::marginWidthForChild):
(WebCore):
(WebCore::RenderFlexibleBox::computePreferredLogicalWidths):
* rendering/RenderFlexibleBox.h:
(RenderFlexibleBox):

LayoutTests:

* css3/flexbox/floated-flexbox-expected.txt:
* css3/flexbox/line-wrapping.html:
The old results here were wrong because they wrapped the contents of each flex item.

* css3/flexbox/preferred-widths-expected.txt: Added.
* css3/flexbox/preferred-widths-orthogonal-expected.txt: Added.
* css3/flexbox/preferred-widths-orthogonal.html: Added.
* css3/flexbox/preferred-widths.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107624 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replace old strtod with new strtod
https://bugs.webkit.org/show_bug.cgi?id=68044

Reviewed by Geoffrey Garen.

* parser/Lexer.cpp: Added template argument. This version allows junk after numbers.
(JSC::::lex):
* runtime/JSGlobalObjectFunctions.cpp: Ditto.
(JSC::parseInt):
(JSC::jsStrDecimalLiteral):
* runtime/LiteralParser.cpp: Ditto.
(JSC::::Lexer::lexNumber):
* wtf/dtoa.cpp: Replaced old strtod with a new version that uses the new StringToDoubleConverter.
It takes a template argument to allow clients to determine statically whether it should allow 
junk after the numbers or not.
(WTF):
(WTF::strtod):
* wtf/dtoa.h:
(WTF):
* wtf/text/WTFString.cpp: Added template argument. This version does not allow junk after numbers.
(WTF::toDoubleType):


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

* WebCoreSupport/WebPlatformStrategies.cpp:
(WebPlatformStrategies::createPasteboardStrategy):
* WebCoreSupport/WebPlatformStrategies.h:
(WebPlatformStrategies):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash with button in multi-column layout.
https://bugs.webkit.org/show_bug.cgi?id=78378

Reviewed by David Hyatt.

Source/WebCore:

Button creates an anonymous wrapper and expects that new children
be added to its m_inner anonymous block. However, splitBlock code
incorrectly creates column blocks directly under the button.

Test: fast/multicol/span/split-flow-anonymous-wrapper-crash.html

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::containingColumnsBlock):
(WebCore::RenderBlock::columnsBlockForSpanningElement):

LayoutTests:

* fast/multicol/span/split-flow-anonymous-wrapper-crash-expected.txt: Added.
* fast/multicol/span/split-flow-anonymous-wrapper-crash.html: Added.


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