[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
hamaji at chromium.org
hamaji at chromium.org
Wed Dec 22 15:36:58 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 7ef29bbf42f4dac3d996d8118867b447bc648a71
Author: hamaji at chromium.org <hamaji at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 9 10:39:18 2010 +0000
2010-11-09 Shinichiro Hamaji <hamaji at chromium.org>
Reviewed by Dimitri Glazkov.
[Chromium] display:none has no effect on <option> element
https://bugs.webkit.org/show_bug.cgi?id=49169
Added a manual test because it's hard to test the content of
<option> element.
* manual-tests/display-none-option.html: Added.
* platform/PopupMenuStyle.h:
(WebCore::PopupMenuStyle::PopupMenuStyle):
(WebCore::PopupMenuStyle::isDisplayNone):
* platform/chromium/PopupMenuChromium.cpp:
(WebCore::PopupListBox::getRowHeight):
(WebCore::PopupListBox::layout):
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::itemStyle):
(WebCore::RenderMenuList::menuStyle):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::menuStyle):
2010-11-09 Shinichiro Hamaji <hamaji at chromium.org>
Reviewed by Dimitri Glazkov.
[Chromium] display:none has no effect on <option> element
https://bugs.webkit.org/show_bug.cgi?id=49169
* src/AutoFillPopupMenuClient.cpp:
(WebKit::AutoFillPopupMenuClient::initialize):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8b549a5..b671798 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2010-11-09 Shinichiro Hamaji <hamaji at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Chromium] display:none has no effect on <option> element
+ https://bugs.webkit.org/show_bug.cgi?id=49169
+
+ Added a manual test because it's hard to test the content of
+ <option> element.
+
+ * manual-tests/display-none-option.html: Added.
+ * platform/PopupMenuStyle.h:
+ (WebCore::PopupMenuStyle::PopupMenuStyle):
+ (WebCore::PopupMenuStyle::isDisplayNone):
+ * platform/chromium/PopupMenuChromium.cpp:
+ (WebCore::PopupListBox::getRowHeight):
+ (WebCore::PopupListBox::layout):
+ * rendering/RenderMenuList.cpp:
+ (WebCore::RenderMenuList::itemStyle):
+ (WebCore::RenderMenuList::menuStyle):
+ * rendering/RenderTextControlSingleLine.cpp:
+ (WebCore::RenderTextControlSingleLine::menuStyle):
+
2010-11-09 Chris Rogers <crogers at google.com>
Reviewed by Kenneth Russell.
diff --git a/WebCore/platform/PopupMenuStyle.h b/WebCore/platform/PopupMenuStyle.h
index 5325ff3..b9a7abc 100644
--- a/WebCore/platform/PopupMenuStyle.h
+++ b/WebCore/platform/PopupMenuStyle.h
@@ -35,11 +35,12 @@ namespace WebCore {
class PopupMenuStyle {
public:
- PopupMenuStyle(const Color& foreground, const Color& background, const Font& font, bool visible, Length textIndent, TextDirection textDirection)
+ PopupMenuStyle(const Color& foreground, const Color& background, const Font& font, bool visible, bool isDisplayNone, Length textIndent, TextDirection textDirection)
: m_foregroundColor(foreground)
, m_backgroundColor(background)
, m_font(font)
, m_visible(visible)
+ , m_isDisplayNone(isDisplayNone)
, m_textIndent(textIndent)
, m_textDirection(textDirection)
{
@@ -49,6 +50,7 @@ public:
const Color& backgroundColor() const { return m_backgroundColor; }
const Font& font() const { return m_font; }
bool isVisible() const { return m_visible; }
+ bool isDisplayNone() const { return m_isDisplayNone; }
Length textIndent() const { return m_textIndent; }
TextDirection textDirection() const { return m_textDirection; }
@@ -57,6 +59,7 @@ private:
Color m_backgroundColor;
Font m_font;
bool m_visible;
+ bool m_isDisplayNone;
Length m_textIndent;
TextDirection m_textDirection;
};
diff --git a/WebCore/platform/chromium/PopupMenuChromium.cpp b/WebCore/platform/chromium/PopupMenuChromium.cpp
index 3ff4ff0..0649285 100644
--- a/WebCore/platform/chromium/PopupMenuChromium.cpp
+++ b/WebCore/platform/chromium/PopupMenuChromium.cpp
@@ -1089,6 +1089,9 @@ int PopupListBox::getRowHeight(int index)
if (index < 0)
return 0;
+ if (m_popupClient->itemStyle(index).isDisplayNone())
+ return 0;
+
String icon = m_popupClient->itemIcon(index);
RefPtr<Image> image(Image::loadPlatformResource(icon.utf8().data()));
@@ -1254,10 +1257,11 @@ void PopupListBox::layout()
int paddingWidth = 0;
int y = 0;
for (int i = 0; i < numItems(); ++i) {
- Font itemFont = getRowFont(i);
-
// Place the item vertically.
m_items[i]->yOffset = y;
+ if (m_popupClient->itemStyle(i).isDisplayNone())
+ continue;
+ Font itemFont = getRowFont(i);
y += itemFont.height();
// Ensure the popup is wide enough to fit this item.
diff --git a/WebCore/rendering/RenderMenuList.cpp b/WebCore/rendering/RenderMenuList.cpp
index a88903f..5ad661f 100644
--- a/WebCore/rendering/RenderMenuList.cpp
+++ b/WebCore/rendering/RenderMenuList.cpp
@@ -419,7 +419,7 @@ PopupMenuStyle RenderMenuList::itemStyle(unsigned listIndex) const
Element* element = listItems[listIndex];
RenderStyle* style = element->renderStyle() ? element->renderStyle() : element->computedStyle();
- return style ? PopupMenuStyle(style->visitedDependentColor(CSSPropertyColor), itemBackgroundColor(listIndex), style->font(), style->visibility() == VISIBLE, style->textIndent(), style->direction()) : menuStyle();
+ return style ? PopupMenuStyle(style->visitedDependentColor(CSSPropertyColor), itemBackgroundColor(listIndex), style->font(), style->visibility() == VISIBLE, style->display() == NONE, style->textIndent(), style->direction()) : menuStyle();
}
Color RenderMenuList::itemBackgroundColor(unsigned listIndex) const
@@ -449,7 +449,7 @@ Color RenderMenuList::itemBackgroundColor(unsigned listIndex) const
PopupMenuStyle RenderMenuList::menuStyle() const
{
RenderStyle* s = m_innerBlock ? m_innerBlock->style() : style();
- return PopupMenuStyle(s->visitedDependentColor(CSSPropertyColor), s->visitedDependentColor(CSSPropertyBackgroundColor), s->font(), s->visibility() == VISIBLE, s->textIndent(), s->direction());
+ return PopupMenuStyle(s->visitedDependentColor(CSSPropertyColor), s->visitedDependentColor(CSSPropertyBackgroundColor), s->font(), s->visibility() == VISIBLE, s->display() == NONE, s->textIndent(), s->direction());
}
HostWindow* RenderMenuList::hostWindow() const
diff --git a/WebCore/rendering/RenderTextControlSingleLine.cpp b/WebCore/rendering/RenderTextControlSingleLine.cpp
index 9aeedf9..e99402c 100644
--- a/WebCore/rendering/RenderTextControlSingleLine.cpp
+++ b/WebCore/rendering/RenderTextControlSingleLine.cpp
@@ -952,7 +952,7 @@ PopupMenuStyle RenderTextControlSingleLine::itemStyle(unsigned) const
PopupMenuStyle RenderTextControlSingleLine::menuStyle() const
{
- return PopupMenuStyle(style()->visitedDependentColor(CSSPropertyColor), style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->font(), style()->visibility() == VISIBLE, style()->textIndent(), style()->direction());
+ return PopupMenuStyle(style()->visitedDependentColor(CSSPropertyColor), style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->font(), style()->visibility() == VISIBLE, style()->display() == NONE, style()->textIndent(), style()->direction());
}
int RenderTextControlSingleLine::clientInsetLeft() const
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 3c5897b..2b1c084 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,13 @@
+2010-11-09 Shinichiro Hamaji <hamaji at chromium.org>
+
+ Reviewed by Dimitri Glazkov.
+
+ [Chromium] display:none has no effect on <option> element
+ https://bugs.webkit.org/show_bug.cgi?id=49169
+
+ * src/AutoFillPopupMenuClient.cpp:
+ (WebKit::AutoFillPopupMenuClient::initialize):
+
2010-11-09 James Simonsen <simonjam at chromium.org>
Reviewed by Dimitri Glazkov.
diff --git a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
index b14840c..731c02c 100644
--- a/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
+++ b/WebKit/chromium/src/AutoFillPopupMenuClient.cpp
@@ -293,7 +293,7 @@ void AutoFillPopupMenuClient::initialize(
// The direction of text in popup menu is set the same as the direction of
// the input element: textField.
m_style.set(new PopupMenuStyle(Color::black, Color::white, font, true,
- Length(WebCore::Fixed),
+ false, Length(WebCore::Fixed),
textField->renderer()->style()->direction()));
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list