summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Iacovitti <aiacovitti@libero.it>2012-06-17 17:04:04 (GMT)
committerAndrea Iacovitti <aiacovitti@libero.it>2012-06-17 17:04:04 (GMT)
commit95ccc85ae312453bf68c0fb48025c5dab21faa81 (patch)
tree191d5b2e2a6e36a2e885df4b54e16c5bde26379d
parente67682b44f30ee6d5a785dde34eb0dc16fb2c02e (diff)
Do not call setStyle() in RenderWidget::updateFromElement() for all type
of widgets. It is needed for select elements when switching internal widget type. An evident side effect is the unwanted scroll of textarea's content on focus out, caused in turn by setAlignment() in RenderTextArea::setStyle(). BUG: 302052 CCBUG: 142722
-rw-r--r--khtml/rendering/render_form.cpp6
-rw-r--r--khtml/rendering/render_replaced.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/khtml/rendering/render_form.cpp b/khtml/rendering/render_form.cpp
index 47cb7a3..0a12ba7 100644
--- a/khtml/rendering/render_form.cpp
+++ b/khtml/rendering/render_form.cpp
@@ -1752,10 +1752,14 @@ void RenderSelect::updateFromElement()
if (oldMultiple != m_multiple || oldSize != m_size) {
if (m_useListBox != oldListbox) {
// type of select has changed
- if(m_useListBox)
+ if (m_useListBox)
setQWidget(createListBox());
else
setQWidget(createComboBox());
+
+ // Call setStyle() to fix unwanted font size change (#142722)
+ // and to update our proxy style properties
+ setStyle(style());
}
if (m_useListBox && oldMultiple != m_multiple) {
diff --git a/khtml/rendering/render_replaced.cpp b/khtml/rendering/render_replaced.cpp
index e10d92b..195dcba 100644
--- a/khtml/rendering/render_replaced.cpp
+++ b/khtml/rendering/render_replaced.cpp
@@ -497,9 +497,6 @@ void RenderWidget::updateFromElement()
} else if (QLineEdit* lineEdit = qobject_cast<QLineEdit*>(m_widget)) {
lineEdit->setFrame(!shouldDisableNativeBorders());
}
-
- // Font:
- setStyle(style());
}
RenderReplaced::updateFromElement();
@@ -512,7 +509,6 @@ void RenderWidget::paintOneBackground(QPainter *p, const QColor& c, const Backgr
fudge ? 1 : borderLeft() , fudge ? 1 : borderRight(), paddingLeft(), paddingRight(),
fudge ? 1 : borderTop(), fudge ? 1 : borderBottom(), paddingTop(), paddingBottom());
}
-
void RenderWidget::paintBoxDecorations(PaintInfo& paintInfo, int _tx, int _ty)
{