Color-profile property triggers assert
https://bugs.webkit.org/show_bug.cgi?id=101080

Reviewed by Dirk Schulze.

Source/WebCore:

CSSPropertyColorProfile is not handled in StyleResolver::applySVGProperty(), triggering the
unimplemented property assert. Adding a stub entry to avoid that.

Test: svg/css/color-profile-crash.html

* css/SVGCSSStyleSelector.cpp:
(WebCore::StyleResolver::applySVGProperty):

LayoutTests:

* svg/css/color-profile-crash-expected.txt: Added.
* svg/css/color-profile-crash.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133420 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt][WK2] setPlatformStrategies always asserts after r132744
https://bugs.webkit.org/show_bug.cgi?id=100838

Reviewed by Simon Hausmann.

Reland with build fixes.

Source/WebCore:

The problem here is that we use QWebSettings::clearMemoryCaches, a WebKit1 API
from the injected bundle, which calls initializeWebCoreQt and it sets the platform
strategies to the one for WebKit1. We should stop using WebKit1 API's from WebKit2
code. In order to keep the behavior, this patch adds exported helpers to WebCore
that can be used from DumpRenderTree and WebKitTestRunner. This is the same idea
as WebCoreTestSupport but these helpers are specific to Qt. Technically we could
add it to the WebKit1 API for the time being, but my goal was to move in the direction
of removing the WebKit1 dependency from WebKitTestRunner. We only build the file
in non production mode.

Basically covered by all tests.

* Target.pri:
* WebCore.pri: We need to link against fontconfig (only in non-production mode) since
initializeTestFonts uses it.
* platform/qt/QtTestSupport.cpp: Added. I choose GPL license because code from qwebsettings.cpp
is also under that.
(WebKit):
(WebKit::QtTestSupport::clearMemoryCaches): This is basically a copy of QWebSettings::clearMemoryCaches
without calling initializeWebCoreQt.
(WebKit::QtTestSupport::initializeTestFonts): I moved this code here as well now that we have to expose
symbols from WebCore anyway. The advantage is that now we don't have to build it twice and we don't need
additional files to forward it from the directory of DumpRenderTree for WebKitTestRunner.
I added a call to FontCace::invalidate in the case when the font set has been changed so that it will do
the job even if we would stop clearing all caches between tests. Also moved the call to
QFontDatabase::removeAllApplicationFonts from callers to here.
* platform/qt/QtTestSupport.h:
(WebKit):
(QtTestSupport):

Tools:

Turned test runners to use the new QtTestSupport.

* DumpRenderTree/qt/DumpRenderTree.pro:
* DumpRenderTree/qt/DumpRenderTreeMain.cpp:
(main):
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::open):
* DumpRenderTree/qt/QtInitializeTestFonts.h: Removed.
* MiniBrowser/qt/MiniBrowser.pro:
* QtTestBrowser/QtTestBrowser.pro:
* QtTestBrowser/qttestbrowser.cpp:
(LauncherApplication::handleUserOptions):
* WebKitTestRunner/InjectedBundle/Target.pri:
* WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp:
(WTR::activateFonts):
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp: Removed.
* WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h: Removed.
* WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp:
(WTR::TestRunner::platformInitialize):  Removed the comment from here
because it was just lying, apparently two times. First, it is not incorrect
to reinitialize our font set and clear font caches, it is what the tests
expect. Second, the use of QRawFont has nothing to do with the font cache.
* WebKitTestRunner/Target.pri:
* WebKitTestRunner/qt/main.cpp:
(main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Add a now-failing test.  Unreviewed.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unify transforms in WK2
https://bugs.webkit.org/show_bug.cgi?id=101051

Reviewed by Simon Hausmann.

Move our transforms into EwkViewImpl and use them
everywhere needed.

* UIProcess/API/efl/EwkViewImpl.cpp:
(EwkViewImpl::smartData):
(EwkViewImpl::transformFromScene):
(EwkViewImpl::transformToScene):
(EwkViewImpl::transformToScreen):
(EwkViewImpl::displayTimerFired):
* UIProcess/API/efl/EwkViewImpl.h:
(WebCore):
(EwkViewImpl):
(EwkViewImpl::pageViewportControllerClient):
(EwkViewImpl::pageViewportController):
* UIProcess/API/efl/ewk_view.cpp:
(_ewk_view_smart_mouse_wheel):
(_ewk_view_smart_mouse_down):
(_ewk_view_smart_mouse_up):
(_ewk_view_smart_mouse_move):
(ewk_view_feed_touch_event):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133423 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Missing ASCIILiteral in a place of accessibility
https://bugs.webkit.org/show_bug.cgi?id=101160

Reviewed by Darin Adler.

ASCIILiteral usage is being missed in a spot of accessibliity.

* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaTimeDisplay::accessibilityDescription):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133424 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Expose security origin to BundleFrame
https://bugs.webkit.org/show_bug.cgi?id=101139
<rdar://problem/12629900>

