Fix cross-direction stretch for replaced elements in column flexbox
https://bugs.webkit.org/show_bug.cgi?id=94604

Patch by Shezan Baig <shezbaig.wk@gmail.com> on 2012-08-23
Reviewed by Ojan Vafai.

Source/WebCore:

Moved the logic that constrains logical width by MinSize and MaxSize to
a new helper function called constrainLogicalWidthInRegionByMinMax.
This helper function is used from both computeLogicalWidthInRegion and
RenderFlexibleBox::applyStretchAlignmentToChild.

RenderFlexibleBox no longer checks for isMultiline when stretching
elements in a column flexbox. Instead, we now constrain the available
width by the child's min-width and max-width, and set the override
width only if that constrained width is different from the child's
current logicalWidth.

No new tests. The existing css3/flexbox/flexitem.html test was extended
to exercise the new code.

* rendering/RenderBox.cpp:
(WebCore::RenderBox::constrainLogicalWidthInRegionByMinMax): New helper
method to constrain logical width by min-width and max-width.
(WebCore):
(WebCore::RenderBox::computeLogicalWidthInRegion): Changed to use the
new constrainLogicalWidthInRegionByMinMax helper method.
* rendering/RenderBox.h:
(RenderBox):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Changed to
use constrainLogicalWidthInRegionByMinMax to determine the override
width for the child.

LayoutTests:

Fixed failing test cases. Add tests for min/max width/height.

* css3/flexbox/flexitem-expected.txt:
* css3/flexbox/flexitem.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[BlackBerry] Add a check to filter out cookies that tries to set the domain to a top level domain
https://bugs.webkit.org/show_bug.cgi?id=94722

Patch by Otto Derek Cheung <otcheung@rim.com> on 2012-08-23
Reviewed by Rob Buis.

Changing the topleveldomain method name for better readability.

Also renaming the TopLevelDomain.h in platform to DomainTools
because there exists other tests that should belong in the same file.

Only changing method names and include file names.

* platform/blackberry/CookieParser.cpp:
(WebCore::CookieParser::parseOneCookie):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126504 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Autogenerate Opcode definitions
https://bugs.webkit.org/show_bug.cgi?id=94840

Reviewed by Gavin Barraclough.

Start the process of autogenerating the code emission for the bytecode.
We'll just start with automatic generation of the list of Opcodes as that
requires the actual definition of the opcodes, and the logic for parsing
them.

Due to some rather annoying dependency cycles, this initial version has
the OpcodeDefinitions.h file checked into the tree, although with some
work I hope to be able to fix that.

* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/Opcode.h:
  Include OpcodeDefinitions.h as our definitive source of info
  about the opcodes.
* bytecode/OpcodeDefinitions.h: Added.
  Autogenerated file
* bytecode/opcodes: Added.
  The new opcode definition file
* opcode_definition_generator.py: Added.
(generateOpcodeDefinition):
(generate):
  Module that generates the content for OpcodeDefinitions.h
* opcode_generator.py: Added.
(printUsage):
(main):
  Driver script
* opcode_parser.py: Added.
  Simple parser for the opcode definitions.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126505 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Remove V8Proxy.{h,cpp}
https://bugs.webkit.org/show_bug.cgi?id=94794

Reviewed by Dimitri Glazkov.

Now V8Proxy is no longer used. We can completely remove V8Proxy from the codebase.

No tests. No change in behavior.

Source/WebCore:

* UseV8.cmake:
* WebCore.gypi:
* bindings/scripts/CodeGeneratorV8.pm:
(GenerateImplementation):
(GenerateCallbackImplementation):
* bindings/scripts/test/V8/V8Float64Array.cpp:
* bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
* bindings/scripts/test/V8/V8TestCallback.cpp:
* bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
* bindings/scripts/test/V8/V8TestEventConstructor.cpp:
* bindings/scripts/test/V8/V8TestEventTarget.cpp:
* bindings/scripts/test/V8/V8TestException.cpp:
* bindings/scripts/test/V8/V8TestInterface.cpp:
* bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
* bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
* bindings/scripts/test/V8/V8TestNode.cpp:
* bindings/scripts/test/V8/V8TestObj.cpp:
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
* bindings/v8/ScriptController.cpp:
(WebCore::ScriptController::ScriptController):
(WebCore::ScriptController::~ScriptController):
(WebCore::ScriptController::callFunction):
(WebCore::ScriptController::clearWindowShell):
* bindings/v8/ScriptController.h:
(WebCore):
(ScriptController):
* bindings/v8/V8AbstractEventListener.h:
(WebCore):
* bindings/v8/V8Binding.cpp:
* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::reportFatalErrorInV8):
* bindings/v8/V8DOMWrapper.h:
(WebCore):
* bindings/v8/V8ObjectConstructor.cpp:
(WebCore::V8ObjectConstructor::newInstanceInDocument):
* bindings/v8/V8Proxy.cpp: Removed.
* bindings/v8/V8Proxy.h: Removed.
* bindings/v8/V8RecursionScope.h:
(WebCore):
* bindings/v8/V8Utilities.cpp:
* bindings/v8/custom/V8CustomXPathNSResolver.h:

