[webkit-changes] cvs commit: WebCore/khtml/rendering
render_button.cpp render_flexbox.cpp render_layer.cpp
David
hyatt at opensource.apple.com
Tue Oct 25 23:08:05 PDT 2005
hyatt 05/10/25 23:08:04
Modified: . ChangeLog
khtml/css html4.css
khtml/rendering render_button.cpp render_flexbox.cpp
render_layer.cpp
Log:
This patch makes a number of refinements to buttons to make
the custom <input>s on hotwire.com look correct.
Also back out my fix for bug 5283, since it causes some bad
regressions and basically needs to be rethought. (This part
not reviewed, since it's just a backout.)
Reviewed by darin
* khtml/css/html4.css:
Added rules to reset many more properties on form controls,
including text-align, letter-spacing, word-spacing, line-height
text-transform and others. Remove the !important from the
line-height reset, since WinIE honors line-height on buttons.
Mozilla does not, but we will match WinIE.
* khtml/rendering/render_button.cpp:
(khtml::RenderButton::setStyle):
Make sure to preserve the box-flex of our generated interior
block, so that it doesn't end up packing left inside its
container when styles change.
(khtml::RenderButton::paintObject):
Change the clipping heuristic to only clip to the border box.
This does mean text can run right up to the edge of an Aqua
button, but without this change we just don't match other
browsers.
* khtml/rendering/render_flexbox.cpp:
(khtml::RenderFlexibleBox::layoutHorizontalBox):
(khtml::RenderFlexibleBox::layoutVerticalBox):
Change the behavior of box-align:center. If it would result
in spillage out the top or left when centering, then don't move
it.
Revision Changes Path
1.291 +37 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.290
retrieving revision 1.291
diff -u -r1.290 -r1.291
--- ChangeLog 26 Oct 2005 04:55:04 -0000 1.290
+++ ChangeLog 26 Oct 2005 06:08:00 -0000 1.291
@@ -1,3 +1,40 @@
+2005-10-25 David Hyatt <hyatt at apple.com>
+
+ This patch makes a number of refinements to buttons to make
+ the custom <input>s on hotwire.com look correct.
+
+ Also back out my fix for bug 5283, since it causes some bad
+ regressions and basically needs to be rethought. (This part
+ not reviewed, since it's just a backout.)
+
+ Reviewed by darin
+
+ * khtml/css/html4.css:
+ Added rules to reset many more properties on form controls,
+ including text-align, letter-spacing, word-spacing, line-height
+ text-transform and others. Remove the !important from the
+ line-height reset, since WinIE honors line-height on buttons.
+ Mozilla does not, but we will match WinIE.
+
+ * khtml/rendering/render_button.cpp:
+ (khtml::RenderButton::setStyle):
+ Make sure to preserve the box-flex of our generated interior
+ block, so that it doesn't end up packing left inside its
+ container when styles change.
+
+ (khtml::RenderButton::paintObject):
+ Change the clipping heuristic to only clip to the border box.
+ This does mean text can run right up to the edge of an Aqua
+ button, but without this change we just don't match other
+ browsers.
+
+ * khtml/rendering/render_flexbox.cpp:
+ (khtml::RenderFlexibleBox::layoutHorizontalBox):
+ (khtml::RenderFlexibleBox::layoutVerticalBox):
+ Change the behavior of box-align:center. If it would result
+ in spillage out the top or left when centering, then don't move
+ it.
+
2005-10-25 Maciej Stachowiak <mjs at apple.com>
Re-landing the isSameNode fix from Anders, I verified there is no effect on performance:
1.80 +9 -8 WebCore/khtml/css/html4.css
Index: html4.css
===================================================================
RCS file: /cvs/root/WebCore/khtml/css/html4.css,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -r1.79 -r1.80
--- html4.css 22 Oct 2005 18:19:25 -0000 1.79
+++ html4.css 26 Oct 2005 06:08:03 -0000 1.80
@@ -282,17 +282,19 @@
white-space: normal
}
-input, textarea {
- text-align: -khtml-auto
-}
-
/* If we support for CSS2 system fonts, then we won't have to hard code Lucida Grande here. */
input, textarea, select, button {
margin: 0__qem;
font: 11px 'Lucida Grande';
color: initial;
+ text-align: -khtml-auto;
+ letter-spacing: normal;
+ word-spacing: normal;
+ line-height: normal;
+ text-transform: none;
+ text-indent: 0;
display: inline-block;
- box-sizing: border-box
+ box-sizing: border-box;
}
input[type="hidden"] {
@@ -307,13 +309,12 @@
input[type="button"], input[type="submit"], input[type="reset"]
{
-khtml-appearance: push-button;
- white-space: pre;
- line-height: normal !important
+ white-space: pre
}
input[type="button"], input[type="submit"], input[type="reset"], button {
-khtml-box-align: center;
- text-align:center;
+ text-align: center;
cursor: default;
color: ButtonText;
padding: 2px 8px 3px 8px
1.5 +4 -1 WebCore/khtml/rendering/render_button.cpp
Index: render_button.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_button.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- render_button.cpp 25 Oct 2005 20:54:28 -0000 1.4
+++ render_button.cpp 26 Oct 2005 06:08:03 -0000 1.5
@@ -68,6 +68,8 @@
RenderBlock::setStyle(style);
if (m_buttonText)
m_buttonText->setStyle(style);
+ if (m_inner)
+ m_inner->style()->setBoxFlex(1.0f);
}
void RenderButton::updateFromElement()
@@ -97,7 +99,8 @@
{
// Push a clip.
if (m_inner && i.phase == PaintActionForeground) {
- QRect clipRect(_tx + borderLeft() + paddingLeft(), _ty + borderTop() + paddingTop(), contentWidth(), contentHeight());
+ QRect clipRect(_tx + borderLeft(), _ty + borderTop(), width() - borderLeft() - borderRight(),
+ height() - borderBottom() - borderTop());
if (clipRect.width() == 0 || clipRect.height() == 0)
return;
clipRect = i.p->xForm(clipRect);
1.29 +2 -2 WebCore/khtml/rendering/render_flexbox.cpp
Index: render_flexbox.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_flexbox.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- render_flexbox.cpp 25 Oct 2005 20:54:28 -0000 1.28
+++ render_flexbox.cpp 26 Oct 2005 06:08:03 -0000 1.29
@@ -478,7 +478,7 @@
int childY = yPos;
switch (style()->boxAlign()) {
case BCENTER:
- childY += child->marginTop() + (contentHeight() - (child->height() + child->marginTop() + child->marginBottom()))/2;
+ childY += child->marginTop() + kMax(0, (contentHeight() - (child->height() + child->marginTop() + child->marginBottom()))/2);
break;
case BBASELINE: {
int ascent = child->marginTop() + child->getBaselineOfFirstLineBox();
@@ -827,7 +827,7 @@
switch (style()->boxAlign()) {
case BCENTER:
case BBASELINE: // Baseline just maps to center for vertical boxes
- childX += child->marginLeft() + (contentWidth() - (child->width() + child->marginLeft() + child->marginRight()))/2;
+ childX += child->marginLeft() + kMax(0, (contentWidth() - (child->width() + child->marginLeft() + child->marginRight()))/2);
break;
case BEND:
if (style()->direction() == RTL)
1.118 +2 -8 WebCore/khtml/rendering/render_layer.cpp
Index: render_layer.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/rendering/render_layer.cpp,v
retrieving revision 1.117
retrieving revision 1.118
diff -u -r1.117 -r1.118
--- render_layer.cpp 25 Oct 2005 22:33:55 -0000 1.117
+++ render_layer.cpp 26 Oct 2005 06:08:03 -0000 1.118
@@ -1447,14 +1447,8 @@
static inline bool compare(const RenderLayer* layer1, const RenderLayer* layer2)
{
- if (layer1->zIndex() == layer2->zIndex())
- // Layers that exist solely because of overflow clip do not technically establish a stacking context.
- // Our creation of RenderLayers for overflow regions is a convenience but is not really correct. Overflow
- // content should have just painted where it occurred in the document. Although we can't do that,
- // we will at least make sure that overflow layers lose to the other types of layers (positioned, relative positioned
- // and opacity).
- return isOverflowOnly(layer1) || !isOverflowOnly(layer2);
- return layer1->zIndex() < layer2->zIndex();
+ // Just compare z-index.
+ return (layer1->zIndex() <= layer2->zIndex());
}
// Sort the buffer from lowest z-index to highest. The common scenario will have
More information about the webkit-changes
mailing list