Reviewed by Darin Adler.

Create a WebSecurityOrigin instance, sharing the security origin instance
that comes directly from the frame's document. We can do this because the
WK2 API only retrieves information about the origin, and because those
results are returned as copies. The security origin holds no references
that could lead to a retain cycle, avoiding the possibility that the
injected bundle accidentally keeps something alive.

* Shared/API/c/WKSharedAPICast.h:
(WebKit::toCopiedAPI): Create copied API for WebCore::SecurityOrigin
instances.
* Shared/WebSecurityOrigin.h:
(WebKit::WebSecurityOrigin::create): Add a new create() function that
takes a PassRefPtr to a WebCore SecurityOrigin instance.
(WebKit::WebSecurityOrigin::createFromString): Refactor to use new create()
function.
(WebKit::WebSecurityOrigin::createFromDatabaseIdentifier): Refactor to
use new create() function.
(WebKit::WebSecurityOrigin::create): Refactor to use new create()
function.
* WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
(WKBundleFrameCopySecurityOrigin): Add function to retrieve the security
origin as a WK2 API object.
* WebProcess/InjectedBundle/API/c/WKBundleFrame.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r133416.
http://trac.webkit.org/changeset/133416
https://bugs.webkit.org/show_bug.cgi?id=101169

Broke world selection by right click (Requested by rniwa on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-11-04

Source/WebCore:

* page/EventHandler.cpp:
(WebCore::EventHandler::handleGestureForTextSelectionOrContextMenu):
(WebCore::EventHandler::sendContextMenuEvent):

LayoutTests:

* fast/events/touch/gesture/disabled-input-text-selection-expected.txt: Removed.
* fast/events/touch/gesture/disabled-input-text-selection.html: Removed.
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133426 268f45cc-cd09-0410-ab3c-d52691b4dbfc
BaseChooserOnlyDateAndTimeInputType should have BaseClickableWithKeyInputType behavior
https://bugs.webkit.org/show_bug.cgi?id=101039

Reviewed by Hajime Morita.

Add BaseClickableWithKeyInputType behavior to
BaseChooserOnlyDateAndTimeInputType. It means date/time input types
without ENABLE_INPUT_MULTIPLE_FIELDS_UI receive DOMActivate events by
pressing space or enter key. They're going to open a date/time chooser
by DOMActive event.

Because BaseChooserOnlyDateAndTimeInputType inherits from
BaseDateAndTimeInputType, it can't inherit
BaseClickableWithKeyInputType. So, this patch adds static helper
functions to BaseClickableWithKeyInputType, and
BaseChooserOnlyDateAndTimeInputType uses them.

This patch doesn't change behavior yet because Chromimum-Android port
intercepts user events and doesn't deliver them to date/time input
elements.

* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
Add an empty implementation with a FIXME comment.
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
Add BaseClickableWithKeyInputType behavior by a helper function.
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent): Ditto.
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent): Ditto.
(WebCore::BaseChooserOnlyDateAndTimeInputType::accessKeyAction): Ditto.
* html/BaseChooserOnlyDateAndTimeInputType.h:
(BaseChooserOnlyDateAndTimeInputType): Add function declarations.
* html/BaseClickableWithKeyInputType.cpp:
Add static helper functions, and existing member functions use them.
* html/BaseClickableWithKeyInputType.h:
(BaseClickableWithKeyInputType): Add declarations of the helper functions.
* html/InputType.h:
(InputType): Make dispatchSimulatedClickIfActive public because it is
called from a helper function.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Shadow] Implement custom pseudo-elements styling
https://bugs.webkit.org/show_bug.cgi?id=100812

