haikuwebkit/LayoutTests/resources/check-layout.js

217 lines
9.6 KiB
JavaScript
Raw Permalink Normal View History

check-layout.js should always dumpAsText https://bugs.webkit.org/show_bug.cgi?id=98959 Reviewed by Tony Chang. Every checkLayout test was already dumpAsText except for css3/flexbox/flex-item-child-overflow.html, which is a reftest and really doesn't need to be a checkLayout test. * css3/flexbox/auto-height-dynamic.html: * css3/flexbox/box-sizing-min-max-sizes.html: * css3/flexbox/box-sizing.html: * css3/flexbox/columns-auto-size.html: * css3/flexbox/columns-height-set-via-top-bottom.html: * css3/flexbox/flex-algorithm-min-max.html: * css3/flexbox/flex-algorithm-with-margins.html: * css3/flexbox/flex-algorithm.html: * css3/flexbox/flex-align-column.html: * css3/flexbox/flex-align-end.html: * css3/flexbox/flex-align-max.html: * css3/flexbox/flex-align-percent-height.html: * css3/flexbox/flex-align-stretch.html: * css3/flexbox/flex-align-vertical-writing-mode.html: * css3/flexbox/flex-align.html: * css3/flexbox/flex-flow-auto-margins.html: * css3/flexbox/flex-flow-border.html: * css3/flexbox/flex-flow-margins-auto-size.html: * css3/flexbox/flex-flow-margins.html: * css3/flexbox/flex-flow-orientations.html: * css3/flexbox/flex-flow-overflow.html: * css3/flexbox/flex-flow-padding.html: * css3/flexbox/flex-flow.html: * css3/flexbox/flex-item-child-overflow-expected.html: * css3/flexbox/flex-item-child-overflow.html: * css3/flexbox/flex-item-min-size.html: * css3/flexbox/flex-justify-content.html: * css3/flexbox/flex-no-flex.html: * css3/flexbox/flex-rounding.html: * css3/flexbox/flexitem-stretch-image.html: * css3/flexbox/flexitem.html: * css3/flexbox/floated-flexbox.html: * css3/flexbox/inline-flex.html: * css3/flexbox/line-wrapping.html: * css3/flexbox/multiline-align-content-horizontal-column.html: * css3/flexbox/multiline-align-content.html: * css3/flexbox/multiline-align-self.html: * css3/flexbox/multiline-column-auto.html: * css3/flexbox/multiline-justify-content.html: * css3/flexbox/multiline-reverse-wrap-overflow.html: * css3/flexbox/multiline.html: * css3/flexbox/nested-stretch.html: * css3/flexbox/orthogonal-flex-directions.html: * css3/flexbox/percent-margins.html: * css3/flexbox/percentage-heights.html: * css3/flexbox/percentage-sizes-quirks.html: * css3/flexbox/percentage-sizes.html: * css3/flexbox/perpendicular-writing-modes-inside-flex-item.html: * css3/flexbox/position-absolute-child.html: * css3/flexbox/position-absolute-children.html: * css3/flexbox/preferred-widths-orthogonal.html: * css3/flexbox/preferred-widths.html: * css3/flexbox/relayout-image-load.html: * css3/flexbox/style-change.html: * css3/flexbox/true-centering.html: * css3/flexbox/writing-modes.html: * fast/block/margins-perpendicular-containing-block.html: * fast/css-grid-layout/place-cell-by-index.html: * fast/css/deprecated-flexbox-auto-min-size.html: * fast/css/nested-percent-height-on-replaced.html: * fast/css/percentage-height-auto-sized-body-quirks.html: * fast/flexbox/flexing-overflow-scroll-item.html: * fast/replaced/vertical-writing-mode-max-logical-width-replaced.html: * fast/table/bad-replaced-sizing-preferred-logical-widths.html: * fast/table/margins-flipped-text-direction.html: * fast/table/margins-perpendicular-containing-block.html: * fast/writing-mode/percentage-height-orthogonal-writing-modes-quirks.html: * fast/writing-mode/percentage-height-orthogonal-writing-modes.html: * resources/check-layout.js: Canonical link: https://commits.webkit.org/116951@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@130979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-10-10 23:42:35 +00:00
if (window.testRunner)
testRunner.dumpAsText();
Move layout checking js script into LayoutTest/resources and generalize https://bugs.webkit.org/show_bug.cgi?id=91268 Reviewed by Ojan Vafai. flexbox.js contains helper scripts for verifying the size and position of nodes. I will be writing similar tests for grid, so move the js file into a location for sharing and generalize the script. * css3/flexbox/align-absolute-child.html: Change include path and call. * css3/flexbox/auto-height-dynamic.html: * css3/flexbox/columns-auto-size.html: * css3/flexbox/flex-algorithm-min-max.html: * css3/flexbox/flex-algorithm-with-margins.html: * css3/flexbox/flex-algorithm.html: * css3/flexbox/flex-align-column.html: * css3/flexbox/flex-align-end.html: * css3/flexbox/flex-align-max.html: * css3/flexbox/flex-align-percent-height.html: * css3/flexbox/flex-align-stretch.html: * css3/flexbox/flex-align-vertical-writing-mode.html: * css3/flexbox/flex-align.html: * css3/flexbox/flex-flow-auto-margins.html: * css3/flexbox/flex-flow-border.html: * css3/flexbox/flex-flow-margins-auto-size.html: * css3/flexbox/flex-flow-margins.html: * css3/flexbox/flex-flow-orientations.html: * css3/flexbox/flex-flow-overflow.html: * css3/flexbox/flex-flow-padding.html: * css3/flexbox/flex-flow.html: * css3/flexbox/flex-item-child-overflow.html: * css3/flexbox/flex-item-min-size.html: * css3/flexbox/flex-justify-content.html: * css3/flexbox/flex-no-flex.html: * css3/flexbox/flexitem.html: * css3/flexbox/floated-flexbox.html: * css3/flexbox/line-wrapping.html: * css3/flexbox/multiline-align-content-horizontal-column.html: * css3/flexbox/multiline-align-content.html: * css3/flexbox/multiline-align-self.html: * css3/flexbox/multiline-column-auto.html: * css3/flexbox/multiline-justify-content.html: * css3/flexbox/multiline-reverse-wrap-overflow.html: * css3/flexbox/multiline.html: * css3/flexbox/nested-stretch.html: * css3/flexbox/orthogonal-flex-directions.html: * css3/flexbox/perpendicular-writing-modes-inside-flex-item.html: * css3/flexbox/position-absolute-child.html: * css3/flexbox/preferred-widths-orthogonal.html: * css3/flexbox/preferred-widths.html: * css3/flexbox/style-change.html: * css3/flexbox/true-centering.html: * css3/flexbox/writing-modes.html: * resources/check-layout.js: Renamed from LayoutTests/css3/flexbox/resources/flexbox.js. (.): Rename checkFlexboxen to checkLayout that takes a CSS selector. Hide functions in a closure. Canonical link: https://commits.webkit.org/109095@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-13 19:58:47 +00:00
(function() {
2011-08-08 20:29:40 +00:00
function insertAfter(nodeToAdd, referenceNode)
{
Convert fast/css/positioned-overflow-scroll.html to a check-layout.js test https://bugs.webkit.org/show_bug.cgi?id=106585 Reviewed by Tony Chang. This is in preparation for adding more cases to this test. * fast/css/positioned-overflow-scroll-expected.txt: Added. * fast/css/positioned-overflow-scroll.html: * platform/chromium-android/fast/css/positioned-overflow-scroll-expected.png: Removed. * platform/chromium-android/fast/css/positioned-overflow-scroll-expected.txt: Removed. * platform/chromium-linux/fast/css/positioned-overflow-scroll-expected.png: Removed. * platform/chromium-mac-lion/fast/css/positioned-overflow-scroll-expected.png: Removed. * platform/chromium-mac-snowleopard/fast/css/positioned-overflow-scroll-expected.png: Removed. * platform/chromium-mac/fast/css/positioned-overflow-scroll-expected.png: Removed. * platform/chromium-win/fast/css/positioned-overflow-scroll-expected.png: Removed. * platform/chromium/fast/css/positioned-overflow-scroll-expected.txt: Removed. * platform/efl/fast/css/positioned-overflow-scroll-expected.png: Removed. * platform/efl/fast/css/positioned-overflow-scroll-expected.txt: Removed. * platform/gtk/fast/css/positioned-overflow-scroll-expected.png: Removed. * platform/gtk/fast/css/positioned-overflow-scroll-expected.txt: Removed. * platform/mac/fast/css/positioned-overflow-scroll-expected.png: Removed. * platform/mac/fast/css/positioned-overflow-scroll-expected.txt: Removed. * platform/qt/fast/css/positioned-overflow-scroll-expected.png: Removed. * platform/qt/fast/css/positioned-overflow-scroll-expected.txt: Removed. * resources/check-layout.js: Canonical link: https://commits.webkit.org/124789@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139344 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-01-10 19:22:49 +00:00
if (referenceNode == document.body) {
document.body.appendChild(nodeToAdd);
return;
}
2011-08-08 20:29:40 +00:00
if (referenceNode.nextSibling)
referenceNode.parentNode.insertBefore(nodeToAdd, referenceNode.nextSibling);
else
referenceNode.parentNode.appendChild(nodeToAdd);
}
function checkSubtreeExpectedValues(parent, failures)
{
var checkedLayout = checkExpectedValues(parent, failures);
Array.prototype.forEach.call(parent.childNodes, function(node) {
checkedLayout |= checkSubtreeExpectedValues(node, failures);
});
return checkedLayout;
}
function checkAttribute(output, node, attribute)
{
var result = node.getAttribute && node.getAttribute(attribute);
output.checked |= !!result;
return result;
}
function checkExpectedValues(node, failures)
{
var output = { checked: false };
var expectedWidth = checkAttribute(output, node, "data-expected-width");
if (expectedWidth) {
Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. Source/WebCore: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ Test: cssom/subpixel-offsetleft-top-width-height-values.html * dom/Element.cpp: (WebCore::localZoomForRenderer): (WebCore::adjustForLocalZoom): (WebCore::convertToNonSubpixelValueIfNeeded): (WebCore::Element::offsetLeft): (WebCore::Element::offsetTop): (WebCore::Element::offsetWidth): (WebCore::Element::offsetHeight): (WebCore::Element::clientLeft): (WebCore::Element::clientTop): (WebCore::Element::clientWidth): (WebCore::Element::clientHeight): (WebCore::Element::scrollLeft): (WebCore::Element::scrollTop): (WebCore::Element::setScrollLeft): (WebCore::Element::setScrollTop): (WebCore::Element::scrollWidth): (WebCore::Element::scrollHeight): * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::adjustForZoom): (WebCore::HTMLBodyElement::scrollLeft): (WebCore::HTMLBodyElement::setScrollLeft): (WebCore::HTMLBodyElement::scrollTop): (WebCore::HTMLBodyElement::setScrollTop): (WebCore::HTMLBodyElement::scrollHeight): (WebCore::HTMLBodyElement::scrollWidth): * html/HTMLBodyElement.h: * page/Settings.in: Source/WebKit2: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Some test cases expect integral values, so the test content is updated accordingly. It mostly means adding Math.round() before comparing values in order to match pixelSnappedIntRect() functionality. * css3/calc/simple-calcs-prefixed.html: changed file format from Windows to Unix. * css3/calc/simple-calcs.html: changed file format from Windows to Unix. * cssom/subpixel-offsetleft-top-width-height-values-expected.txt: Added. * cssom/subpixel-offsetleft-top-width-height-values.html: Added. * editing/selection/drag-start-event-client-x-y.html: use floor as we compare the return value to a truncated integer. * editing/selection/mixed-editability-10.html: * fast/css/zoom-in-length-round-trip.html: * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: * fast/forms/basic-buttons.html: * js/dom/dom-static-property-for-in-iteration-expected.txt: * platform/mac/fast/scrolling/scroll-div-latched-div.html: * platform/mac/fast/scrolling/scroll-div-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-bottom-test.html: * platform/mac/fast/scrolling/scroll-select-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-latched-select.html: * resources/check-layout.js: Canonical link: https://commits.webkit.org/150985@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-14 23:13:52 +00:00
if (Math.round(node.offsetWidth) != parseInt(expectedWidth))
failures.push("Expected " + expectedWidth + " for width, but got " + node.offsetWidth + ". ");
}
var expectedHeight = checkAttribute(output, node, "data-expected-height");
change RenderFlexibleBox to act on logical coordinates https://bugs.webkit.org/show_bug.cgi?id=68129 Reviewed by David Hyatt. Source/WebCore: This makes RenderFlexibleBox respect direction and writing-mode. We now properly support the default flex-flow value of "row". Test: css3/flexbox/writing-modes.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::setLogicalLocationForChild): * rendering/RenderBlock.h: * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::logicalBorderWidthForChild): (WebCore::RenderFlexibleBox::logicalPaddingWidthForChild): (WebCore::RenderFlexibleBox::logicalScrollbarHeightForChild): (WebCore::RenderFlexibleBox::marginStartStyleForChild): (WebCore::RenderFlexibleBox::marginEndStyleForChild): (WebCore::RenderFlexibleBox::preferredLogicalContentWidthForFlexItem): (WebCore::RenderFlexibleBox::layoutInlineDirection): (WebCore::RenderFlexibleBox::logicalPositiveFlexForChild): (WebCore::RenderFlexibleBox::logicalNegativeFlexForChild): (WebCore::RenderFlexibleBox::computePreferredLogicalWidth): (WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithmInlineDirection): (WebCore::RenderFlexibleBox::setLogicalOverrideSize): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/resources/flexbox.js: * css3/flexbox/writing-modes-expected.txt: Added. * css3/flexbox/writing-modes.html: Added. Canonical link: https://commits.webkit.org/84422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-20 22:46:19 +00:00
if (expectedHeight) {
Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. Source/WebCore: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ Test: cssom/subpixel-offsetleft-top-width-height-values.html * dom/Element.cpp: (WebCore::localZoomForRenderer): (WebCore::adjustForLocalZoom): (WebCore::convertToNonSubpixelValueIfNeeded): (WebCore::Element::offsetLeft): (WebCore::Element::offsetTop): (WebCore::Element::offsetWidth): (WebCore::Element::offsetHeight): (WebCore::Element::clientLeft): (WebCore::Element::clientTop): (WebCore::Element::clientWidth): (WebCore::Element::clientHeight): (WebCore::Element::scrollLeft): (WebCore::Element::scrollTop): (WebCore::Element::setScrollLeft): (WebCore::Element::setScrollTop): (WebCore::Element::scrollWidth): (WebCore::Element::scrollHeight): * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::adjustForZoom): (WebCore::HTMLBodyElement::scrollLeft): (WebCore::HTMLBodyElement::setScrollLeft): (WebCore::HTMLBodyElement::scrollTop): (WebCore::HTMLBodyElement::setScrollTop): (WebCore::HTMLBodyElement::scrollHeight): (WebCore::HTMLBodyElement::scrollWidth): * html/HTMLBodyElement.h: * page/Settings.in: Source/WebKit2: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Some test cases expect integral values, so the test content is updated accordingly. It mostly means adding Math.round() before comparing values in order to match pixelSnappedIntRect() functionality. * css3/calc/simple-calcs-prefixed.html: changed file format from Windows to Unix. * css3/calc/simple-calcs.html: changed file format from Windows to Unix. * cssom/subpixel-offsetleft-top-width-height-values-expected.txt: Added. * cssom/subpixel-offsetleft-top-width-height-values.html: Added. * editing/selection/drag-start-event-client-x-y.html: use floor as we compare the return value to a truncated integer. * editing/selection/mixed-editability-10.html: * fast/css/zoom-in-length-round-trip.html: * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: * fast/forms/basic-buttons.html: * js/dom/dom-static-property-for-in-iteration-expected.txt: * platform/mac/fast/scrolling/scroll-div-latched-div.html: * platform/mac/fast/scrolling/scroll-div-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-bottom-test.html: * platform/mac/fast/scrolling/scroll-select-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-latched-select.html: * resources/check-layout.js: Canonical link: https://commits.webkit.org/150985@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-14 23:13:52 +00:00
if (Math.round(node.offsetHeight) != parseInt(expectedHeight))
change RenderFlexibleBox to act on logical coordinates https://bugs.webkit.org/show_bug.cgi?id=68129 Reviewed by David Hyatt. Source/WebCore: This makes RenderFlexibleBox respect direction and writing-mode. We now properly support the default flex-flow value of "row". Test: css3/flexbox/writing-modes.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::setLogicalLocationForChild): * rendering/RenderBlock.h: * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::logicalBorderWidthForChild): (WebCore::RenderFlexibleBox::logicalPaddingWidthForChild): (WebCore::RenderFlexibleBox::logicalScrollbarHeightForChild): (WebCore::RenderFlexibleBox::marginStartStyleForChild): (WebCore::RenderFlexibleBox::marginEndStyleForChild): (WebCore::RenderFlexibleBox::preferredLogicalContentWidthForFlexItem): (WebCore::RenderFlexibleBox::layoutInlineDirection): (WebCore::RenderFlexibleBox::logicalPositiveFlexForChild): (WebCore::RenderFlexibleBox::logicalNegativeFlexForChild): (WebCore::RenderFlexibleBox::computePreferredLogicalWidth): (WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithmInlineDirection): (WebCore::RenderFlexibleBox::setLogicalOverrideSize): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/resources/flexbox.js: * css3/flexbox/writing-modes-expected.txt: Added. * css3/flexbox/writing-modes.html: Added. Canonical link: https://commits.webkit.org/84422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-20 22:46:19 +00:00
failures.push("Expected " + expectedHeight + " for height, but got " + node.offsetHeight + ". ");
}
var expectedOffset = checkAttribute(output, node, "data-offset-x");
if (expectedOffset) {
Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. Source/WebCore: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ Test: cssom/subpixel-offsetleft-top-width-height-values.html * dom/Element.cpp: (WebCore::localZoomForRenderer): (WebCore::adjustForLocalZoom): (WebCore::convertToNonSubpixelValueIfNeeded): (WebCore::Element::offsetLeft): (WebCore::Element::offsetTop): (WebCore::Element::offsetWidth): (WebCore::Element::offsetHeight): (WebCore::Element::clientLeft): (WebCore::Element::clientTop): (WebCore::Element::clientWidth): (WebCore::Element::clientHeight): (WebCore::Element::scrollLeft): (WebCore::Element::scrollTop): (WebCore::Element::setScrollLeft): (WebCore::Element::setScrollTop): (WebCore::Element::scrollWidth): (WebCore::Element::scrollHeight): * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::adjustForZoom): (WebCore::HTMLBodyElement::scrollLeft): (WebCore::HTMLBodyElement::setScrollLeft): (WebCore::HTMLBodyElement::scrollTop): (WebCore::HTMLBodyElement::setScrollTop): (WebCore::HTMLBodyElement::scrollHeight): (WebCore::HTMLBodyElement::scrollWidth): * html/HTMLBodyElement.h: * page/Settings.in: Source/WebKit2: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Some test cases expect integral values, so the test content is updated accordingly. It mostly means adding Math.round() before comparing values in order to match pixelSnappedIntRect() functionality. * css3/calc/simple-calcs-prefixed.html: changed file format from Windows to Unix. * css3/calc/simple-calcs.html: changed file format from Windows to Unix. * cssom/subpixel-offsetleft-top-width-height-values-expected.txt: Added. * cssom/subpixel-offsetleft-top-width-height-values.html: Added. * editing/selection/drag-start-event-client-x-y.html: use floor as we compare the return value to a truncated integer. * editing/selection/mixed-editability-10.html: * fast/css/zoom-in-length-round-trip.html: * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: * fast/forms/basic-buttons.html: * js/dom/dom-static-property-for-in-iteration-expected.txt: * platform/mac/fast/scrolling/scroll-div-latched-div.html: * platform/mac/fast/scrolling/scroll-div-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-bottom-test.html: * platform/mac/fast/scrolling/scroll-select-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-latched-select.html: * resources/check-layout.js: Canonical link: https://commits.webkit.org/150985@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-14 23:13:52 +00:00
if (Math.round(node.offsetLeft) != parseInt(expectedOffset))
failures.push("Expected " + expectedOffset + " for offsetLeft, but got " + node.offsetLeft + ". ");
}
change RenderFlexibleBox to act on logical coordinates https://bugs.webkit.org/show_bug.cgi?id=68129 Reviewed by David Hyatt. Source/WebCore: This makes RenderFlexibleBox respect direction and writing-mode. We now properly support the default flex-flow value of "row". Test: css3/flexbox/writing-modes.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::setLogicalLocationForChild): * rendering/RenderBlock.h: * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::logicalBorderWidthForChild): (WebCore::RenderFlexibleBox::logicalPaddingWidthForChild): (WebCore::RenderFlexibleBox::logicalScrollbarHeightForChild): (WebCore::RenderFlexibleBox::marginStartStyleForChild): (WebCore::RenderFlexibleBox::marginEndStyleForChild): (WebCore::RenderFlexibleBox::preferredLogicalContentWidthForFlexItem): (WebCore::RenderFlexibleBox::layoutInlineDirection): (WebCore::RenderFlexibleBox::logicalPositiveFlexForChild): (WebCore::RenderFlexibleBox::logicalNegativeFlexForChild): (WebCore::RenderFlexibleBox::computePreferredLogicalWidth): (WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithmInlineDirection): (WebCore::RenderFlexibleBox::setLogicalOverrideSize): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/resources/flexbox.js: * css3/flexbox/writing-modes-expected.txt: Added. * css3/flexbox/writing-modes.html: Added. Canonical link: https://commits.webkit.org/84422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-20 22:46:19 +00:00
var expectedOffset = checkAttribute(output, node, "data-offset-y");
change RenderFlexibleBox to act on logical coordinates https://bugs.webkit.org/show_bug.cgi?id=68129 Reviewed by David Hyatt. Source/WebCore: This makes RenderFlexibleBox respect direction and writing-mode. We now properly support the default flex-flow value of "row". Test: css3/flexbox/writing-modes.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::setLogicalLocationForChild): * rendering/RenderBlock.h: * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::logicalBorderWidthForChild): (WebCore::RenderFlexibleBox::logicalPaddingWidthForChild): (WebCore::RenderFlexibleBox::logicalScrollbarHeightForChild): (WebCore::RenderFlexibleBox::marginStartStyleForChild): (WebCore::RenderFlexibleBox::marginEndStyleForChild): (WebCore::RenderFlexibleBox::preferredLogicalContentWidthForFlexItem): (WebCore::RenderFlexibleBox::layoutInlineDirection): (WebCore::RenderFlexibleBox::logicalPositiveFlexForChild): (WebCore::RenderFlexibleBox::logicalNegativeFlexForChild): (WebCore::RenderFlexibleBox::computePreferredLogicalWidth): (WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithmInlineDirection): (WebCore::RenderFlexibleBox::setLogicalOverrideSize): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/resources/flexbox.js: * css3/flexbox/writing-modes-expected.txt: Added. * css3/flexbox/writing-modes.html: Added. Canonical link: https://commits.webkit.org/84422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-20 22:46:19 +00:00
if (expectedOffset) {
Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. Source/WebCore: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ Test: cssom/subpixel-offsetleft-top-width-height-values.html * dom/Element.cpp: (WebCore::localZoomForRenderer): (WebCore::adjustForLocalZoom): (WebCore::convertToNonSubpixelValueIfNeeded): (WebCore::Element::offsetLeft): (WebCore::Element::offsetTop): (WebCore::Element::offsetWidth): (WebCore::Element::offsetHeight): (WebCore::Element::clientLeft): (WebCore::Element::clientTop): (WebCore::Element::clientWidth): (WebCore::Element::clientHeight): (WebCore::Element::scrollLeft): (WebCore::Element::scrollTop): (WebCore::Element::setScrollLeft): (WebCore::Element::setScrollTop): (WebCore::Element::scrollWidth): (WebCore::Element::scrollHeight): * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::adjustForZoom): (WebCore::HTMLBodyElement::scrollLeft): (WebCore::HTMLBodyElement::setScrollLeft): (WebCore::HTMLBodyElement::scrollTop): (WebCore::HTMLBodyElement::setScrollTop): (WebCore::HTMLBodyElement::scrollHeight): (WebCore::HTMLBodyElement::scrollWidth): * html/HTMLBodyElement.h: * page/Settings.in: Source/WebKit2: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Some test cases expect integral values, so the test content is updated accordingly. It mostly means adding Math.round() before comparing values in order to match pixelSnappedIntRect() functionality. * css3/calc/simple-calcs-prefixed.html: changed file format from Windows to Unix. * css3/calc/simple-calcs.html: changed file format from Windows to Unix. * cssom/subpixel-offsetleft-top-width-height-values-expected.txt: Added. * cssom/subpixel-offsetleft-top-width-height-values.html: Added. * editing/selection/drag-start-event-client-x-y.html: use floor as we compare the return value to a truncated integer. * editing/selection/mixed-editability-10.html: * fast/css/zoom-in-length-round-trip.html: * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: * fast/forms/basic-buttons.html: * js/dom/dom-static-property-for-in-iteration-expected.txt: * platform/mac/fast/scrolling/scroll-div-latched-div.html: * platform/mac/fast/scrolling/scroll-div-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-bottom-test.html: * platform/mac/fast/scrolling/scroll-select-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-latched-select.html: * resources/check-layout.js: Canonical link: https://commits.webkit.org/150985@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-14 23:13:52 +00:00
if (Math.round(node.offsetTop) != parseInt(expectedOffset))
change RenderFlexibleBox to act on logical coordinates https://bugs.webkit.org/show_bug.cgi?id=68129 Reviewed by David Hyatt. Source/WebCore: This makes RenderFlexibleBox respect direction and writing-mode. We now properly support the default flex-flow value of "row". Test: css3/flexbox/writing-modes.html * rendering/RenderBlock.cpp: (WebCore::RenderBlock::setLogicalLocationForChild): * rendering/RenderBlock.h: * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::logicalBorderWidthForChild): (WebCore::RenderFlexibleBox::logicalPaddingWidthForChild): (WebCore::RenderFlexibleBox::logicalScrollbarHeightForChild): (WebCore::RenderFlexibleBox::marginStartStyleForChild): (WebCore::RenderFlexibleBox::marginEndStyleForChild): (WebCore::RenderFlexibleBox::preferredLogicalContentWidthForFlexItem): (WebCore::RenderFlexibleBox::layoutInlineDirection): (WebCore::RenderFlexibleBox::logicalPositiveFlexForChild): (WebCore::RenderFlexibleBox::logicalNegativeFlexForChild): (WebCore::RenderFlexibleBox::computePreferredLogicalWidth): (WebCore::RenderFlexibleBox::runFreeSpaceAllocationAlgorithmInlineDirection): (WebCore::RenderFlexibleBox::setLogicalOverrideSize): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/resources/flexbox.js: * css3/flexbox/writing-modes-expected.txt: Added. * css3/flexbox/writing-modes.html: Added. Canonical link: https://commits.webkit.org/84422@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@95577 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-09-20 22:46:19 +00:00
failures.push("Expected " + expectedOffset + " for offsetTop, but got " + node.offsetTop + ". ");
}
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
var expectedWidth = checkAttribute(output, node, "data-expected-client-width");
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
if (expectedWidth) {
Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. Source/WebCore: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ Test: cssom/subpixel-offsetleft-top-width-height-values.html * dom/Element.cpp: (WebCore::localZoomForRenderer): (WebCore::adjustForLocalZoom): (WebCore::convertToNonSubpixelValueIfNeeded): (WebCore::Element::offsetLeft): (WebCore::Element::offsetTop): (WebCore::Element::offsetWidth): (WebCore::Element::offsetHeight): (WebCore::Element::clientLeft): (WebCore::Element::clientTop): (WebCore::Element::clientWidth): (WebCore::Element::clientHeight): (WebCore::Element::scrollLeft): (WebCore::Element::scrollTop): (WebCore::Element::setScrollLeft): (WebCore::Element::setScrollTop): (WebCore::Element::scrollWidth): (WebCore::Element::scrollHeight): * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::adjustForZoom): (WebCore::HTMLBodyElement::scrollLeft): (WebCore::HTMLBodyElement::setScrollLeft): (WebCore::HTMLBodyElement::scrollTop): (WebCore::HTMLBodyElement::setScrollTop): (WebCore::HTMLBodyElement::scrollHeight): (WebCore::HTMLBodyElement::scrollWidth): * html/HTMLBodyElement.h: * page/Settings.in: Source/WebKit2: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Some test cases expect integral values, so the test content is updated accordingly. It mostly means adding Math.round() before comparing values in order to match pixelSnappedIntRect() functionality. * css3/calc/simple-calcs-prefixed.html: changed file format from Windows to Unix. * css3/calc/simple-calcs.html: changed file format from Windows to Unix. * cssom/subpixel-offsetleft-top-width-height-values-expected.txt: Added. * cssom/subpixel-offsetleft-top-width-height-values.html: Added. * editing/selection/drag-start-event-client-x-y.html: use floor as we compare the return value to a truncated integer. * editing/selection/mixed-editability-10.html: * fast/css/zoom-in-length-round-trip.html: * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: * fast/forms/basic-buttons.html: * js/dom/dom-static-property-for-in-iteration-expected.txt: * platform/mac/fast/scrolling/scroll-div-latched-div.html: * platform/mac/fast/scrolling/scroll-div-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-bottom-test.html: * platform/mac/fast/scrolling/scroll-select-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-latched-select.html: * resources/check-layout.js: Canonical link: https://commits.webkit.org/150985@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-14 23:13:52 +00:00
if (Math.round(node.clientWidth) != parseInt(expectedWidth))
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
failures.push("Expected " + expectedWidth + " for clientWidth, but got " + node.clientWidth + ". ");
}
var expectedHeight = checkAttribute(output, node, "data-expected-client-height");
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
if (expectedHeight) {
Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. Source/WebCore: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ Test: cssom/subpixel-offsetleft-top-width-height-values.html * dom/Element.cpp: (WebCore::localZoomForRenderer): (WebCore::adjustForLocalZoom): (WebCore::convertToNonSubpixelValueIfNeeded): (WebCore::Element::offsetLeft): (WebCore::Element::offsetTop): (WebCore::Element::offsetWidth): (WebCore::Element::offsetHeight): (WebCore::Element::clientLeft): (WebCore::Element::clientTop): (WebCore::Element::clientWidth): (WebCore::Element::clientHeight): (WebCore::Element::scrollLeft): (WebCore::Element::scrollTop): (WebCore::Element::setScrollLeft): (WebCore::Element::setScrollTop): (WebCore::Element::scrollWidth): (WebCore::Element::scrollHeight): * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::adjustForZoom): (WebCore::HTMLBodyElement::scrollLeft): (WebCore::HTMLBodyElement::setScrollLeft): (WebCore::HTMLBodyElement::scrollTop): (WebCore::HTMLBodyElement::setScrollTop): (WebCore::HTMLBodyElement::scrollHeight): (WebCore::HTMLBodyElement::scrollWidth): * html/HTMLBodyElement.h: * page/Settings.in: Source/WebKit2: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Some test cases expect integral values, so the test content is updated accordingly. It mostly means adding Math.round() before comparing values in order to match pixelSnappedIntRect() functionality. * css3/calc/simple-calcs-prefixed.html: changed file format from Windows to Unix. * css3/calc/simple-calcs.html: changed file format from Windows to Unix. * cssom/subpixel-offsetleft-top-width-height-values-expected.txt: Added. * cssom/subpixel-offsetleft-top-width-height-values.html: Added. * editing/selection/drag-start-event-client-x-y.html: use floor as we compare the return value to a truncated integer. * editing/selection/mixed-editability-10.html: * fast/css/zoom-in-length-round-trip.html: * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: * fast/forms/basic-buttons.html: * js/dom/dom-static-property-for-in-iteration-expected.txt: * platform/mac/fast/scrolling/scroll-div-latched-div.html: * platform/mac/fast/scrolling/scroll-div-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-bottom-test.html: * platform/mac/fast/scrolling/scroll-select-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-latched-select.html: * resources/check-layout.js: Canonical link: https://commits.webkit.org/150985@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-14 23:13:52 +00:00
if (Math.round(node.clientHeight) != parseInt(expectedHeight))
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
failures.push("Expected " + expectedHeight + " for clientHeight, but got " + node.clientHeight + ". ");
}
var expectedWidth = checkAttribute(output, node, "data-expected-scroll-width");
if (expectedWidth) {
Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. Source/WebCore: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ Test: cssom/subpixel-offsetleft-top-width-height-values.html * dom/Element.cpp: (WebCore::localZoomForRenderer): (WebCore::adjustForLocalZoom): (WebCore::convertToNonSubpixelValueIfNeeded): (WebCore::Element::offsetLeft): (WebCore::Element::offsetTop): (WebCore::Element::offsetWidth): (WebCore::Element::offsetHeight): (WebCore::Element::clientLeft): (WebCore::Element::clientTop): (WebCore::Element::clientWidth): (WebCore::Element::clientHeight): (WebCore::Element::scrollLeft): (WebCore::Element::scrollTop): (WebCore::Element::setScrollLeft): (WebCore::Element::setScrollTop): (WebCore::Element::scrollWidth): (WebCore::Element::scrollHeight): * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::adjustForZoom): (WebCore::HTMLBodyElement::scrollLeft): (WebCore::HTMLBodyElement::setScrollLeft): (WebCore::HTMLBodyElement::scrollTop): (WebCore::HTMLBodyElement::setScrollTop): (WebCore::HTMLBodyElement::scrollHeight): (WebCore::HTMLBodyElement::scrollWidth): * html/HTMLBodyElement.h: * page/Settings.in: Source/WebKit2: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Some test cases expect integral values, so the test content is updated accordingly. It mostly means adding Math.round() before comparing values in order to match pixelSnappedIntRect() functionality. * css3/calc/simple-calcs-prefixed.html: changed file format from Windows to Unix. * css3/calc/simple-calcs.html: changed file format from Windows to Unix. * cssom/subpixel-offsetleft-top-width-height-values-expected.txt: Added. * cssom/subpixel-offsetleft-top-width-height-values.html: Added. * editing/selection/drag-start-event-client-x-y.html: use floor as we compare the return value to a truncated integer. * editing/selection/mixed-editability-10.html: * fast/css/zoom-in-length-round-trip.html: * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: * fast/forms/basic-buttons.html: * js/dom/dom-static-property-for-in-iteration-expected.txt: * platform/mac/fast/scrolling/scroll-div-latched-div.html: * platform/mac/fast/scrolling/scroll-div-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-bottom-test.html: * platform/mac/fast/scrolling/scroll-select-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-latched-select.html: * resources/check-layout.js: Canonical link: https://commits.webkit.org/150985@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-14 23:13:52 +00:00
if (Math.round(node.scrollWidth) != parseInt(expectedWidth))
failures.push("Expected " + expectedWidth + " for scrollWidth, but got " + node.scrollWidth + ". ");
}
var expectedHeight = checkAttribute(output, node, "data-expected-scroll-height");
if (expectedHeight) {
Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. Source/WebCore: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ Test: cssom/subpixel-offsetleft-top-width-height-values.html * dom/Element.cpp: (WebCore::localZoomForRenderer): (WebCore::adjustForLocalZoom): (WebCore::convertToNonSubpixelValueIfNeeded): (WebCore::Element::offsetLeft): (WebCore::Element::offsetTop): (WebCore::Element::offsetWidth): (WebCore::Element::offsetHeight): (WebCore::Element::clientLeft): (WebCore::Element::clientTop): (WebCore::Element::clientWidth): (WebCore::Element::clientHeight): (WebCore::Element::scrollLeft): (WebCore::Element::scrollTop): (WebCore::Element::setScrollLeft): (WebCore::Element::setScrollTop): (WebCore::Element::scrollWidth): (WebCore::Element::scrollHeight): * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::adjustForZoom): (WebCore::HTMLBodyElement::scrollLeft): (WebCore::HTMLBodyElement::setScrollLeft): (WebCore::HTMLBodyElement::scrollTop): (WebCore::HTMLBodyElement::setScrollTop): (WebCore::HTMLBodyElement::scrollHeight): (WebCore::HTMLBodyElement::scrollWidth): * html/HTMLBodyElement.h: * page/Settings.in: Source/WebKit2: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Some test cases expect integral values, so the test content is updated accordingly. It mostly means adding Math.round() before comparing values in order to match pixelSnappedIntRect() functionality. * css3/calc/simple-calcs-prefixed.html: changed file format from Windows to Unix. * css3/calc/simple-calcs.html: changed file format from Windows to Unix. * cssom/subpixel-offsetleft-top-width-height-values-expected.txt: Added. * cssom/subpixel-offsetleft-top-width-height-values.html: Added. * editing/selection/drag-start-event-client-x-y.html: use floor as we compare the return value to a truncated integer. * editing/selection/mixed-editability-10.html: * fast/css/zoom-in-length-round-trip.html: * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: * fast/forms/basic-buttons.html: * js/dom/dom-static-property-for-in-iteration-expected.txt: * platform/mac/fast/scrolling/scroll-div-latched-div.html: * platform/mac/fast/scrolling/scroll-div-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-bottom-test.html: * platform/mac/fast/scrolling/scroll-select-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-latched-select.html: * resources/check-layout.js: Canonical link: https://commits.webkit.org/150985@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-14 23:13:52 +00:00
if (Math.round(node.scrollHeight) != parseInt(expectedHeight))
failures.push("Expected " + expectedHeight + " for scrollHeight, but got " + node.scrollHeight + ". ");
}
var expectedOffset = checkAttribute(output, node, "data-total-x");
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
if (expectedOffset) {
var totalLeft = node.clientLeft + node.offsetLeft;
Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. Source/WebCore: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ Test: cssom/subpixel-offsetleft-top-width-height-values.html * dom/Element.cpp: (WebCore::localZoomForRenderer): (WebCore::adjustForLocalZoom): (WebCore::convertToNonSubpixelValueIfNeeded): (WebCore::Element::offsetLeft): (WebCore::Element::offsetTop): (WebCore::Element::offsetWidth): (WebCore::Element::offsetHeight): (WebCore::Element::clientLeft): (WebCore::Element::clientTop): (WebCore::Element::clientWidth): (WebCore::Element::clientHeight): (WebCore::Element::scrollLeft): (WebCore::Element::scrollTop): (WebCore::Element::setScrollLeft): (WebCore::Element::setScrollTop): (WebCore::Element::scrollWidth): (WebCore::Element::scrollHeight): * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::adjustForZoom): (WebCore::HTMLBodyElement::scrollLeft): (WebCore::HTMLBodyElement::setScrollLeft): (WebCore::HTMLBodyElement::scrollTop): (WebCore::HTMLBodyElement::setScrollTop): (WebCore::HTMLBodyElement::scrollHeight): (WebCore::HTMLBodyElement::scrollWidth): * html/HTMLBodyElement.h: * page/Settings.in: Source/WebKit2: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Some test cases expect integral values, so the test content is updated accordingly. It mostly means adding Math.round() before comparing values in order to match pixelSnappedIntRect() functionality. * css3/calc/simple-calcs-prefixed.html: changed file format from Windows to Unix. * css3/calc/simple-calcs.html: changed file format from Windows to Unix. * cssom/subpixel-offsetleft-top-width-height-values-expected.txt: Added. * cssom/subpixel-offsetleft-top-width-height-values.html: Added. * editing/selection/drag-start-event-client-x-y.html: use floor as we compare the return value to a truncated integer. * editing/selection/mixed-editability-10.html: * fast/css/zoom-in-length-round-trip.html: * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: * fast/forms/basic-buttons.html: * js/dom/dom-static-property-for-in-iteration-expected.txt: * platform/mac/fast/scrolling/scroll-div-latched-div.html: * platform/mac/fast/scrolling/scroll-div-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-bottom-test.html: * platform/mac/fast/scrolling/scroll-select-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-latched-select.html: * resources/check-layout.js: Canonical link: https://commits.webkit.org/150985@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-14 23:13:52 +00:00
if (Math.round(totalLeft) != parseInt(expectedOffset))
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
failures.push("Expected " + expectedOffset + " for clientLeft+offsetLeft, but got " + totalLeft + ", clientLeft: " + node.clientLeft + ", offsetLeft: " + node.offsetLeft + ". ");
}
var expectedOffset = checkAttribute(output, node, "data-total-y");
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
if (expectedOffset) {
var totalTop = node.clientTop + node.offsetTop;
Subpixel layout: Change Element.offset* client* scroll* return type to double. https://bugs.webkit.org/show_bug.cgi?id=132895 Reviewed by Simon Fraser. Source/WebCore: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ Test: cssom/subpixel-offsetleft-top-width-height-values.html * dom/Element.cpp: (WebCore::localZoomForRenderer): (WebCore::adjustForLocalZoom): (WebCore::convertToNonSubpixelValueIfNeeded): (WebCore::Element::offsetLeft): (WebCore::Element::offsetTop): (WebCore::Element::offsetWidth): (WebCore::Element::offsetHeight): (WebCore::Element::clientLeft): (WebCore::Element::clientTop): (WebCore::Element::clientWidth): (WebCore::Element::clientHeight): (WebCore::Element::scrollLeft): (WebCore::Element::scrollTop): (WebCore::Element::setScrollLeft): (WebCore::Element::setScrollTop): (WebCore::Element::scrollWidth): (WebCore::Element::scrollHeight): * dom/Element.h: * dom/Element.idl: * html/HTMLBodyElement.cpp: (WebCore::adjustForZoom): (WebCore::HTMLBodyElement::scrollLeft): (WebCore::HTMLBodyElement::setScrollLeft): (WebCore::HTMLBodyElement::scrollTop): (WebCore::HTMLBodyElement::setScrollTop): (WebCore::HTMLBodyElement::scrollHeight): (WebCore::HTMLBodyElement::scrollWidth): * html/HTMLBodyElement.h: * page/Settings.in: Source/WebKit2: This patch changes Element.offset*, Element.client* and Element.scroll* APIs return type from long to double to match the latest CSSOM View Module spec[1]. Element.offset* and Element.client* do return subpixel values from now on. Element.scroll* still return integral values as the scrolling code hasn't adopted to subpixel rendering yet. subpixelCSSOMElementMetricsEnabled setting is added to be able to turn this feature on/off from WK2 preferences. It toggles the return value from subpixel to floored integral. It does not change layout/rendering behavior. Reference list of what other browsers do: IE: http://blogs.msdn.com/b/ie/archive/2012/02/17/sub-pixel-rendering-and-the-css-object-model.aspx Blink: http://www.chromestatus.com/features/5497402177880064 Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=825607 [1] http://www.w3.org/TR/2013/WD-cssom-view-20131217/ * Shared/WebPreferencesStore.h: * UIProcess/API/C/WKPreferences.cpp: (WKPreferencesSetSubpixelCSSOMElementMetricsEnabled): (WKPreferencesGetSubpixelCSSOMElementMetricsEnabled): * UIProcess/API/C/WKPreferencesRefPrivate.h: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): LayoutTests: Some test cases expect integral values, so the test content is updated accordingly. It mostly means adding Math.round() before comparing values in order to match pixelSnappedIntRect() functionality. * css3/calc/simple-calcs-prefixed.html: changed file format from Windows to Unix. * css3/calc/simple-calcs.html: changed file format from Windows to Unix. * cssom/subpixel-offsetleft-top-width-height-values-expected.txt: Added. * cssom/subpixel-offsetleft-top-width-height-values.html: Added. * editing/selection/drag-start-event-client-x-y.html: use floor as we compare the return value to a truncated integer. * editing/selection/mixed-editability-10.html: * fast/css/zoom-in-length-round-trip.html: * fast/dom/non-numeric-values-numeric-parameters-expected.txt: * fast/dom/script-tests/non-numeric-values-numeric-parameters.js: * fast/forms/basic-buttons.html: * js/dom/dom-static-property-for-in-iteration-expected.txt: * platform/mac/fast/scrolling/scroll-div-latched-div.html: * platform/mac/fast/scrolling/scroll-div-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-bottom-test.html: * platform/mac/fast/scrolling/scroll-select-latched-mainframe.html: * platform/mac/fast/scrolling/scroll-select-latched-select.html: * resources/check-layout.js: Canonical link: https://commits.webkit.org/150985@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2014-05-14 23:13:52 +00:00
if (Math.round(totalTop) != parseInt(expectedOffset))
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
failures.push("Expected " + expectedOffset + " for clientTop+offsetTop, but got " + totalTop + ", clientTop: " + node.clientTop + ", + offsetTop: " + node.offsetTop + ". ");
}
var expectedDisplay = checkAttribute(output, node, "data-expected-display");
if (expectedDisplay) {
var actualDisplay = getComputedStyle(node).display;
if (actualDisplay != expectedDisplay)
failures.push("Expected " + expectedDisplay + " for display, but got " + actualDisplay + ". ");
}
Source/WebCore: [CSS Grid Layout] Support paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. After bug 102968, we properly resolve grid items' width and height against the grid areas' sizes. However we didn't check for paddings and margins, which is what this change fixes.. Test: fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInRegion): Don't stretch the end margin to match the containing block's extent. The fix is similar to what was done for flex-box in bug 65887. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::computeStickyPositionConstraints): Added a comment about not using containingBlockLogicalWidthForContent. (WebCore::RenderBoxModelObject::computedCSSPaddingTop): (WebCore::RenderBoxModelObject::computedCSSPaddingBottom): (WebCore::RenderBoxModelObject::computedCSSPaddingLeft): (WebCore::RenderBoxModelObject::computedCSSPaddingRight): (WebCore::RenderBoxModelObject::computedCSSPaddingBefore): (WebCore::RenderBoxModelObject::computedCSSPaddingAfter): (WebCore::RenderBoxModelObject::computedCSSPaddingStart): (WebCore::RenderBoxModelObject::computedCSSPaddingEnd): Updated these functions to use containingBlockLogicalWidthForContent. * rendering/RenderGrid.h: * rendering/RenderObject.h: (WebCore::RenderObject::isRenderGrid): Added isRenderGrid. LayoutTests: [CSS Grid Layout] Support percentage paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. * resources/check-layout.js: Extended check-layout to be able to query paddings and margins. Note that in order to compare, the attribute with the returned value from getComputedStyle, we need to trim the unit ("px") from the actual values. This trick also works in FireFox and Opera. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item-expected.txt: Added. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html: Added. Canonical link: https://commits.webkit.org/122053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-04 02:24:23 +00:00
var expectedPaddingTop = checkAttribute(output, node, "data-expected-padding-top");
Source/WebCore: [CSS Grid Layout] Support paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. After bug 102968, we properly resolve grid items' width and height against the grid areas' sizes. However we didn't check for paddings and margins, which is what this change fixes.. Test: fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInRegion): Don't stretch the end margin to match the containing block's extent. The fix is similar to what was done for flex-box in bug 65887. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::computeStickyPositionConstraints): Added a comment about not using containingBlockLogicalWidthForContent. (WebCore::RenderBoxModelObject::computedCSSPaddingTop): (WebCore::RenderBoxModelObject::computedCSSPaddingBottom): (WebCore::RenderBoxModelObject::computedCSSPaddingLeft): (WebCore::RenderBoxModelObject::computedCSSPaddingRight): (WebCore::RenderBoxModelObject::computedCSSPaddingBefore): (WebCore::RenderBoxModelObject::computedCSSPaddingAfter): (WebCore::RenderBoxModelObject::computedCSSPaddingStart): (WebCore::RenderBoxModelObject::computedCSSPaddingEnd): Updated these functions to use containingBlockLogicalWidthForContent. * rendering/RenderGrid.h: * rendering/RenderObject.h: (WebCore::RenderObject::isRenderGrid): Added isRenderGrid. LayoutTests: [CSS Grid Layout] Support percentage paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. * resources/check-layout.js: Extended check-layout to be able to query paddings and margins. Note that in order to compare, the attribute with the returned value from getComputedStyle, we need to trim the unit ("px") from the actual values. This trick also works in FireFox and Opera. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item-expected.txt: Added. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html: Added. Canonical link: https://commits.webkit.org/122053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-04 02:24:23 +00:00
if (expectedPaddingTop) {
var actualPaddingTop = getComputedStyle(node).paddingTop;
// Trim the unit "px" from the output.
actualPaddingTop = actualPaddingTop.substring(0, actualPaddingTop.length - 2);
if (actualPaddingTop != expectedPaddingTop)
failures.push("Expected " + expectedPaddingTop + " for padding-top, but got " + actualPaddingTop + ". ");
}
var expectedPaddingBottom = checkAttribute(output, node, "data-expected-padding-bottom");
Source/WebCore: [CSS Grid Layout] Support paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. After bug 102968, we properly resolve grid items' width and height against the grid areas' sizes. However we didn't check for paddings and margins, which is what this change fixes.. Test: fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInRegion): Don't stretch the end margin to match the containing block's extent. The fix is similar to what was done for flex-box in bug 65887. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::computeStickyPositionConstraints): Added a comment about not using containingBlockLogicalWidthForContent. (WebCore::RenderBoxModelObject::computedCSSPaddingTop): (WebCore::RenderBoxModelObject::computedCSSPaddingBottom): (WebCore::RenderBoxModelObject::computedCSSPaddingLeft): (WebCore::RenderBoxModelObject::computedCSSPaddingRight): (WebCore::RenderBoxModelObject::computedCSSPaddingBefore): (WebCore::RenderBoxModelObject::computedCSSPaddingAfter): (WebCore::RenderBoxModelObject::computedCSSPaddingStart): (WebCore::RenderBoxModelObject::computedCSSPaddingEnd): Updated these functions to use containingBlockLogicalWidthForContent. * rendering/RenderGrid.h: * rendering/RenderObject.h: (WebCore::RenderObject::isRenderGrid): Added isRenderGrid. LayoutTests: [CSS Grid Layout] Support percentage paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. * resources/check-layout.js: Extended check-layout to be able to query paddings and margins. Note that in order to compare, the attribute with the returned value from getComputedStyle, we need to trim the unit ("px") from the actual values. This trick also works in FireFox and Opera. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item-expected.txt: Added. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html: Added. Canonical link: https://commits.webkit.org/122053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-04 02:24:23 +00:00
if (expectedPaddingBottom) {
var actualPaddingBottom = getComputedStyle(node).paddingBottom;
// Trim the unit "px" from the output.
actualPaddingBottom = actualPaddingBottom.substring(0, actualPaddingBottom.length - 2);
if (actualPaddingBottom != expectedPaddingBottom)
failures.push("Expected " + expectedPaddingBottom + " for padding-bottom, but got " + actualPaddingBottom + ". ");
}
var expectedPaddingLeft = checkAttribute(output, node, "data-expected-padding-left");
Source/WebCore: [CSS Grid Layout] Support paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. After bug 102968, we properly resolve grid items' width and height against the grid areas' sizes. However we didn't check for paddings and margins, which is what this change fixes.. Test: fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInRegion): Don't stretch the end margin to match the containing block's extent. The fix is similar to what was done for flex-box in bug 65887. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::computeStickyPositionConstraints): Added a comment about not using containingBlockLogicalWidthForContent. (WebCore::RenderBoxModelObject::computedCSSPaddingTop): (WebCore::RenderBoxModelObject::computedCSSPaddingBottom): (WebCore::RenderBoxModelObject::computedCSSPaddingLeft): (WebCore::RenderBoxModelObject::computedCSSPaddingRight): (WebCore::RenderBoxModelObject::computedCSSPaddingBefore): (WebCore::RenderBoxModelObject::computedCSSPaddingAfter): (WebCore::RenderBoxModelObject::computedCSSPaddingStart): (WebCore::RenderBoxModelObject::computedCSSPaddingEnd): Updated these functions to use containingBlockLogicalWidthForContent. * rendering/RenderGrid.h: * rendering/RenderObject.h: (WebCore::RenderObject::isRenderGrid): Added isRenderGrid. LayoutTests: [CSS Grid Layout] Support percentage paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. * resources/check-layout.js: Extended check-layout to be able to query paddings and margins. Note that in order to compare, the attribute with the returned value from getComputedStyle, we need to trim the unit ("px") from the actual values. This trick also works in FireFox and Opera. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item-expected.txt: Added. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html: Added. Canonical link: https://commits.webkit.org/122053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-04 02:24:23 +00:00
if (expectedPaddingLeft) {
var actualPaddingLeft = getComputedStyle(node).paddingLeft;
// Trim the unit "px" from the output.
actualPaddingLeft = actualPaddingLeft.substring(0, actualPaddingLeft.length - 2);
if (actualPaddingLeft != expectedPaddingLeft)
failures.push("Expected " + expectedPaddingLeft + " for padding-left, but got " + actualPaddingLeft + ". ");
}
var expectedPaddingRight = checkAttribute(output, node, "data-expected-padding-right");
Source/WebCore: [CSS Grid Layout] Support paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. After bug 102968, we properly resolve grid items' width and height against the grid areas' sizes. However we didn't check for paddings and margins, which is what this change fixes.. Test: fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInRegion): Don't stretch the end margin to match the containing block's extent. The fix is similar to what was done for flex-box in bug 65887. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::computeStickyPositionConstraints): Added a comment about not using containingBlockLogicalWidthForContent. (WebCore::RenderBoxModelObject::computedCSSPaddingTop): (WebCore::RenderBoxModelObject::computedCSSPaddingBottom): (WebCore::RenderBoxModelObject::computedCSSPaddingLeft): (WebCore::RenderBoxModelObject::computedCSSPaddingRight): (WebCore::RenderBoxModelObject::computedCSSPaddingBefore): (WebCore::RenderBoxModelObject::computedCSSPaddingAfter): (WebCore::RenderBoxModelObject::computedCSSPaddingStart): (WebCore::RenderBoxModelObject::computedCSSPaddingEnd): Updated these functions to use containingBlockLogicalWidthForContent. * rendering/RenderGrid.h: * rendering/RenderObject.h: (WebCore::RenderObject::isRenderGrid): Added isRenderGrid. LayoutTests: [CSS Grid Layout] Support percentage paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. * resources/check-layout.js: Extended check-layout to be able to query paddings and margins. Note that in order to compare, the attribute with the returned value from getComputedStyle, we need to trim the unit ("px") from the actual values. This trick also works in FireFox and Opera. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item-expected.txt: Added. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html: Added. Canonical link: https://commits.webkit.org/122053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-04 02:24:23 +00:00
if (expectedPaddingRight) {
var actualPaddingRight = getComputedStyle(node).paddingRight;
// Trim the unit "px" from the output.
actualPaddingRight = actualPaddingRight.substring(0, actualPaddingRight.length - 2);
if (actualPaddingRight != expectedPaddingRight)
failures.push("Expected " + expectedPaddingRight + " for padding-right, but got " + actualPaddingRight + ". ");
}
var expectedMarginTop = checkAttribute(output, node, "data-expected-margin-top");
Source/WebCore: [CSS Grid Layout] Support paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. After bug 102968, we properly resolve grid items' width and height against the grid areas' sizes. However we didn't check for paddings and margins, which is what this change fixes.. Test: fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInRegion): Don't stretch the end margin to match the containing block's extent. The fix is similar to what was done for flex-box in bug 65887. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::computeStickyPositionConstraints): Added a comment about not using containingBlockLogicalWidthForContent. (WebCore::RenderBoxModelObject::computedCSSPaddingTop): (WebCore::RenderBoxModelObject::computedCSSPaddingBottom): (WebCore::RenderBoxModelObject::computedCSSPaddingLeft): (WebCore::RenderBoxModelObject::computedCSSPaddingRight): (WebCore::RenderBoxModelObject::computedCSSPaddingBefore): (WebCore::RenderBoxModelObject::computedCSSPaddingAfter): (WebCore::RenderBoxModelObject::computedCSSPaddingStart): (WebCore::RenderBoxModelObject::computedCSSPaddingEnd): Updated these functions to use containingBlockLogicalWidthForContent. * rendering/RenderGrid.h: * rendering/RenderObject.h: (WebCore::RenderObject::isRenderGrid): Added isRenderGrid. LayoutTests: [CSS Grid Layout] Support percentage paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. * resources/check-layout.js: Extended check-layout to be able to query paddings and margins. Note that in order to compare, the attribute with the returned value from getComputedStyle, we need to trim the unit ("px") from the actual values. This trick also works in FireFox and Opera. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item-expected.txt: Added. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html: Added. Canonical link: https://commits.webkit.org/122053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-04 02:24:23 +00:00
if (expectedMarginTop) {
var actualMarginTop = getComputedStyle(node).marginTop;
// Trim the unit "px" from the output.
actualMarginTop = actualMarginTop.substring(0, actualMarginTop.length - 2);
if (actualMarginTop != expectedMarginTop)
failures.push("Expected " + expectedMarginTop + " for margin-top, but got " + actualMarginTop + ". ");
}
var expectedMarginBottom = checkAttribute(output, node, "data-expected-margin-bottom");
Source/WebCore: [CSS Grid Layout] Support paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. After bug 102968, we properly resolve grid items' width and height against the grid areas' sizes. However we didn't check for paddings and margins, which is what this change fixes.. Test: fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInRegion): Don't stretch the end margin to match the containing block's extent. The fix is similar to what was done for flex-box in bug 65887. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::computeStickyPositionConstraints): Added a comment about not using containingBlockLogicalWidthForContent. (WebCore::RenderBoxModelObject::computedCSSPaddingTop): (WebCore::RenderBoxModelObject::computedCSSPaddingBottom): (WebCore::RenderBoxModelObject::computedCSSPaddingLeft): (WebCore::RenderBoxModelObject::computedCSSPaddingRight): (WebCore::RenderBoxModelObject::computedCSSPaddingBefore): (WebCore::RenderBoxModelObject::computedCSSPaddingAfter): (WebCore::RenderBoxModelObject::computedCSSPaddingStart): (WebCore::RenderBoxModelObject::computedCSSPaddingEnd): Updated these functions to use containingBlockLogicalWidthForContent. * rendering/RenderGrid.h: * rendering/RenderObject.h: (WebCore::RenderObject::isRenderGrid): Added isRenderGrid. LayoutTests: [CSS Grid Layout] Support percentage paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. * resources/check-layout.js: Extended check-layout to be able to query paddings and margins. Note that in order to compare, the attribute with the returned value from getComputedStyle, we need to trim the unit ("px") from the actual values. This trick also works in FireFox and Opera. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item-expected.txt: Added. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html: Added. Canonical link: https://commits.webkit.org/122053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-04 02:24:23 +00:00
if (expectedMarginBottom) {
var actualMarginBottom = getComputedStyle(node).marginBottom;
// Trim the unit "px" from the output.
actualMarginBottom = actualMarginBottom.substring(0, actualMarginBottom.length - 2);
if (actualMarginBottom != expectedMarginBottom)
failures.push("Expected " + expectedMarginBottom + " for margin-bottom, but got " + actualMarginBottom + ". ");
}
var expectedMarginLeft = checkAttribute(output, node, "data-expected-margin-left");
Source/WebCore: [CSS Grid Layout] Support paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. After bug 102968, we properly resolve grid items' width and height against the grid areas' sizes. However we didn't check for paddings and margins, which is what this change fixes.. Test: fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInRegion): Don't stretch the end margin to match the containing block's extent. The fix is similar to what was done for flex-box in bug 65887. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::computeStickyPositionConstraints): Added a comment about not using containingBlockLogicalWidthForContent. (WebCore::RenderBoxModelObject::computedCSSPaddingTop): (WebCore::RenderBoxModelObject::computedCSSPaddingBottom): (WebCore::RenderBoxModelObject::computedCSSPaddingLeft): (WebCore::RenderBoxModelObject::computedCSSPaddingRight): (WebCore::RenderBoxModelObject::computedCSSPaddingBefore): (WebCore::RenderBoxModelObject::computedCSSPaddingAfter): (WebCore::RenderBoxModelObject::computedCSSPaddingStart): (WebCore::RenderBoxModelObject::computedCSSPaddingEnd): Updated these functions to use containingBlockLogicalWidthForContent. * rendering/RenderGrid.h: * rendering/RenderObject.h: (WebCore::RenderObject::isRenderGrid): Added isRenderGrid. LayoutTests: [CSS Grid Layout] Support percentage paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. * resources/check-layout.js: Extended check-layout to be able to query paddings and margins. Note that in order to compare, the attribute with the returned value from getComputedStyle, we need to trim the unit ("px") from the actual values. This trick also works in FireFox and Opera. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item-expected.txt: Added. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html: Added. Canonical link: https://commits.webkit.org/122053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-04 02:24:23 +00:00
if (expectedMarginLeft) {
var actualMarginLeft = getComputedStyle(node).marginLeft;
// Trim the unit "px" from the output.
actualMarginLeft = actualMarginLeft.substring(0, actualMarginLeft.length - 2);
if (actualMarginLeft != expectedMarginLeft)
failures.push("Expected " + expectedMarginLeft + " for margin-left, but got " + actualMarginLeft + ". ");
}
var expectedMarginRight = checkAttribute(output, node, "data-expected-margin-right");
Source/WebCore: [CSS Grid Layout] Support paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. After bug 102968, we properly resolve grid items' width and height against the grid areas' sizes. However we didn't check for paddings and margins, which is what this change fixes.. Test: fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalWidthInRegion): Don't stretch the end margin to match the containing block's extent. The fix is similar to what was done for flex-box in bug 65887. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::computeStickyPositionConstraints): Added a comment about not using containingBlockLogicalWidthForContent. (WebCore::RenderBoxModelObject::computedCSSPaddingTop): (WebCore::RenderBoxModelObject::computedCSSPaddingBottom): (WebCore::RenderBoxModelObject::computedCSSPaddingLeft): (WebCore::RenderBoxModelObject::computedCSSPaddingRight): (WebCore::RenderBoxModelObject::computedCSSPaddingBefore): (WebCore::RenderBoxModelObject::computedCSSPaddingAfter): (WebCore::RenderBoxModelObject::computedCSSPaddingStart): (WebCore::RenderBoxModelObject::computedCSSPaddingEnd): Updated these functions to use containingBlockLogicalWidthForContent. * rendering/RenderGrid.h: * rendering/RenderObject.h: (WebCore::RenderObject::isRenderGrid): Added isRenderGrid. LayoutTests: [CSS Grid Layout] Support percentage paddings and margins on grid items https://bugs.webkit.org/show_bug.cgi?id=103677 Reviewed by Tony Chang. * resources/check-layout.js: Extended check-layout to be able to query paddings and margins. Note that in order to compare, the attribute with the returned value from getComputedStyle, we need to trim the unit ("px") from the actual values. This trick also works in FireFox and Opera. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item-expected.txt: Added. * fast/css-grid-layout/percent-padding-margin-resolution-grid-item.html: Added. Canonical link: https://commits.webkit.org/122053@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136465 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-04 02:24:23 +00:00
if (expectedMarginRight) {
var actualMarginRight = getComputedStyle(node).marginRight;
// Trim the unit "px" from the output.
actualMarginRight = actualMarginRight.substring(0, actualMarginRight.length - 2);
if (actualMarginRight != expectedMarginRight)
failures.push("Expected " + expectedMarginRight + " for margin-right, but got " + actualMarginRight + ". ");
}
return output.checked;
}
window.checkLayout = function(selectorList, overrideContainer)
2011-08-08 20:29:40 +00:00
{
Move layout checking js script into LayoutTest/resources and generalize https://bugs.webkit.org/show_bug.cgi?id=91268 Reviewed by Ojan Vafai. flexbox.js contains helper scripts for verifying the size and position of nodes. I will be writing similar tests for grid, so move the js file into a location for sharing and generalize the script. * css3/flexbox/align-absolute-child.html: Change include path and call. * css3/flexbox/auto-height-dynamic.html: * css3/flexbox/columns-auto-size.html: * css3/flexbox/flex-algorithm-min-max.html: * css3/flexbox/flex-algorithm-with-margins.html: * css3/flexbox/flex-algorithm.html: * css3/flexbox/flex-align-column.html: * css3/flexbox/flex-align-end.html: * css3/flexbox/flex-align-max.html: * css3/flexbox/flex-align-percent-height.html: * css3/flexbox/flex-align-stretch.html: * css3/flexbox/flex-align-vertical-writing-mode.html: * css3/flexbox/flex-align.html: * css3/flexbox/flex-flow-auto-margins.html: * css3/flexbox/flex-flow-border.html: * css3/flexbox/flex-flow-margins-auto-size.html: * css3/flexbox/flex-flow-margins.html: * css3/flexbox/flex-flow-orientations.html: * css3/flexbox/flex-flow-overflow.html: * css3/flexbox/flex-flow-padding.html: * css3/flexbox/flex-flow.html: * css3/flexbox/flex-item-child-overflow.html: * css3/flexbox/flex-item-min-size.html: * css3/flexbox/flex-justify-content.html: * css3/flexbox/flex-no-flex.html: * css3/flexbox/flexitem.html: * css3/flexbox/floated-flexbox.html: * css3/flexbox/line-wrapping.html: * css3/flexbox/multiline-align-content-horizontal-column.html: * css3/flexbox/multiline-align-content.html: * css3/flexbox/multiline-align-self.html: * css3/flexbox/multiline-column-auto.html: * css3/flexbox/multiline-justify-content.html: * css3/flexbox/multiline-reverse-wrap-overflow.html: * css3/flexbox/multiline.html: * css3/flexbox/nested-stretch.html: * css3/flexbox/orthogonal-flex-directions.html: * css3/flexbox/perpendicular-writing-modes-inside-flex-item.html: * css3/flexbox/position-absolute-child.html: * css3/flexbox/preferred-widths-orthogonal.html: * css3/flexbox/preferred-widths.html: * css3/flexbox/style-change.html: * css3/flexbox/true-centering.html: * css3/flexbox/writing-modes.html: * resources/check-layout.js: Renamed from LayoutTests/css3/flexbox/resources/flexbox.js. (.): Rename checkFlexboxen to checkLayout that takes a CSS selector. Hide functions in a closure. Canonical link: https://commits.webkit.org/109095@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-13 19:58:47 +00:00
if (!selectorList) {
console.error("You must provide a CSS selector of nodes to check.");
return;
}
var nodes = document.querySelectorAll(selectorList);
nodes = Array.prototype.slice.call(nodes);
nodes.reverse();
var checkedLayout = false;
Move layout checking js script into LayoutTest/resources and generalize https://bugs.webkit.org/show_bug.cgi?id=91268 Reviewed by Ojan Vafai. flexbox.js contains helper scripts for verifying the size and position of nodes. I will be writing similar tests for grid, so move the js file into a location for sharing and generalize the script. * css3/flexbox/align-absolute-child.html: Change include path and call. * css3/flexbox/auto-height-dynamic.html: * css3/flexbox/columns-auto-size.html: * css3/flexbox/flex-algorithm-min-max.html: * css3/flexbox/flex-algorithm-with-margins.html: * css3/flexbox/flex-algorithm.html: * css3/flexbox/flex-align-column.html: * css3/flexbox/flex-align-end.html: * css3/flexbox/flex-align-max.html: * css3/flexbox/flex-align-percent-height.html: * css3/flexbox/flex-align-stretch.html: * css3/flexbox/flex-align-vertical-writing-mode.html: * css3/flexbox/flex-align.html: * css3/flexbox/flex-flow-auto-margins.html: * css3/flexbox/flex-flow-border.html: * css3/flexbox/flex-flow-margins-auto-size.html: * css3/flexbox/flex-flow-margins.html: * css3/flexbox/flex-flow-orientations.html: * css3/flexbox/flex-flow-overflow.html: * css3/flexbox/flex-flow-padding.html: * css3/flexbox/flex-flow.html: * css3/flexbox/flex-item-child-overflow.html: * css3/flexbox/flex-item-min-size.html: * css3/flexbox/flex-justify-content.html: * css3/flexbox/flex-no-flex.html: * css3/flexbox/flexitem.html: * css3/flexbox/floated-flexbox.html: * css3/flexbox/line-wrapping.html: * css3/flexbox/multiline-align-content-horizontal-column.html: * css3/flexbox/multiline-align-content.html: * css3/flexbox/multiline-align-self.html: * css3/flexbox/multiline-column-auto.html: * css3/flexbox/multiline-justify-content.html: * css3/flexbox/multiline-reverse-wrap-overflow.html: * css3/flexbox/multiline.html: * css3/flexbox/nested-stretch.html: * css3/flexbox/orthogonal-flex-directions.html: * css3/flexbox/perpendicular-writing-modes-inside-flex-item.html: * css3/flexbox/position-absolute-child.html: * css3/flexbox/preferred-widths-orthogonal.html: * css3/flexbox/preferred-widths.html: * css3/flexbox/style-change.html: * css3/flexbox/true-centering.html: * css3/flexbox/writing-modes.html: * resources/check-layout.js: Renamed from LayoutTests/css3/flexbox/resources/flexbox.js. (.): Rename checkFlexboxen to checkLayout that takes a CSS selector. Hide functions in a closure. Canonical link: https://commits.webkit.org/109095@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-13 19:58:47 +00:00
Array.prototype.forEach.call(nodes, function(node) {
var failures = [];
checkedLayout |= checkExpectedValues(node.parentNode, failures);
checkedLayout |= checkSubtreeExpectedValues(node, failures);
2011-08-08 20:29:40 +00:00
var container = overrideContainer || (node.parentNode.className == 'container' ? node.parentNode : node);
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
var pre = document.createElement('pre');
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
if (failures.length)
pre.className = 'FAIL';
pre.appendChild(document.createTextNode(failures.length ? "FAIL:\n" + failures.join('\n') + '\n\n' + container.outerHTML : "PASS"));
insertAfter(pre, container);
2011-08-08 20:29:40 +00:00
});
if (!checkedLayout) {
document.body.innerHTML = "FAIL: No valid data-* attributes found in selector list : " + selectorList;
return;
}
implement flex-flow:column https://bugs.webkit.org/show_bug.cgi?id=70082 Reviewed by David Hyatt. Source/WebCore: There's still a bug with a FIXME where we don't compute the right size for the container of the flexbox in the presence of orthogonal flows. That's the cause of all the failing cases in the tests. Tests: css3/flexbox/flex-flow-border.html css3/flexbox/flex-flow-margins.html css3/flexbox/flex-flow-orientations.html css3/flexbox/flex-flow-overflow.html css3/flexbox/flex-flow-padding.html css3/flexbox/flex-flow.html * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutBlock): (WebCore::RenderFlexibleBox::hasOrthogonalFlow): (WebCore::RenderFlexibleBox::isColumnFlow): (WebCore::RenderFlexibleBox::isHorizontalFlow): (WebCore::RenderFlexibleBox::isLeftToRightFlow): Use isHorizontalFlow and isLeftToRightFlow so that methods like flowAwareBorderStart look exactly like borderStart with isHorizontalWritingMode and isLeftToRightDirection replaced. (WebCore::RenderFlexibleBox::setFlowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalHeightForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalWidthForChild): (WebCore::RenderFlexibleBox::flowAwareLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareLogicalWidth): (WebCore::RenderFlexibleBox::flowAwareContentLogicalHeight): (WebCore::RenderFlexibleBox::flowAwareContentLogicalWidth): (WebCore::RenderFlexibleBox::transformedWritingMode): Transform the writing-mode based of the flex-flow and direction values. That methods like flowAwareBorderBefore look exactly like borderBefore, except it switches over a different value. (WebCore::RenderFlexibleBox::flowAwareBorderStart): (WebCore::RenderFlexibleBox::flowAwareBorderBefore): (WebCore::RenderFlexibleBox::flowAwareBorderAfter): (WebCore::RenderFlexibleBox::flowAwarePaddingStart): (WebCore::RenderFlexibleBox::flowAwarePaddingBefore): (WebCore::RenderFlexibleBox::flowAwarePaddingAfter): (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild): (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginStartForChild): (WebCore::RenderFlexibleBox::setFlowAwareMarginEndForChild): (WebCore::RenderFlexibleBox::layoutAndPlaceChildrenInlineDirection): (WebCore::RenderFlexibleBox::alignChildrenBlockDirection): * rendering/RenderFlexibleBox.h: LayoutTests: * css3/flexbox/flex-flow-border-expected.txt: Added. * css3/flexbox/flex-flow-border.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow-expected.txt: Added. * css3/flexbox/flex-flow-margins-expected.txt: Added. * css3/flexbox/flex-flow-margins.html: Added. * css3/flexbox/flex-flow-orientations-expected.txt: Added. * css3/flexbox/flex-flow-orientations.html: Added. * css3/flexbox/flex-flow-overflow-expected.txt: Added. * css3/flexbox/flex-flow-overflow.html: Added. * css3/flexbox/flex-flow-padding-expected.txt: Added. * css3/flexbox/flex-flow-padding.html: Added. Failures are due to not handling orthogonal flows correctly. * css3/flexbox/flex-flow.html: Added. * css3/flexbox/resources/flexbox.js: Added the ability to check offsets that include clientLeft/clientTop and for checking clientWidth/clientHeight. This is neede dfor the border tests. Canonical link: https://commits.webkit.org/86501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97783 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2011-10-18 19:35:14 +00:00
var pre = document.querySelector('.FAIL');
if (pre)
setTimeout(function() { pre.previousSibling.scrollIntoView(); }, 0);
2011-08-08 20:29:40 +00:00
}
Move layout checking js script into LayoutTest/resources and generalize https://bugs.webkit.org/show_bug.cgi?id=91268 Reviewed by Ojan Vafai. flexbox.js contains helper scripts for verifying the size and position of nodes. I will be writing similar tests for grid, so move the js file into a location for sharing and generalize the script. * css3/flexbox/align-absolute-child.html: Change include path and call. * css3/flexbox/auto-height-dynamic.html: * css3/flexbox/columns-auto-size.html: * css3/flexbox/flex-algorithm-min-max.html: * css3/flexbox/flex-algorithm-with-margins.html: * css3/flexbox/flex-algorithm.html: * css3/flexbox/flex-align-column.html: * css3/flexbox/flex-align-end.html: * css3/flexbox/flex-align-max.html: * css3/flexbox/flex-align-percent-height.html: * css3/flexbox/flex-align-stretch.html: * css3/flexbox/flex-align-vertical-writing-mode.html: * css3/flexbox/flex-align.html: * css3/flexbox/flex-flow-auto-margins.html: * css3/flexbox/flex-flow-border.html: * css3/flexbox/flex-flow-margins-auto-size.html: * css3/flexbox/flex-flow-margins.html: * css3/flexbox/flex-flow-orientations.html: * css3/flexbox/flex-flow-overflow.html: * css3/flexbox/flex-flow-padding.html: * css3/flexbox/flex-flow.html: * css3/flexbox/flex-item-child-overflow.html: * css3/flexbox/flex-item-min-size.html: * css3/flexbox/flex-justify-content.html: * css3/flexbox/flex-no-flex.html: * css3/flexbox/flexitem.html: * css3/flexbox/floated-flexbox.html: * css3/flexbox/line-wrapping.html: * css3/flexbox/multiline-align-content-horizontal-column.html: * css3/flexbox/multiline-align-content.html: * css3/flexbox/multiline-align-self.html: * css3/flexbox/multiline-column-auto.html: * css3/flexbox/multiline-justify-content.html: * css3/flexbox/multiline-reverse-wrap-overflow.html: * css3/flexbox/multiline.html: * css3/flexbox/nested-stretch.html: * css3/flexbox/orthogonal-flex-directions.html: * css3/flexbox/perpendicular-writing-modes-inside-flex-item.html: * css3/flexbox/position-absolute-child.html: * css3/flexbox/preferred-widths-orthogonal.html: * css3/flexbox/preferred-widths.html: * css3/flexbox/style-change.html: * css3/flexbox/true-centering.html: * css3/flexbox/writing-modes.html: * resources/check-layout.js: Renamed from LayoutTests/css3/flexbox/resources/flexbox.js. (.): Rename checkFlexboxen to checkLayout that takes a CSS selector. Hide functions in a closure. Canonical link: https://commits.webkit.org/109095@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@122623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-07-13 19:58:47 +00:00
})();