Source/WebKit/chromium:

* src/ChromeClientImpl.cpp:
* src/WebBindings.cpp:
* src/WebDOMMessageEvent.cpp:
* src/WebDevToolsAgentImpl.cpp:
* src/WebMediaPlayerClientImpl.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126506 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r126483.
http://trac.webkit.org/changeset/126483
https://bugs.webkit.org/show_bug.cgi?id=92272

Caused two Chromium browser_tests to time out 100% reliably.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):
(WebCore::FrameLoader::prepareForLoadStart):
(WebCore::FrameLoader::clearProvisionalLoad):
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
(WebCore::FrameLoader::detachFromParent):
* loader/FrameLoader.h:
(FrameLoader):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Just added comments I forgot to add in r126506.

* bindings/v8/ScriptController.h:
(WebCore):
(ScriptController):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126508 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add saturation arithmetic support to FractionalLayoutUnit
https://bugs.webkit.org/show_bug.cgi?id=94364

Reviewed by Benjamin Poulain.

Source/WebCore:

Add experimental saturation arithmetic support to FractionalLayoutUnit,
guarded by a flag.
The idea here is to saturate (or clamp) rather than overflow when
computing positions and sizes.

No new tests for WebCore, not enabled by default.

* platform/FractionalLayoutUnit.h:
(WebCore::FractionalLayoutUnit::intMinForLayoutUnit):
Use INT_MIN instead of -INT_MAX to compute minimum value as the two are
not the same.

(WebCore::FractionalLayoutUnit::FractionalLayoutUnit):
(WebCore::FractionalLayoutUnit::fromFloatCeil):
(WebCore::FractionalLayoutUnit::fromFloatFloor):
(WebCore::FractionalLayoutUnit::fromFloatRound):
(WebCore::FractionalLayoutUnit::setValue):
Add range checks.

(WebCore::operator*):
(WebCore::operator+):
(WebCore::operator-):
(WebCore::operator+=):
(WebCore::operator-=):
Use the saturatedAddition and saturatedSubtraction functions, which have
been optimized to reduce branching, instead of range checks for the most
common operators.

Source/WTF:

Add support functions for saturated addition and subtraction.

Test: TestWebKitAPI/Tests/WTF/SaturatedArithmeticOperations.cpp

* GNUmakefile.list.am:
* WTF.gypi:
* WTF.pro:
* WTF.vcproj/WTF.vcproj:
* WTF.xcodeproj/project.pbxproj:
* WTF/wtf/CMakeLists.txt:
Add SaturatedArithmetic.h to build files.

* wtf/SaturatedArithmetic.h: Added.
(saturatedAddition):
(saturatedSubtraction):
Support functions for saturated addition/subtraction. Compares the signed
bit of the values instead of using range checks to reduce branching.

* wtf/Platform.h:
Add ENABLE_SATURATED_LAYOUT_ARITHMETIC flag.

Tools:

Add test for new saturatedArithmetic functions.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/GNUmakefile.am:
* TestWebKitAPI/TestWebKitAPI.gypi:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/SaturatedArithmeticOperations.cpp: Added.
(TestWebKitAPI):
(TestWebKitAPI::TEST):
* TestWebKitAPI/win/TestWebKitAPI.vcproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r126497.
http://trac.webkit.org/changeset/126497
https://bugs.webkit.org/show_bug.cgi?id=94764

Caused webkitpy-test step to start failing.

* Scripts/webkitpy/performance_tests/perftest.py:
(ReplayPerfTest.run_single):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Roll back in the part of r126475 that I had rolled out.

* wtf/FastMalloc.cpp:
(WTF): Disable the -Wunused-private-field warning around the declaration of
TCMalloc_Central_FreeListPadded since the padding is intentionally unused.
Only disable the warning if we detect it is enabled, since the warning may not
be supported by the version of Clang that is being used.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126511 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Replay tests take forever to load
https://bugs.webkit.org/show_bug.cgi?id=94764

Reviewed by Adam Barth.

Don't load about:blank at the beginning. This appears to clog the DRT.

* Scripts/webkitpy/performance_tests/perftest.py:
(ReplayPerfTest.run_single):
* Scripts/webkitpy/performance_tests/perftest_unittest.py:
(TestReplayPerfTest.test_run_single):
(TestReplayPerfTest.test_run_single_fails_when_output_has_error):



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