Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Unified Diff: Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp

Issue 11557024: Merge 136808 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp
===================================================================
--- Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp (revision 137540)
+++ Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.cpp (working copy)
@@ -27,12 +27,9 @@
#if ENABLE(INPUT_MULTIPLE_FIELDS_UI)
#include "DateTimeSymbolicFieldElement.h"
-#include "FontCache.h"
+#include "Font.h"
#include "KeyboardEvent.h"
-#include "RenderStyle.h"
-#include "StyleResolver.h"
#include "TextBreakIterator.h"
-#include "TextRun.h"
#include <wtf/text/StringBuilder.h>
#include <wtf/unicode/Unicode.h>
@@ -57,19 +54,14 @@
, m_selectedIndex(-1)
{
ASSERT(!symbols.isEmpty());
- setHasCustomCallbacks();
}
-PassRefPtr<RenderStyle> DateTimeSymbolicFieldElement::customStyleForRenderer()
+float DateTimeSymbolicFieldElement::maximumWidth(const Font& font)
{
- FontCachePurgePreventer fontCachePurgePreventer;
- RefPtr<RenderStyle> originalStyle = document()->styleResolver()->styleForElement(this);
- RefPtr<RenderStyle> style = RenderStyle::clone(originalStyle.get());
- float maxiumWidth = style->font().width(visibleEmptyValue());
+ float maximumWidth = font.width(visibleEmptyValue());
for (unsigned index = 0; index < m_symbols.size(); ++index)
- maxiumWidth = std::max(maxiumWidth, style->font().width(m_symbols[index]));
- style->setMinWidth(Length(maxiumWidth, Fixed));
- return style.release();
+ maximumWidth = std::max(maximumWidth, font.width(m_symbols[index]));
+ return maximumWidth + DateTimeFieldElement::maximumWidth(font);
}
void DateTimeSymbolicFieldElement::handleKeyboardEvent(KeyboardEvent* keyboardEvent)
« no previous file with comments | « Source/WebCore/html/shadow/DateTimeSymbolicFieldElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698