Reviewed by Hajime Morita.

Source/WebCore:

Instead of using ElementRareData::m_shadowPseudoId, we use 'pseudo' attribute.

Later we would like to remove Element::shadowPseudoId and Element::setShadowPseudoId
and use pseudo()/setPseudo() instead (Bug 101171).

Test: fast/dom/shadow/styling-pseudo-attribute.html

* dom/Element.cpp:
(WebCore::Element::shadowPseudoId):
(WebCore::Element::setShadowPseudoId):
* dom/ElementRareData.cpp:
(WebCore::ElementRareData::reportMemoryUsage):
* dom/ElementRareData.h:
(ElementRareData):

LayoutTests:

* fast/dom/shadow/styling-pseudo-attribute-expected.html: Added.
* fast/dom/shadow/styling-pseudo-attribute.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Shadow DOM should be able to be disabled per context.
https://bugs.webkit.org/show_bug.cgi?id=101173

Reviewed by Dimitri Glazkov.

Source/WebCore:

This change pulls back relevant bits from r131549. Note that if
the the port enables runtime Shadow DOM flag, this can cause slow
down on some Chromium page cycler test cases (which r131549
attempted to fix).

This change is temporal and the flags should be switched back from
ContextFeatures to RuntimeEnabledFeatures once it gains sufficent
stability.

* dom/ContextFeatures.cpp:
(WebCore::ContextFeatures::shadowDOMEnabled):
(WebCore):
* dom/ContextFeatures.h:
* dom/Position.cpp:
(WebCore::Position::Position):
(WebCore::Position::findParent):
* dom/TreeScope.cpp:
(WebCore::TreeScope::getSelection):
* html/HTMLTagNames.in:
* html/shadow/HTMLContentElement.cpp:
(WebCore::HTMLContentElement::contentTagName):
* page/DOMWindow.idl:

Source/WebKit/chromium:

* src/ContextFeaturesClientImpl.cpp:
(WebKit::ContextFeaturesClientImpl::askIfIsEnabled):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133429 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Baseline JIT should use structure watchpoints whenever possible
https://bugs.webkit.org/show_bug.cgi?id=101146

Reviewed by Sam Weinig.

No speed-up yet except on toy programs. I think that it will start to show
speed-ups with https://bugs.webkit.org/show_bug.cgi?id=101147, which this is
a step towards.

* jit/JIT.h:
(JIT):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):
(JSC::JIT::addStructureTransitionCheck):
(JSC):
(JSC::JIT::testPrototype):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::privateCompilePutByIdTransition):
(JSC::JIT::privateCompileGetByIdProto):
(JSC::JIT::privateCompileGetByIdProtoList):
(JSC::JIT::privateCompileGetByIdChainList):
(JSC::JIT::privateCompileGetByIdChain):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][DRT] Skip a fast/images/repaint-subrect-grid.html test case after r133322
https://bugs.webkit.org/show_bug.cgi?id=101175

Unreviewed gardening.

fast/images/repaint-subrect-grid.html is failing on WK1 debug bot.

Patch by Jinwoo Song <jinwoo7.song@samsung.com> on 2012-11-04

* platform/efl-wk1/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Use _LIBRARIES instead of _LIBRARY
https://bugs.webkit.org/show_bug.cgi?id=101042

Patch by Halton Huo <halton.huo@intel.com> on 2012-11-04
Reviewed by Gyuyoung Kim.

