A question that's come up during review of the patches for CSS3
border-radius (bug 450652) is whether it's possible for us to try to
draw the root frame for a document with rounded corners.  This *ought*
to be impossible, because if we did that, we'd leave areas of the
OS-level widget unpainted.  I have not been able to construct an HTML
file that causes nsCSSRendering::PaintBackgroundWithSC to be called for
the root frame with rounded corners specified, but I can't find the
code that prevents it so I'm not sure it's impossible.

Consider this document:

<!doctype html>
<html><style>
html, body {
  border: 1px solid black;
  -moz-border-radius: 20px;
  padding: 10px;
}
html { background-color: yellow }
body { background-color: green }
</style><body>.</body></html>

I put tracing code into every nsCSSRendering function that draws
something that has rounded corners; when run against the above I get
this:

bgcolor: [EMAIL PROTECTED] / [EMAIL PROTECTED]: 0
border:   [EMAIL PROTECTED] / [EMAIL PROTECTED]: 1200
bgcolor:  [EMAIL PROTECTED] / [EMAIL PROTECTED]: 1200
border:   [EMAIL PROTECTED] / [EMAIL PROTECTED]: 1200

Each line reports one call to a rendering function (bgcolor =
PaintBackgroundWithSC, border = PaintBorder), identifying the nsIFrame
object it was passed by frame type and address, then the associated
nsIContent object by tag and address, and finally the value (in nscoord
units) of the -moz-border-radius property for that frame.  What this is
saying is, there's nothing special about <body>, but the <html> element
generates two frames - a CanvasFrame with a BlockFrame inside - and the
style rules for <html> get distributed between the two, so that the
outer CanvasFrame gets only the background color, and the inner
BlockFrame gets the border properties.  (Thus, we don't even call
PaintBorder on the CanvasFrame.)

What I still can't find is the code that does the distribution.  I
suspected nsCSSFrameConstructor and/or nsCSSRuleProcessor, but neither
*seems* to have anything relevant in them.

Any advice?
zw
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to