author | Mounir Lamouri <mounir.lamouri@gmail.com> |
Mon, 22 Aug 2011 20:38:06 +0200 | |
changeset 76981 | f2d73e22ea287d8c146afc1dde8f27aae711443c |
parent 76980 | e10579e136f1859c067da16eeb0b46f23bb775e6 |
child 76982 | 742b8b74473e1210497adb80c034607dbc35b7f7 |
push id | 78 |
push user | clegnitto@mozilla.com |
push date | Fri, 16 Dec 2011 17:32:24 +0000 |
treeherder | mozilla-release@79d24e644fdd [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | dbaron |
bugs | 680747 |
milestone | 9.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/layout/forms/nsProgressFrame.cpp +++ b/layout/forms/nsProgressFrame.cpp @@ -274,16 +274,38 @@ nsProgressFrame::ComputeAutoSize(nsRende autoSize.height *= 10; // 10em } else { autoSize.width *= 10; // 10em } return autoSize; } +nscoord +nsProgressFrame::GetMinWidth(nsRenderingContext *aRenderingContext) +{ + nsRefPtr<nsFontMetrics> fontMet; + NS_ENSURE_SUCCESS( + nsLayoutUtils::GetFontMetricsForFrame(this, getter_AddRefs(fontMet)), 0); + + nscoord minWidth = fontMet->Font().size; // 1em + + if (GetStyleDisplay()->mOrient == NS_STYLE_ORIENT_HORIZONTAL) { + minWidth *= 10; // 10em + } + + return minWidth; +} + +nscoord +nsProgressFrame::GetPrefWidth(nsRenderingContext *aRenderingContext) +{ + return GetMinWidth(aRenderingContext); +} + bool nsProgressFrame::ShouldUseNativeStyle() const { // Use the native style if these conditions are satisfied: // - both frames use the native appearance; // - neither frame has author specified rules setting the border or the // background. return GetStyleDisplay()->mAppearance == NS_THEME_PROGRESSBAR &&
--- a/layout/forms/nsProgressFrame.h +++ b/layout/forms/nsProgressFrame.h @@ -79,16 +79,19 @@ public: nsIAtom* aAttribute, PRInt32 aModType); virtual nsSize ComputeAutoSize(nsRenderingContext *aRenderingContext, nsSize aCBSize, nscoord aAvailableWidth, nsSize aMargin, nsSize aBorder, nsSize aPadding, PRBool aShrinkWrap); + virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext); + virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext); + virtual PRBool IsFrameOfType(PRUint32 aFlags) const { return nsHTMLContainerFrame::IsFrameOfType(aFlags & ~(nsIFrame::eReplaced | nsIFrame::eReplacedContainsBlock)); } /** * Returns whether the frame and its child should use the native style.
--- a/layout/reftests/forms/progress/reftest.list +++ b/layout/reftests/forms/progress/reftest.list @@ -17,8 +17,9 @@ # The following test is disabled but kept in the repository because the # transformations will not behave exactly the same for <progress> and two divs. # However, it would be possible to manually check those. # == transformations.html transformations-ref.html # Tests for bugs: == block-invalidate.html block-invalidate-ref.html +== in-cells.html in-cells-ref.html