In CMake Find files, _LIBRARY is intended for internal use, should
use _LIBRARIES instead.

Source/WebCore:

* PlatformEfl.cmake: s/_LIBRARY}/_LIBRARIES}

Source/WebKit:

* PlatformEfl.cmake: s/_LIBRARY}/_LIBRARIES}

Source/WebKit2:

* PlatformEfl.cmake: s/_LIBRARY}/_LIBRARIES}

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133432 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove obsolete tests for date/time input types
https://bugs.webkit.org/show_bug.cgi?id=98783

Reviewed by Kentaro Hara.

*-input-visible-string.html and *-stepup-stepdown-from-renderer.html are
unnecessary and should be removed because they depend on textfield
behavior, and the date/time input types no longer have textfield
behavior on any platforms.

* fast/forms/datetime/datetime-input-visible-string-expected.txt: Removed.
* fast/forms/datetime/datetime-input-visible-string.html: Removed.
* fast/forms/datetime/datetime-stepup-stepdown-from-renderer-expected.txt: Removed.
* fast/forms/datetime/datetime-stepup-stepdown-from-renderer.html: Removed.
* fast/forms/datetimelocal/datetimelocal-input-visible-string-expected.txt: Removed.
* fast/forms/datetimelocal/datetimelocal-input-visible-string.html: Removed.
* fast/forms/datetimelocal/datetimelocal-stepup-stepdown-from-renderer-expected.txt: Removed.
* fast/forms/datetimelocal/datetimelocal-stepup-stepdown-from-renderer.html: Removed.
* fast/forms/month/month-input-visible-string-expected.txt: Removed.
* fast/forms/month/month-input-visible-string.html: Removed.
* fast/forms/month/month-stepup-stepdown-from-renderer-expected.txt: Removed.
* fast/forms/month/month-stepup-stepdown-from-renderer.html: Removed.
* fast/forms/time/time-input-visible-string-expected.txt: Removed.
* fast/forms/time/time-input-visible-string.html: Removed.
* fast/forms/time/time-stepup-stepdown-from-renderer-expected.txt: Removed.
* fast/forms/time/time-stepup-stepdown-from-renderer.html: Removed.
* fast/forms/week/week-input-visible-string-expected.txt: Removed.
* fast/forms/week/week-input-visible-string.html: Removed.
* fast/forms/week/week-stepup-stepdown-from-renderer-expected.txt: Removed.
* fast/forms/week/week-stepup-stepdown-from-renderer.html: Removed.
* platform/chromium-android/fast/forms/time/time-stepup-stepdown-from-renderer-expected.txt: Removed.
* platform/chromium/TestExpectations:
* platform/chromium/fast/forms/datetime/datetime-input-visible-string-expected.txt: Removed.
* platform/chromium/fast/forms/datetime/datetime-stepup-stepdown-from-renderer-expected.txt: Removed.
* platform/chromium/fast/forms/datetimelocal/datetimelocal-input-visible-string-expected.txt: Removed.
* platform/chromium/fast/forms/datetimelocal/datetimelocal-stepup-stepdown-from-renderer-expected.txt: Removed.
* platform/chromium/fast/forms/month/month-input-visible-string-expected.txt: Removed.
* platform/chromium/fast/forms/month/month-stepup-stepdown-from-renderer-expected.txt: Removed.
* platform/chromium/fast/forms/time/time-input-visible-string-expected.txt: Removed.
* platform/chromium/fast/forms/time/time-stepup-stepdown-from-renderer-expected.txt: Removed.
* platform/chromium/fast/forms/week/week-input-visible-string-expected.txt: Removed.
* platform/chromium/fast/forms/week/week-stepup-stepdown-from-renderer-expected.txt: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Introduce Month class to calendar picker
https://bugs.webkit.org/show_bug.cgi?id=101024

Reviewed by Kent Tamura.

Source/WebCore:

Month class needs to be introduced to implement a month picker. This
patch just introduces the Month class into the calendar picker without
changing the current behavior.

