From 35e6293e4bdb3c846c7a961bb4248d60e403b424 Mon Sep 17 00:00:00 2001 From: troy Date: Sun, 31 May 1998 04:45:21 +0000 Subject: [PATCH] Added a comment to GetStyleDimension indicating that computed percentage values are being handled incorrectly --- content/html/style/src/nsCSSLayout.cpp | 5 +++++ layout/html/style/src/nsCSSLayout.cpp | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/content/html/style/src/nsCSSLayout.cpp b/content/html/style/src/nsCSSLayout.cpp index a61e9523e6e3..479ad1684f8d 100644 --- a/content/html/style/src/nsCSSLayout.cpp +++ b/content/html/style/src/nsCSSLayout.cpp @@ -293,6 +293,11 @@ GetStyleDimension(nsIPresContext* aPresContext, aResult = aCoord.GetCoordValue(); rv = PR_TRUE; } + // XXX This isn't correct to use the containg block's width for a percentage + // height. According to the CSS2 spec: "The percentage is calculated with respect + // to the height of the generated box's containing block. If the height of the + // containing block is not specified explicitly (i.e., it depends on content + // height), the value is interpreted like 'auto'". else if (eStyleUnit_Percent == unit) { // CSS2 has specified that percentage width/height values are basd // on the containing block's width. diff --git a/layout/html/style/src/nsCSSLayout.cpp b/layout/html/style/src/nsCSSLayout.cpp index a61e9523e6e3..479ad1684f8d 100644 --- a/layout/html/style/src/nsCSSLayout.cpp +++ b/layout/html/style/src/nsCSSLayout.cpp @@ -293,6 +293,11 @@ GetStyleDimension(nsIPresContext* aPresContext, aResult = aCoord.GetCoordValue(); rv = PR_TRUE; } + // XXX This isn't correct to use the containg block's width for a percentage + // height. According to the CSS2 spec: "The percentage is calculated with respect + // to the height of the generated box's containing block. If the height of the + // containing block is not specified explicitly (i.e., it depends on content + // height), the value is interpreted like 'auto'". else if (eStyleUnit_Percent == unit) { // CSS2 has specified that percentage width/height values are basd // on the containing block's width.