diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp index 5fca84b3e6a..c306281a75a 100644 --- a/layout/style/nsComputedDOMStyle.cpp +++ b/layout/style/nsComputedDOMStyle.cpp @@ -2861,16 +2861,11 @@ nsComputedDOMStyle::GetBorderWidthFor(PRUint8 aSide, nsIDOMCSSValue** aValue) NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY); nscoord width; - const nsStyleDisplay *disp = GetStyleDisplay(); - if (mFrame && mFrame->IsThemed(disp)) { - nsMargin result; - nsPresContext *presContext = mFrame->PresContext(); - presContext->GetTheme()->GetWidgetBorder(presContext->DeviceContext(), - mFrame, disp->mAppearance, - &result); - width = presContext->DevPixelsToAppUnits(result.side(aSide)); + if (mFrame) { + FlushPendingReflows(); + width = mFrame->GetUsedBorder().side(aSide); } else { - width = GetStyleBorder()->GetComputedBorderWidth(aSide); + width = GetStyleBorder()->GetBorderWidth(aSide); } val->SetAppUnits(width); diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index e1df53f43f8..47edcfa14f2 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -389,15 +389,6 @@ struct nsStyleBorder { return mActualBorder.side(aSide); } - // Get the computed border width for a particular side, in twips. Note that - // this is zero if and only if there is no border to be painted for this - // side. That is, this value takes into account the border style and the - // value is rounded to the nearest device pixel by NS_ROUND_BORDER_TO_PIXELS. - nscoord GetComputedBorderWidth(PRUint8 aSide) const - { - return mActualBorder.side(aSide) ? mBorder.side(aSide) : 0; - } - PRUint8 GetBorderStyle(PRUint8 aSide) const { NS_ASSERTION(aSide <= NS_SIDE_LEFT, "bad side"); diff --git a/layout/style/test/Makefile.in b/layout/style/test/Makefile.in index eeec8c20481..5209ea8d005 100644 --- a/layout/style/test/Makefile.in +++ b/layout/style/test/Makefile.in @@ -85,6 +85,7 @@ _TEST_FILES = test_bug74880.html \ test_bug391221.html \ test_bug397427.html \ test_bug405818.html \ + test_bug412901.html \ test_compute_data_with_start_struct.html \ test_dont_use_document_colors.html \ test_inherit_storage.html \ diff --git a/layout/style/test/test_bug412901.html b/layout/style/test/test_bug412901.html new file mode 100644 index 00000000000..f28f3b4745f --- /dev/null +++ b/layout/style/test/test_bug412901.html @@ -0,0 +1,43 @@ + + + +
++ ++ +