No new tests. Covered by existing calendar-picker-*.html tests.

* Resources/pagepopups/calendarPicker.js:
(Month.prototype.toLocaleString): Returns a localized month string.
(Month): Takes a Month object, number representing the month, or year and month numbers.
(Month.parse): Returns a new Month from an ISO month string.
(Month.createFromDate): Returns a new Month containing the given datetime.
(Month.prototype.equals): Returns true if the given month is the same.
(Month.prototype.previous): Returns the previous month.
(Month.prototype.next): Returns the next month.
(Month.prototype.startDate): Returns a datetime that is the start of this month. The value is inclusive.
(Month.prototype.endDate): Returns a datetime that is the end of this month. The value is exclusive.
(Month.prototype.valueOf): Returns a number representing the month.
(Month.prototype.toString): Returns an ISO month string.
(YearMonthController): Use Month object.
(YearMonthController.prototype.attachTo): Year 275760 ends in September so use the year before to measure the label width.
(YearMonthController.prototype.setMonth): Take a month object.
(YearMonthController.prototype._redraw): Use ISO month string for element.dataset.value.
(YearMonthController.prototype._handleYearMonthChange):
(YearMonthController.prototype.moveRelatively):
(DaysTable): Use Month object.
(DaysTable.prototype._renderMonth): Take a month object. Testing for isNaN is moved up to fix a bug when showing September, 275760.
(DaysTable.prototype._navigateToMonth): Take a month object.
(DaysTable.prototype._navigateToMonthWithAnimation): Take a month object.
(DaysTable.prototype.navigateToMonthAndKeepSelectionPosition): Take a month object.
(DaysTable.prototype.selectDate):
(DaysTable.prototype._maybeSetPreviousMonth): Use Month object to calculate the previous month.
(DaysTable.prototype._maybeSetNextMonth): Use Month object to calculate the next month.

LayoutTests:

* platform/chromium-win/platform/chromium/fast/forms/calendar-picker/calendar-picker-key-operations-expected.txt:
* platform/chromium/fast/forms/calendar-picker/calendar-picker-key-operations-expected.txt:
* platform/chromium/fast/forms/calendar-picker/calendar-picker-key-operations.html: Adjust the expectation because we changed the month string format.
* platform/chromium/fast/forms/calendar-picker/calendar-picker-mouse-operations-expected.txt:
* platform/chromium/fast/forms/calendar-picker/calendar-picker-mouse-operations.html: Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133434 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Shadow] ShadowRoot should have a method to return ShadowRootType.
https://bugs.webkit.org/show_bug.cgi?id=101178

Reviewed by Hajime Morita.

When we style PseudoCustomElement, we have to know ShadowRootType.
We would like to expose a method to get ShadowRootType also in Release mode.

This is a preparation patch for Bug 101170.

* dom/ShadowRoot.h:
(ShadowRoot):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.

Adding failure expectations for accessibility/svg-remote-element,
fast/images/exif-orientation-image-document.html and
svg/animations/mozilla/animateMotion-mpath-targetChange-1.svg.
Rebaselining fast/images/repaint-subrect-grid.html, the new baseline
matches the one Mac port uses.

* platform/gtk/TestExpectations:
* platform/gtk/fast/images/repaint-subrect-grid-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133436 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening.

Skip a new failing test introduced in r133428, because SHADOW_DOM is disabled.
Unskip a test that does not exist already.

Patch by Nandor Huszka <hnandor@inf.u-szeged.hu> on 2012-11-04

* platform/qt/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133437 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [Canvas] do not blow up the capturing log
https://bugs.webkit.org/show_bug.cgi?id=100752

Patch by Andrey Adaikin <aandrey@chromium.org> on 2012-11-04
Reviewed by Pavel Feldman.

Source/WebCore:

