Commit 034f9658 authored by mitz@apple.com's avatar mitz@apple.com

WebCore:

2008-06-21  Alex Taylor  <darwin@milliamp.org>

        Reviewed by Dan Bernstein.

        Fixes <https://bugs.webkit.org/show_bug.cgi?id=12425>

        Adds support for border-radius on legend elements.
        Fieldsets with a legend and rounded borders now have a clipping region set
        around the legend.
        
        Test: fast/borders/fieldsetBorderRadius.html

        * rendering/RenderFieldset.cpp:
        (WebCore::RenderFieldset::paintBoxDecorations):
        (WebCore::RenderFieldset::paintBorderMinusLegend): Removed a FIXME.

LayoutTests:

2008-06-21  Alex Taylor  <darwin@milliamp.org>

        Reviewed by Dan Bernstein.

        <https://bugs.webkit.org/show_bug.cgi?id=12425>
        Test support for border-radius on fieldset elements.

        * fast/borders/fieldsetBorderRadius.html: Added.
        * platform/mac/fast/borders/fieldsetBorderRadius-expected.checksum: Added.
        * platform/mac/fast/borders/fieldsetBorderRadius-expected.png: Added.
        * platform/mac/fast/borders/fieldsetBorderRadius-expected.txt: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34715 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent c5528da2
