diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-10-24 11:13:33 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-10-24 11:13:33 +0200 |
commit | 579881ffb4aa0b145c793825cd1b0628e7cd6cdc (patch) | |
tree | 65d59fc6b73f120ac1bc2214d4a8442421076b04 /layout | |
parent | a02c44648a3f7d6f3904eebba026ce5e6f781bef (diff) | |
parent | f71c04d814416ebf52dd54109f2d04f1cbd397c0 (diff) | |
download | UXP-579881ffb4aa0b145c793825cd1b0628e7cd6cdc.tar UXP-579881ffb4aa0b145c793825cd1b0628e7cd6cdc.tar.gz UXP-579881ffb4aa0b145c793825cd1b0628e7cd6cdc.tar.lz UXP-579881ffb4aa0b145c793825cd1b0628e7cd6cdc.tar.xz UXP-579881ffb4aa0b145c793825cd1b0628e7cd6cdc.zip |
Merge branch 'master' into Sync-weave
Diffstat (limited to 'layout')
-rw-r--r-- | layout/base/nsCaret.cpp | 8 | ||||
-rw-r--r-- | layout/generic/nsGridContainerFrame.cpp | 8 | ||||
-rw-r--r-- | layout/reftests/css-grid/bug1349571-ref.html | 90 | ||||
-rw-r--r-- | layout/reftests/css-grid/bug1349571.html | 94 | ||||
-rw-r--r-- | layout/reftests/css-grid/bug1356820-ref.html | 81 | ||||
-rw-r--r-- | layout/reftests/css-grid/bug1356820.html | 81 | ||||
-rw-r--r-- | layout/reftests/css-grid/reftest.list | 2 | ||||
-rw-r--r-- | layout/tables/nsTableFrame.cpp | 79 |
8 files changed, 401 insertions, 42 deletions
diff --git a/layout/base/nsCaret.cpp b/layout/base/nsCaret.cpp index 8ad435950..eca22f3ba 100644 --- a/layout/base/nsCaret.cpp +++ b/layout/base/nsCaret.cpp @@ -117,6 +117,12 @@ IsBidiUI() return Preferences::GetBool("bidi.browser.ui"); } +static bool +CjkThickCaret() +{ + return Preferences::GetBool("layout.cjkthickcaret"); +} + nsCaret::nsCaret() : mOverrideOffset(0) , mBlinkCount(-1) @@ -190,7 +196,7 @@ nsCaret::ComputeMetrics(nsIFrame* aFrame, int32_t aOffset, nscoord aCaretHeight) nsPresContext::CSSPixelsToAppUnits( LookAndFeel::GetInt(LookAndFeel::eIntID_CaretWidth, 1)); - if (DrawCJKCaret(aFrame, aOffset)) { + if (DrawCJKCaret(aFrame, aOffset) && CjkThickCaret()) { caretWidth += nsPresContext::CSSPixelsToAppUnits(1); } nscoord bidiIndicatorSize = nsPresContext::CSSPixelsToAppUnits(kMinBidiIndicatorPixels); diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 8f117b5ab..fbd61f783 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -3714,8 +3714,11 @@ MeasuringReflow(nsIFrame* aChild, parent->Properties().Set( nsContainerFrame::DebugReflowingWithInfiniteISize(), true); #endif - uint32_t riFlags = ReflowInput::COMPUTE_SIZE_SHRINK_WRAP | - ReflowInput::COMPUTE_SIZE_USE_AUTO_BSIZE; + auto wm = aChild->GetWritingMode(); + uint32_t riFlags = ReflowInput::COMPUTE_SIZE_USE_AUTO_BSIZE; + if (aAvailableSize.ISize(wm) == INFINITE_ISIZE_COORD) { + riFlags |= ReflowInput::COMPUTE_SIZE_SHRINK_WRAP; + } if (aIMinSizeClamp != NS_MAXSIZE) { riFlags |= ReflowInput::I_CLAMP_MARGIN_BOX_MIN_SIZE; } @@ -3730,7 +3733,6 @@ MeasuringReflow(nsIFrame* aChild, ReflowOutput childSize(childRI); nsReflowStatus childStatus; const uint32_t flags = NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW; - WritingMode wm = childRI.GetWritingMode(); parent->ReflowChild(aChild, pc, childSize, childRI, wm, LogicalPoint(wm), nsSize(), flags, childStatus); parent->FinishReflowChild(aChild, pc, childSize, &childRI, wm, diff --git a/layout/reftests/css-grid/bug1349571-ref.html b/layout/reftests/css-grid/bug1349571-ref.html new file mode 100644 index 000000000..42efd731a --- /dev/null +++ b/layout/reftests/css-grid/bug1349571-ref.html @@ -0,0 +1,90 @@ +<!DOCTYPE html>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta charset="utf-8">
+ <title>Testcase for bug 1349571</title>
+ <style type="text/css">
+html,body {
+ color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
+}
+
+.container {
+ display: grid;
+ grid: 250px / 500px;
+ border: 3px solid;
+ width: 500px;
+}
+
+.responsive-container {
+ background: lightgrey;
+}
+
+ </style>
+<script>try {
+(function() {
+ var target = 'blur';
+ if ( target === '' || target === '{{1}}' ) { return; }
+ var needle = 'mz_str', reText = '.?';
+ if ( needle !== '' && needle !== '{{2}}' ) {
+ reText = /^\/.+\/$/.test(needle)
+ ? needle.slice(1,-1)
+ : needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ }
+ var re = new RegExp(reText);
+ var chain = target.split('.');
+ var owner = window, prop;
+ for (;;) {
+ prop = chain.shift();
+ if ( chain.length === 0 ) { break; }
+ owner = owner[prop];
+ if ( owner instanceof Object === false ) { return; }
+ }
+ var desc = Object.getOwnPropertyDescriptor(owner, prop);
+ if ( desc && desc.get !== undefined ) { return; }
+ var magic = String.fromCharCode(Date.now() % 26 + 97) +
+ Math.floor(Math.random() * 982451653 + 982451653).toString(36);
+ var value = owner[prop];
+ var validate = function() {
+ var e = document.currentScript;
+ if ( e instanceof HTMLScriptElement && e.src === '' && re.test(e.textContent) ) {
+ throw new ReferenceError(magic);
+ }
+ };
+ Object.defineProperty(owner, prop, {
+ get: function() {
+ validate();
+ return value;
+ },
+ set: function(a) {
+ validate();
+ value = a;
+ }
+ });
+ var oe = window.onerror;
+ window.onerror = function(msg) {
+ if ( typeof msg === 'string' && msg.indexOf(magic) !== -1 ) {
+ return true;
+ }
+ if ( oe instanceof Function ) {
+ return oe.apply(this, arguments);
+ }
+ }.bind();
+})();
+} catch ( e ) { }
+(function() {
+ var c = document.currentScript, p = c && c.parentNode;
+ if ( p ) { p.removeChild(c); }
+})();</script></head>
+<body>
+
+<div class="container">
+ <div class="responsive-container"></div>
+</div>
+
+
+
+</body></html>
\ No newline at end of file diff --git a/layout/reftests/css-grid/bug1349571.html b/layout/reftests/css-grid/bug1349571.html new file mode 100644 index 000000000..f836fe36e --- /dev/null +++ b/layout/reftests/css-grid/bug1349571.html @@ -0,0 +1,94 @@ +<!DOCTYPE html>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <meta charset="utf-8">
+ <title>Testcase for bug 1349571</title>
+ <style type="text/css">
+html,body {
+ color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
+}
+
+.container {
+ display: grid;
+ grid-template-columns: 1fr;
+ border: 3px solid;
+ width: 500px;
+}
+
+.responsive-container {
+ padding-bottom: 50%;
+ height: 0;
+ background: lightgrey;
+}
+
+ </style>
+<script>try {
+(function() {
+ var target = 'blur';
+ if ( target === '' || target === '{{1}}' ) { return; }
+ var needle = 'mz_str', reText = '.?';
+ if ( needle !== '' && needle !== '{{2}}' ) {
+ reText = /^\/.+\/$/.test(needle)
+ ? needle.slice(1,-1)
+ : needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ }
+ var re = new RegExp(reText);
+ var chain = target.split('.');
+ var owner = window, prop;
+ for (;;) {
+ prop = chain.shift();
+ if ( chain.length === 0 ) { break; }
+ owner = owner[prop];
+ if ( owner instanceof Object === false ) { return; }
+ }
+ var desc = Object.getOwnPropertyDescriptor(owner, prop);
+ if ( desc && desc.get !== undefined ) { return; }
+ var magic = String.fromCharCode(Date.now() % 26 + 97) +
+ Math.floor(Math.random() * 982451653 + 982451653).toString(36);
+ var value = owner[prop];
+ var validate = function() {
+ var e = document.currentScript;
+ if ( e instanceof HTMLScriptElement && e.src === '' && re.test(e.textContent) ) {
+ throw new ReferenceError(magic);
+ }
+ };
+ Object.defineProperty(owner, prop, {
+ get: function() {
+ validate();
+ return value;
+ },
+ set: function(a) {
+ validate();
+ value = a;
+ }
+ });
+ var oe = window.onerror;
+ window.onerror = function(msg) {
+ if ( typeof msg === 'string' && msg.indexOf(magic) !== -1 ) {
+ return true;
+ }
+ if ( oe instanceof Function ) {
+ return oe.apply(this, arguments);
+ }
+ }.bind();
+})();
+} catch ( e ) { }
+(function() {
+ var c = document.currentScript, p = c && c.parentNode;
+ if ( p ) { p.removeChild(c); }
+})();</script></head>
+<body>
+
+<div class="container">
+ <div>
+ <div class="responsive-container"></div>
+ </div>
+</div>
+
+
+
+</body></html>
\ No newline at end of file diff --git a/layout/reftests/css-grid/bug1356820-ref.html b/layout/reftests/css-grid/bug1356820-ref.html new file mode 100644 index 000000000..b203ba203 --- /dev/null +++ b/layout/reftests/css-grid/bug1356820-ref.html @@ -0,0 +1,81 @@ +<!DOCTYPE html>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"><script>try {
+(function() {
+ var target = 'blur';
+ if ( target === '' || target === '{{1}}' ) { return; }
+ var needle = 'mz_str', reText = '.?';
+ if ( needle !== '' && needle !== '{{2}}' ) {
+ reText = /^\/.+\/$/.test(needle)
+ ? needle.slice(1,-1)
+ : needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ }
+ var re = new RegExp(reText);
+ var chain = target.split('.');
+ var owner = window, prop;
+ for (;;) {
+ prop = chain.shift();
+ if ( chain.length === 0 ) { break; }
+ owner = owner[prop];
+ if ( owner instanceof Object === false ) { return; }
+ }
+ var desc = Object.getOwnPropertyDescriptor(owner, prop);
+ if ( desc && desc.get !== undefined ) { return; }
+ var magic = String.fromCharCode(Date.now() % 26 + 97) +
+ Math.floor(Math.random() * 982451653 + 982451653).toString(36);
+ var value = owner[prop];
+ var validate = function() {
+ var e = document.currentScript;
+ if ( e instanceof HTMLScriptElement && e.src === '' && re.test(e.textContent) ) {
+ throw new ReferenceError(magic);
+ }
+ };
+ Object.defineProperty(owner, prop, {
+ get: function() {
+ validate();
+ return value;
+ },
+ set: function(a) {
+ validate();
+ value = a;
+ }
+ });
+ var oe = window.onerror;
+ window.onerror = function(msg) {
+ if ( typeof msg === 'string' && msg.indexOf(magic) !== -1 ) {
+ return true;
+ }
+ if ( oe instanceof Function ) {
+ return oe.apply(this, arguments);
+ }
+ }.bind();
+})();
+} catch ( e ) { }
+(function() {
+ var c = document.currentScript, p = c && c.parentNode;
+ if ( p ) { p.removeChild(c); }
+})();</script></head><body><div style="display: grid; width: 5em;">
+ <div style="word-wrap: break-word; width: 5em; justify-self:start">
+ first item with a longlonglongword
+ </div>
+ <div>
+ second item
+ </div>
+</div>
+<div style="display: grid; width: 5em;">
+ <div style="width: 5em; justify-self:start">
+ first item with a longlonglongword
+ </div>
+ <div>
+ second item
+ </div>
+</div>
+<div style="display: grid; width: 5em;">
+ <div style="word-wrap: break-word; writing-mode:vertical-lr; justify-self:start">
+ first item with a longlonglongword
+ </div>
+ <div>
+ second item
+ </div>
+</div>
+</body></html>
\ No newline at end of file diff --git a/layout/reftests/css-grid/bug1356820.html b/layout/reftests/css-grid/bug1356820.html new file mode 100644 index 000000000..2f2f36014 --- /dev/null +++ b/layout/reftests/css-grid/bug1356820.html @@ -0,0 +1,81 @@ +<!DOCTYPE html>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"><script>try {
+(function() {
+ var target = 'blur';
+ if ( target === '' || target === '{{1}}' ) { return; }
+ var needle = 'mz_str', reText = '.?';
+ if ( needle !== '' && needle !== '{{2}}' ) {
+ reText = /^\/.+\/$/.test(needle)
+ ? needle.slice(1,-1)
+ : needle.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
+ }
+ var re = new RegExp(reText);
+ var chain = target.split('.');
+ var owner = window, prop;
+ for (;;) {
+ prop = chain.shift();
+ if ( chain.length === 0 ) { break; }
+ owner = owner[prop];
+ if ( owner instanceof Object === false ) { return; }
+ }
+ var desc = Object.getOwnPropertyDescriptor(owner, prop);
+ if ( desc && desc.get !== undefined ) { return; }
+ var magic = String.fromCharCode(Date.now() % 26 + 97) +
+ Math.floor(Math.random() * 982451653 + 982451653).toString(36);
+ var value = owner[prop];
+ var validate = function() {
+ var e = document.currentScript;
+ if ( e instanceof HTMLScriptElement && e.src === '' && re.test(e.textContent) ) {
+ throw new ReferenceError(magic);
+ }
+ };
+ Object.defineProperty(owner, prop, {
+ get: function() {
+ validate();
+ return value;
+ },
+ set: function(a) {
+ validate();
+ value = a;
+ }
+ });
+ var oe = window.onerror;
+ window.onerror = function(msg) {
+ if ( typeof msg === 'string' && msg.indexOf(magic) !== -1 ) {
+ return true;
+ }
+ if ( oe instanceof Function ) {
+ return oe.apply(this, arguments);
+ }
+ }.bind();
+})();
+} catch ( e ) { }
+(function() {
+ var c = document.currentScript, p = c && c.parentNode;
+ if ( p ) { p.removeChild(c); }
+})();</script></head><body><div style="display: grid; width: 5em;">
+ <div style="word-wrap: break-word; min-width: 0;">
+ first item with a longlonglongword
+ </div>
+ <div>
+ second item
+ </div>
+</div>
+<div style="display: grid; width: 5em;">
+ <div style="min-width: 0;">
+ first item with a longlonglongword
+ </div>
+ <div>
+ second item
+ </div>
+</div>
+<div style="display: grid; width: 5em;">
+ <div style="word-wrap: break-word; min-height: 0; writing-mode:vertical-lr">
+ first item with a longlonglongword
+ </div>
+ <div>
+ second item
+ </div>
+</div>
+</body></html>
\ No newline at end of file diff --git a/layout/reftests/css-grid/reftest.list b/layout/reftests/css-grid/reftest.list index c2ee57c1a..3087ca49b 100644 --- a/layout/reftests/css-grid/reftest.list +++ b/layout/reftests/css-grid/reftest.list @@ -280,3 +280,5 @@ asserts(1-10) == grid-fragmentation-dyn4-021.html grid-fragmentation-021-ref.htm == grid-fragmentation-dyn2-031.html grid-fragmentation-031-ref.html == bug1306106.html bug1306106-ref.html == grid-percent-intrinsic-sizing-001.html grid-percent-intrinsic-sizing-001-ref.html +== bug1349571.html bug1349571-ref.html +== bug1356820.html bug1356820-ref.html diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 5030804ed..4c11d2704 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -2681,14 +2681,14 @@ nsTableFrame::GetOuterBCBorder(const WritingMode aWM) const const_cast<nsTableFrame*>(this)->CalcBCBorders(); } - int32_t p2t = nsPresContext::AppUnitsPerCSSPixel(); + int32_t d2a = PresContext()->AppUnitsPerDevPixel(); BCPropertyData* propData = GetBCProperty(); if (propData) { return LogicalMargin(aWM, - BC_BORDER_START_HALF_COORD(p2t, propData->mBStartBorderWidth), - BC_BORDER_END_HALF_COORD(p2t, propData->mIEndBorderWidth), - BC_BORDER_END_HALF_COORD(p2t, propData->mBEndBorderWidth), - BC_BORDER_START_HALF_COORD(p2t, propData->mIStartBorderWidth)); + BC_BORDER_START_HALF_COORD(d2a, propData->mBStartBorderWidth), + BC_BORDER_END_HALF_COORD(d2a, propData->mIEndBorderWidth), + BC_BORDER_END_HALF_COORD(d2a, propData->mBEndBorderWidth), + BC_BORDER_START_HALF_COORD(d2a, propData->mIStartBorderWidth)); } return LogicalMargin(aWM); } @@ -2700,14 +2700,14 @@ nsTableFrame::GetIncludedOuterBCBorder(const WritingMode aWM) const const_cast<nsTableFrame*>(this)->CalcBCBorders(); } - int32_t p2t = nsPresContext::AppUnitsPerCSSPixel(); + int32_t d2a = PresContext()->AppUnitsPerDevPixel(); BCPropertyData* propData = GetBCProperty(); if (propData) { return LogicalMargin(aWM, - BC_BORDER_START_HALF_COORD(p2t, propData->mBStartBorderWidth), - BC_BORDER_END_HALF_COORD(p2t, propData->mIEndCellBorderWidth), - BC_BORDER_END_HALF_COORD(p2t, propData->mBEndBorderWidth), - BC_BORDER_START_HALF_COORD(p2t, propData->mIStartCellBorderWidth)); + BC_BORDER_START_HALF_COORD(d2a, propData->mBStartBorderWidth), + BC_BORDER_END_HALF_COORD(d2a, propData->mIEndCellBorderWidth), + BC_BORDER_END_HALF_COORD(d2a, propData->mBEndBorderWidth), + BC_BORDER_START_HALF_COORD(d2a, propData->mIStartCellBorderWidth)); } return LogicalMargin(aWM); } @@ -4791,7 +4791,7 @@ GetColorAndStyle(const nsIFrame* aFrame, if (aWidth) { nscoord width = styleData->GetComputedBorderWidth(physicalSide); - *aWidth = nsPresContext::AppUnitsToIntCSSPixels(width); + *aWidth = aFrame->PresContext()->AppUnitsToDevPixels(width); } } @@ -6476,8 +6476,8 @@ BCPaintBorderIterator::SetDamageArea(const nsRect& aDirtyRect) nscoord rowBSize = rowFrame->BSize(mTableWM); if (haveIntersect) { // conservatively estimate the half border widths outside the row - nscoord borderHalf = mTable->GetPrevInFlow() ? 0 : nsPresContext:: - CSSPixelsToAppUnits(rowFrame->GetBStartBCBorderWidth() + 1); + nscoord borderHalf = mTable->GetPrevInFlow() ? 0 : + mTable->PresContext()->DevPixelsToAppUnits(rowFrame->GetBStartBCBorderWidth() + 1); if (dirtyRect.BEnd(mTableWM) >= rowB - borderHalf) { nsTableRowFrame* fifRow = static_cast<nsTableRowFrame*>(rowFrame->FirstInFlow()); @@ -6487,8 +6487,8 @@ BCPaintBorderIterator::SetDamageArea(const nsRect& aDirtyRect) } else { // conservatively estimate the half border widths outside the row - nscoord borderHalf = mTable->GetNextInFlow() ? 0 : nsPresContext:: - CSSPixelsToAppUnits(rowFrame->GetBEndBCBorderWidth() + 1); + nscoord borderHalf = mTable->GetNextInFlow() ? 0 : + mTable->PresContext()->DevPixelsToAppUnits(rowFrame->GetBEndBCBorderWidth() + 1); if (rowB + rowBSize + borderHalf >= dirtyRect.BStart(mTableWM)) { mStartRg = rgFrame; mStartRow = rowFrame; @@ -6532,8 +6532,8 @@ BCPaintBorderIterator::SetDamageArea(const nsRect& aDirtyRect) nscoord colISize = colFrame->ISize(mTableWM); if (haveIntersect) { // conservatively estimate the iStart half border width outside the col - nscoord iStartBorderHalf = nsPresContext:: - CSSPixelsToAppUnits(colFrame->GetIStartBorderWidth() + 1); + nscoord iStartBorderHalf = + mTable->PresContext()->DevPixelsToAppUnits(colFrame->GetIStartBorderWidth() + 1); if (dirtyRect.IEnd(mTableWM) >= x - iStartBorderHalf) { endColIndex = colIdx; } @@ -6541,8 +6541,8 @@ BCPaintBorderIterator::SetDamageArea(const nsRect& aDirtyRect) } else { // conservatively estimate the iEnd half border width outside the col - nscoord iEndBorderHalf = nsPresContext:: - CSSPixelsToAppUnits(colFrame->GetIEndBorderWidth() + 1); + nscoord iEndBorderHalf = + mTable->PresContext()->DevPixelsToAppUnits(colFrame->GetIEndBorderWidth() + 1); if (x + colISize + iEndBorderHalf >= dirtyRect.IStart(mTableWM)) { startColIndex = endColIndex = colIdx; haveIntersect = true; @@ -6785,7 +6785,8 @@ CalcVerCornerOffset(LogicalSide aCornerOwnerSide, BCPixelSize aCornerSubWidth, BCPixelSize aHorWidth, bool aIsStartOfSeg, - bool aIsBevel) + bool aIsBevel, + nsPresContext* aPresContext) { nscoord offset = 0; // XXX These should be replaced with appropriate side-specific macros (which?) @@ -6808,7 +6809,7 @@ CalcVerCornerOffset(LogicalSide aCornerOwnerSide, offset = (aIsStartOfSeg) ? smallHalf : -largeHalf; } } - return nsPresContext::CSSPixelsToAppUnits(offset); + return aPresContext->DevPixelsToAppUnits(offset); } /** Compute the horizontal offset of a horizontal border segment @@ -6824,7 +6825,8 @@ CalcHorCornerOffset(LogicalSide aCornerOwnerSide, BCPixelSize aCornerSubWidth, BCPixelSize aVerWidth, bool aIsStartOfSeg, - bool aIsBevel) + bool aIsBevel, + nsPresContext* aPresContext) { nscoord offset = 0; // XXX These should be replaced with appropriate side-specific macros (which?) @@ -6847,7 +6849,7 @@ CalcHorCornerOffset(LogicalSide aCornerOwnerSide, offset = (aIsStartOfSeg) ? smallHalf : -largeHalf; } } - return nsPresContext::CSSPixelsToAppUnits(offset); + return aPresContext->DevPixelsToAppUnits(offset); } BCBlockDirSeg::BCBlockDirSeg() @@ -6883,10 +6885,10 @@ BCBlockDirSeg::Start(BCPaintBorderIterator& aIter, BCPixelSize maxInlineSegBSize = std::max(aIter.mPrevInlineSegBSize, aInlineSegBSize); nscoord offset = CalcVerCornerOffset(ownerSide, cornerSubWidth, maxInlineSegBSize, true, - bStartBevel); + bStartBevel, aIter.mTable->PresContext()); mBStartBevelOffset = bStartBevel ? - nsPresContext::CSSPixelsToAppUnits(maxInlineSegBSize): 0; + aIter.mTable->PresContext()->DevPixelsToAppUnits(maxInlineSegBSize): 0; // XXX this assumes that only corners where 2 segments join can be beveled mBStartBevelSide = (aInlineSegBSize > 0) ? eLogicalSideIEnd : eLogicalSideIStart; mOffsetB += offset; @@ -6944,8 +6946,8 @@ BCBlockDirSeg::GetBEndCorner(BCPaintBorderIterator& aIter, mIsBEndBevel = (mWidth > 0) ? bevel : false; mBEndInlineSegBSize = std::max(aIter.mPrevInlineSegBSize, aInlineSegBSize); mBEndOffset = CalcVerCornerOffset(ownerSide, cornerSubWidth, - mBEndInlineSegBSize, - false, mIsBEndBevel); + mBEndInlineSegBSize, false, + mIsBEndBevel, aIter.mTable->PresContext()); mLength += mBEndOffset; } @@ -7029,11 +7031,11 @@ BCBlockDirSeg::Paint(BCPaintBorderIterator& aIter, BCPixelSize smallHalf, largeHalf; DivideBCBorderSize(mWidth, smallHalf, largeHalf); LogicalRect segRect(aIter.mTableWM, - mOffsetI - nsPresContext::CSSPixelsToAppUnits(largeHalf), + mOffsetI - aIter.mTable->PresContext()->DevPixelsToAppUnits(largeHalf), mOffsetB, - nsPresContext::CSSPixelsToAppUnits(mWidth), mLength); + aIter.mTable->PresContext()->DevPixelsToAppUnits(mWidth), mLength); nscoord bEndBevelOffset = (mIsBEndBevel) ? - nsPresContext::CSSPixelsToAppUnits(mBEndInlineSegBSize) : 0; + aIter.mTable->PresContext()->DevPixelsToAppUnits(mBEndInlineSegBSize) : 0; LogicalSide bEndBevelSide = (aInlineSegBSize > 0) ? eLogicalSideIEnd : eLogicalSideIStart; @@ -7067,7 +7069,7 @@ BCBlockDirSeg::Paint(BCPaintBorderIterator& aIter, nsCSSRendering::DrawTableBorderSegment(aDrawTarget, style, color, aIter.mTableBgColor, physicalRect, appUnitsPerDevPixel, - nsPresContext::AppUnitsPerCSSPixel(), + aIter.mTable->PresContext()->AppUnitsPerDevPixel(), startBevelSide, startBevelOffset, endBevelSide, endBevelOffset); } @@ -7123,7 +7125,8 @@ BCInlineDirSeg::Start(BCPaintBorderIterator& aIter, nscoord maxBlockSegISize = std::max(aIter.mBlockDirInfo[relColIndex].mWidth, aBEndBlockSegISize); nscoord offset = CalcHorCornerOffset(cornerOwnerSide, cornerSubWidth, - maxBlockSegISize, true, iStartBevel); + maxBlockSegISize, true, iStartBevel, + aIter.mTable->PresContext()); mIStartBevelOffset = (iStartBevel && (aInlineSegBSize > 0)) ? maxBlockSegISize : 0; // XXX this assumes that only corners where 2 segments join can be beveled mIStartBevelSide = (aBEndBlockSegISize > 0) ? eLogicalSideBEnd : eLogicalSideBStart; @@ -7157,10 +7160,10 @@ BCInlineDirSeg::GetIEndCorner(BCPaintBorderIterator& aIter, nscoord verWidth = std::max(aIter.mBlockDirInfo[relColIndex].mWidth, aIStartSegISize); mEndOffset = CalcHorCornerOffset(ownerSide, cornerSubWidth, verWidth, - false, mIsIEndBevel); + false, mIsIEndBevel, aIter.mTable->PresContext()); mLength += mEndOffset; mIEndBevelOffset = (mIsIEndBevel) ? - nsPresContext::CSSPixelsToAppUnits(verWidth) : 0; + aIter.mTable->PresContext()->DevPixelsToAppUnits(verWidth) : 0; mIEndBevelSide = (aIStartSegISize > 0) ? eLogicalSideBEnd : eLogicalSideBStart; } @@ -7240,9 +7243,9 @@ BCInlineDirSeg::Paint(BCPaintBorderIterator& aIter, DrawTarget& aDrawTarget) BCPixelSize smallHalf, largeHalf; DivideBCBorderSize(mWidth, smallHalf, largeHalf); LogicalRect segRect(aIter.mTableWM, mOffsetI, - mOffsetB - nsPresContext::CSSPixelsToAppUnits(largeHalf), + mOffsetB - aIter.mTable->PresContext()->DevPixelsToAppUnits(largeHalf), mLength, - nsPresContext::CSSPixelsToAppUnits(mWidth)); + aIter.mTable->PresContext()->DevPixelsToAppUnits(mWidth)); // Convert logical to physical sides/coordinates for DrawTableBorderSegment. nsRect physicalRect = segRect.GetPhysicalRect(aIter.mTableWM, @@ -7250,7 +7253,7 @@ BCInlineDirSeg::Paint(BCPaintBorderIterator& aIter, DrawTarget& aDrawTarget) uint8_t startBevelSide = aIter.mTableWM.PhysicalSide(mIStartBevelSide); uint8_t endBevelSide = aIter.mTableWM.PhysicalSide(mIEndBevelSide); nscoord startBevelOffset = - nsPresContext::CSSPixelsToAppUnits(mIStartBevelOffset); + aIter.mTable->PresContext()->DevPixelsToAppUnits(mIStartBevelOffset); nscoord endBevelOffset = mIEndBevelOffset; // With inline-RTL directionality, the 'start' and 'end' of the inline-dir // border segment need to be swapped because DrawTableBorderSegment will @@ -7271,7 +7274,7 @@ BCInlineDirSeg::Paint(BCPaintBorderIterator& aIter, DrawTarget& aDrawTarget) nsCSSRendering::DrawTableBorderSegment(aDrawTarget, style, color, aIter.mTableBgColor, physicalRect, appUnitsPerDevPixel, - nsPresContext::AppUnitsPerCSSPixel(), + aIter.mTable->PresContext()->AppUnitsPerDevPixel(), startBevelSide, startBevelOffset, endBevelSide, endBevelOffset); } |