Clear obsolete calls in the canvas 2D capturing log in runtime.
Now we store in the log only minimum number of calls that are necessary to replay a
canvas 2D context. To achieve that we find in runtime those calls in the log that no
longer contribute to the final context state and remove them.
These are the rules according which we find and remove such calls:
- all PATH methods between a clip() call and beginPath() call can be removed
- all MATRIX methods before a restore() or setTransform() call but after any PATH or corresponding save() method
- all consecutive save() + restore() calls

Tests: inspector/profiler/canvas2d/canvas2d-api-changes.html
       inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics.html

* inspector/InjectedScriptCanvasModuleSource.js:
(.):

LayoutTests:

Added test for track Canvas 2D API changes, as well as basics for the capturing.

* inspector/profiler/canvas-profiler-test.js: Renamed from LayoutTests/inspector/profiler/webgl/webgl-profiler-test.js.
(initialize_CanvasWebGLProfilerTest.InspectorTest.enableCanvasAgent):
(initialize_CanvasWebGLProfilerTest):
(createWebGLContext):
(createCanvas2DContext):
* inspector/profiler/canvas2d/canvas2d-api-changes-expected.txt: Added.
* inspector/profiler/canvas2d/canvas2d-api-changes.html: Added.
* inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics-expected.txt: Added.
* inspector/profiler/canvas2d/canvas2d-profiler-capturing-basics.html: Added.
* inspector/profiler/webgl/webgl-profiler-get-error.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133438 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix the collapsing border code to handle mixed directionality at the row level
https://bugs.webkit.org/show_bug.cgi?id=101060

Reviewed by Ojan Vafai.

Source/WebCore:

After bug 87900, we support mixed directionality at the row-group level. For coherency
- as the underlying code didn't support it - we were artificially ignoring 'direction'
below the row-group. This change relaxes the restriction and patches the collapsing
borders code to query the right style and border.

Tests: fast/table/border-collapsing/table-ltr-rows-mixed-direction.html
       fast/table/border-collapsing/table-rtl-row-mixed-direction.html

* rendering/RenderTable.cpp:
(WebCore::RenderTable::tableStartBorderAdjoiningCell):
(WebCore::RenderTable::tableEndBorderAdjoiningCell):
Changed to query the row's direction.

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::hasStartBorderAdjoiningTable):
(WebCore::RenderTableCell::hasEndBorderAdjoiningTable):
Added 2 helper functions. They determine if a specific cell's border
adjoins the table. This code is required as the last cell's end border
can be resolved against the start border.

(WebCore::RenderTableCell::computeCollapsedStartBorder):
(WebCore::RenderTableCell::computeCollapsedEndBorder):
Updated these functions now that being the start / end column doesn't mean
that we have to resolve against the row / row-group / table's border.

* rendering/RenderTableCell.h:
(WebCore::RenderTableCell::styleForCellFlow):
Updated to return the row's style.

* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::borderAdjoiningStartCell):
(WebCore::RenderTableRow::borderAdjoiningEndCell):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::borderAdjoiningStartCell):
(WebCore::RenderTableSection::borderAdjoiningEndCell):
Updated these functions to work with mixed directionality.

* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::setLogicalPositionForCell):
Changed this function to use the section's direction. This is wrong and should be changed
once we properly fix the collapsing border code.

(WebCore::RenderTableSection::logicalRectForWritingModeAndDirection):
Added a FIXME.

* rendering/style/CollapsedBorderValue.h:
(WebCore::CollapsedBorderValue::width):
This is a bug in our implementation: we used to return a non-zero width for inexistant borders (per CSS 2.1,
'border-style: off | hidden' should have a 0 width). This is covered by our existing tests (among others by
fast/table/border-collapsing/last-cell-left-border-hidden-table-ltr-section-rtl.html).

LayoutTests:

* fast/table/border-collapsing/table-ltr-rows-mixed-direction-expected.html: Added.
* fast/table/border-collapsing/table-ltr-rows-mixed-direction.html: Added.
* fast/table/border-collapsing/table-rtl-row-mixed-direction-expected.html: Added.
* fast/table/border-collapsing/table-rtl-row-mixed-direction.html: Added.


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