2008-06-21 Alex Taylor <darwin@milliamp.org>
Reviewed by Dan Bernstein.
<https://bugs.webkit.org/show_bug.cgi?id=12425>
Test support for border-radius on fieldset elements.
* fast/borders/fieldsetBorderRadius.html: Added.
* platform/mac/fast/borders/fieldsetBorderRadius-expected.checksum: Added.
* platform/mac/fast/borders/fieldsetBorderRadius-expected.png: Added.
* platform/mac/fast/borders/fieldsetBorderRadius-expected.txt: Added.
2008-06-20 David Hyatt <hyatt@apple.com>
Make sure CSS variables work inside the inline style attribute.
<html>
<head>
<title></title>
<style>
legend { height: 10px; border: 1px solid blue; }
fieldset { margin-bottom: 10px; -webkit-border-radius: 5px; height: 20px;}
fieldset.render { border: 8px double; }
fieldset.render legend { height: 12px; width: 50px; background-color: rgba(0, 128, 0, 0.3); border: none; }
div.rel { position: relative; height: 40px; }
#col1 { float: left; }
#col2 { float: left; margin-left: 70px; }
#col3 { margin-left: 450px; }
</style>
</head>
<body>
<!-- border rendering tests -->
<div id="col1">
<fieldset class="render" style="width: 100px;">
<legend></legend>
</fieldset>
<fieldset class="render" style="width: 100px;">
<legend style="width: 108%;"></legend>
</fieldset>
<fieldset class="render" style="width: 100px;">
<legend style="width: 112%;"></legend>
</fieldset>
<fieldset class="render" style="width: 100px;">
<legend style="width: 117%;"></legend>
</fieldset>
<fieldset class="render" style="width: 100px;">
<legend style="margin-left: -12px;"></legend>
</fieldset>
<fieldset class="render" style="width: 100px; border-width: 15px; border-style: solid;">
<legend style="margin-left: -12px;"></legend>
</fieldset>
<fieldset class="render" style="width: 100px; border-width: 15px; border-style: solid; -webkit-border-radius: 20px;">
<legend style="margin-left: -12px;"></legend>
</fieldset>
</div>
<div id="col2">
<fieldset class="render" style="width: 100px;">
<legend style="margin-left: -16px;"></legend>
</fieldset>
<fieldset class="render" style="width: 100px;">
<legend style="margin-left: -21px;"></legend>
</fieldset>
<fieldset class="render" style="width: 100px;">
<legend style="margin-left: -69px;"></legend>
</fieldset>
<fieldset class="render" style="width: 100px;">
<legend style="margin-left: -74px;"></legend>
</fieldset>
<fieldset class="render" style="width: 100px;">
<legend style="margin-left: 115%;"></legend>
</fieldset>
<fieldset class="render" style="width: 100px;">
<legend style="margin-left: 120%;"></legend>
</fieldset>
</div>
<!-- layout tests -->
<div id="col3">
<fieldset style="width: 100px;">
<legend style="width: 150px;"></legend>
</fieldset>
<fieldset style="width: 100px;">
<legend style="width: 90px; margin: 30px;"></legend>
</fieldset>
<div class="rel" style="width: 100px;">
<fieldset>
<legend style="width: 150px;"></legend>
</fieldset>
</div>
<div class="rel" style="width: 300px;">
<fieldset style="width: 100; margin: auto;">
<legend style="width: 150px;"></legend>
</fieldset>
</div>
<div class="rel" style="width: 100px;">
<fieldset style="position: absolute;">
<legend style="width: 150px;"></legend>
</fieldset>
</div>
<div class="rel">
<fieldset style="position: absolute; width: 100px;">
<legend style="width: 150px;"></legend>
</fieldset>
</div>
<div class="rel" style="width: 300px;">
<fieldset style="position: absolute; left: 100px; right: 100px;">
<legend style="width: 150px;"></legend>
</fieldset>
</div>
<fieldset style="display: inline; width: 100px;">
<legend style="width: 150px;"></legend>
</fieldset>
<fieldset style="width: 100px;">
<legend style="width: 150%;"></legend>
</fieldset>
</div>
</body>
e8a7970830f73722ad418fa5a028cd25
\ No newline at end of file
layer at (0,0) size 800x600
RenderView at (0,0) size 800x600
layer at (0,0) size 800x600
RenderBlock {HTML} at (0,0) size 800x600
RenderBody {BODY} at (8,8) size 784x582
RenderBlock (floating) {DIV} at (0,0) size 158x455
RenderFieldSet {FIELDSET} at (2,0) size 140x51 [border: (8px double #000000)]
RenderLegend {LEGEND} at (20,0) size 54x12 [bgcolor=#0080004C]
RenderFieldSet {FIELDSET} at (2,61) size 140x51 [border: (8px double #000000)]
RenderLegend {LEGEND} at (20,0) size 112x12 [bgcolor=#0080004C]
RenderFieldSet {FIELDSET} at (2,122) size 140x51 [border: (8px double #000000)]
RenderLegend {LEGEND} at (20,0) size 116x12 [bgcolor=#0080004C]
RenderFieldSet {FIELDSET} at (2,183) size 140x51 [border: (8px double #000000)]
RenderLegend {LEGEND} at (20,0) size 121x12 [bgcolor=#0080004C]
RenderFieldSet {FIELDSET} at (2,244) size 140x51 [border: (8px double #000000)]
RenderLegend {LEGEND} at (8,0) size 54x12 [bgcolor=#0080004C]
RenderFieldSet {FIELDSET} at (2,305) size 154x65 [border: (15px solid #000000)]
RenderLegend {LEGEND} at (15,1) size 54x12 [bgcolor=#0080004C]
RenderFieldSet {FIELDSET} at (2,380) size 154x65 [border: (15px solid #000000)]
RenderLegend {LEGEND} at (15,1) size 54x12 [bgcolor=#0080004C]
RenderBlock (floating) {DIV} at (228,0) size 144x366
RenderFieldSet {FIELDSET} at (2,0) size 140x51 [border: (8px double #000000)]
RenderLegend {LEGEND} at (4,0) size 54x12 [bgcolor=#0080004C]
RenderFieldSet {FIELDSET} at (2,61) size 140x51 [border: (8px double #000000)]
RenderLegend {LEGEND} at (-1,0) size 54x12 [bgcolor=#0080004C]
RenderFieldSet {FIELDSET} at (2,122) size 140x51 [border: (8px double #000000)]
RenderLegend {LEGEND} at (-49,0) size 54x12 [bgcolor=#0080004C]
RenderFieldSet {FIELDSET} at (2,183) size 140x51 [border: (8px double #000000)]
RenderLegend {LEGEND} at (-54,0) size 54x12 [bgcolor=#0080004C]
RenderFieldSet {FIELDSET} at (2,244) size 140x51 [border: (8px double #000000)]
RenderLegend {LEGEND} at (135,0) size 54x12 [bgcolor=#0080004C]
RenderFieldSet {FIELDSET} at (2,305) size 140x51 [border: (8px double #000000)]
RenderLegend {LEGEND} at (140,0) size 54x12 [bgcolor=#0080004C]
RenderBlock {DIV} at (450,0) size 334x386
RenderFieldSet {FIELDSET} at (2,0) size 184x39 [border: (2px groove #C0C0C0)]
RenderLegend {LEGEND} at (14,0) size 156x12 [border: (1px solid #0000FF)]
RenderFieldSet {FIELDSET} at (2,49) size 184x39 [border: (2px groove #C0C0C0)]
RenderLegend {LEGEND} at (44,0) size 96x12 [border: (1px solid #0000FF)]
RenderBlock (anonymous) at (0,298) size 334x49
RenderFieldSet {FIELDSET} at (2,0) size 184x39 [border: (2px groove #C0C0C0)]
RenderLegend {LEGEND} at (14,0) size 156x12 [border: (1px solid #0000FF)]
RenderText {#text} at (0,0) size 0x0
RenderFieldSet {FIELDSET} at (2,347) size 128x39 [border: (2px groove #C0C0C0)]
RenderLegend {LEGEND} at (14,0) size 156x12 [border: (1px solid #0000FF)]
layer at (458,106) size 186x49
RenderBlock (relative positioned) {DIV} at (0,98) size 100x40
RenderFieldSet {FIELDSET} at (2,0) size 184x39 [border: (2px groove #C0C0C0)]
RenderLegend {LEGEND} at (14,0) size 156x12 [border: (1px solid #0000FF)]
layer at (458,146) size 300x40
RenderBlock (relative positioned) {DIV} at (0,138) size 300x40
RenderFieldSet {FIELDSET} at (58,0) size 184x39 [border: (2px groove #C0C0C0)]
RenderLegend {LEGEND} at (14,0) size 156x12 [border: (1px solid #0000FF)]
layer at (458,186) size 100x40
RenderBlock (relative positioned) {DIV} at (0,178) size 100x40
layer at (460,186) size 184x39
RenderFieldSet {FIELDSET} at (2,0) size 184x39 [border: (2px groove #C0C0C0)]
RenderLegend {LEGEND} at (14,0) size 156x12 [border: (1px solid #0000FF)]
layer at (458,226) size 334x40
RenderBlock (relative positioned) {DIV} at (0,218) size 334x40
layer at (460,226) size 184x39
RenderFieldSet {FIELDSET} at (2,0) size 184x39 [border: (2px groove #C0C0C0)]
RenderLegend {LEGEND} at (14,0) size 156x12 [border: (1px solid #0000FF)]
layer at (458,266) size 300x40
RenderBlock (relative positioned) {DIV} at (0,258) size 300x40
layer at (560,266) size 184x39
RenderFieldSet {FIELDSET} at (102,0) size 184x39 [border: (2px groove #C0C0C0)]
RenderLegend {LEGEND} at (14,0) size 156x12 [border: (1px solid #0000FF)]
2008-06-21 Alex Taylor <darwin@milliamp.org>
Reviewed by Dan Bernstein.
Fixes <https://bugs.webkit.org/show_bug.cgi?id=12425>
Adds support for border-radius on legend elements.
Fieldsets with a legend and rounded borders now have a clipping region set
around the legend.
Test: fast/borders/fieldsetBorderRadius.html
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::paintBoxDecorations):
(WebCore::RenderFieldset::paintBorderMinusLegend): Removed a FIXME.
2008-06-21 Kevin Ollivier <kevino@theolliviers.com>
wx build fix. Adding CSSVariable* API sources to the Bakefiles.
......@@ -28,6 +28,7 @@
#include "HTMLFormControlElement.h"
#include "HTMLNames.h"
#include "GraphicsContext.h"
using std::min;
using std::max;
......@@ -131,8 +132,26 @@ void RenderFieldset::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
paintFillLayers(paintInfo, style()->backgroundColor(), style()->backgroundLayers(), my, mh, tx, ty, w, h);
if (style()->hasBorder())
paintBorderMinusLegend(paintInfo.context, tx, ty, w, h, style(), legend->xPos(), legend->width(), legendBottom);
if (!style()->hasBorder())
return;
// Save time by not saving and restoring the GraphicsContext in the straight border case
if (!style()->hasBorderRadius())
return paintBorderMinusLegend(paintInfo.context, tx, ty, w, h, style(), legend->xPos(), legend->width(), legendBottom);
// We have rounded borders, create a clipping region
// around the legend and paint the border as normal
GraphicsContext* graphicsContext = paintInfo.context;
graphicsContext->save();
int clipTop = ty;
int clipHeight = max(static_cast<int>(style()->borderTopWidth()), legend->height());
graphicsContext->clipOut(IntRect(tx + legend->xPos(), clipTop,
legend->width(), clipHeight));
paintBorder(paintInfo.context, tx, ty, w, h, style(), true, true);
graphicsContext->restore();
}
void RenderFieldset::paintMask(PaintInfo& paintInfo, int tx, int ty)
......@@ -160,7 +179,6 @@ void RenderFieldset::paintMask(PaintInfo& paintInfo, int tx, int ty)
void RenderFieldset::paintBorderMinusLegend(GraphicsContext* graphicsContext, int tx, int ty, int w, int h,
const RenderStyle* style, int lx, int lw, int lb)
{
// FIXME: Implement border-radius
const Color& tc = style->borderTopColor();
const Color& bc = style->borderBottomColor();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment