Commit d6e6250d authored by pkasting@chromium.org's avatar pkasting@chromium.org

Fix "unreachable code" warnings (MSVC warning 4702) in Blink.

BUG=346399
TEST=none
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/203743002

git-svn-id: svn://svn.chromium.org/blink/trunk@169581 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 2cbb2a21
...@@ -86,13 +86,9 @@ const char* getValueName(unsigned short id) ...@@ -86,13 +86,9 @@ const char* getValueName(unsigned short id)
bool isValueAllowedInMode(unsigned short id, CSSParserMode mode) bool isValueAllowedInMode(unsigned short id, CSSParserMode mode)
{ {
// FIXME: Investigate whether we can deprecate the former
// two as only QuirksOrUASheet is used in CSSValueKeyword.in
switch (id) { switch (id) {
%(ua_sheet_mode_values_keywords)s %(ua_sheet_mode_values_keywords)s
return isUASheetBehavior(mode); return isUASheetBehavior(mode);
%(quirks_mode_values_keywords)s
return isQuirksModeBehavior(mode);
%(quirks_mode_or_ua_sheet_mode_values_keywords)s %(quirks_mode_or_ua_sheet_mode_values_keywords)s
return isUASheetBehavior(mode) || isQuirksModeBehavior(mode); return isUASheetBehavior(mode) || isQuirksModeBehavior(mode);
default: default:
...@@ -164,7 +160,6 @@ class CSSValueKeywordsWriter(in_generator.Writer): ...@@ -164,7 +160,6 @@ class CSSValueKeywordsWriter(in_generator.Writer):
'value_keyword_offsets': '\n'.join(map(lambda offset: ' %d,' % offset, keyword_offsets)), 'value_keyword_offsets': '\n'.join(map(lambda offset: ' %d,' % offset, keyword_offsets)),
'value_keyword_to_enum_map': '\n'.join(map(lambda property: '%(name)s, %(enum_name)s' % property, self._value_keywords)), 'value_keyword_to_enum_map': '\n'.join(map(lambda property: '%(name)s, %(enum_name)s' % property, self._value_keywords)),
'ua_sheet_mode_values_keywords': '\n '.join(map(self._case_value_keyword, self._value_keywords_with_mode('UASheet'))), 'ua_sheet_mode_values_keywords': '\n '.join(map(self._case_value_keyword, self._value_keywords_with_mode('UASheet'))),
'quirks_mode_values_keywords': '\n '.join(map(self._case_value_keyword, self._value_keywords_with_mode('Quirks'))),
'quirks_mode_or_ua_sheet_mode_values_keywords': '\n '.join(map(self._case_value_keyword, self._value_keywords_with_mode('QuirksOrUASheet'))), 'quirks_mode_or_ua_sheet_mode_values_keywords': '\n '.join(map(self._case_value_keyword, self._value_keywords_with_mode('QuirksOrUASheet'))),
} }
# FIXME: If we could depend on Python 2.7, we would use subprocess.check_output # FIXME: If we could depend on Python 2.7, we would use subprocess.check_output
......
...@@ -338,7 +338,9 @@ ...@@ -338,7 +338,9 @@
['OS=="win"', { ['OS=="win"', {
# In generated bindings code: 'switch contains default but no case'. # In generated bindings code: 'switch contains default but no case'.
# Disable c4267 warnings until we fix size_t to int truncations. # Disable c4267 warnings until we fix size_t to int truncations.
'msvs_disabled_warnings': [ 4065, 4267 ], # 4702 is disabled because of issues in Bison-generated
# XPathGrammar.cpp and CSSGrammar.cpp.
'msvs_disabled_warnings': [ 4065, 4267, 4702 ],
}], }],
['OS in ("linux", "android") and "WTF_USE_WEBAUDIO_IPP=1" in feature_defines', { ['OS in ("linux", "android") and "WTF_USE_WEBAUDIO_IPP=1" in feature_defines', {
'cflags': [ 'cflags': [
......
...@@ -105,8 +105,6 @@ static bool isSkippableComponentForInvalidation(const CSSSelector& selector) ...@@ -105,8 +105,6 @@ static bool isSkippableComponentForInvalidation(const CSSSelector& selector)
default: default:
return false; return false;
} }
ASSERT_NOT_REACHED();
return false;
} }
// This method is somewhat conservative in what it accepts. // This method is somewhat conservative in what it accepts.
......
...@@ -353,30 +353,8 @@ int RenderBox::pixelSnappedOffsetHeight() const ...@@ -353,30 +353,8 @@ int RenderBox::pixelSnappedOffsetHeight() const
bool RenderBox::canDetermineWidthWithoutLayout() const bool RenderBox::canDetermineWidthWithoutLayout() const
{ {
// FIXME: This optimization is incorrect as written. // FIXME: Remove function and callers.
// We need to be able to opt-in to this behavior only when
// it's guarentted correct.
// Until then disabling this optimization to be safe.
return false; return false;
// FIXME: There are likely many subclasses of RenderBlockFlow which
// cannot determine their layout just from style!
// Perhaps we should create a "PlainRenderBlockFlow"
// and move this optimization there?
if (!isRenderBlockFlow()
// Flexbox items can be expanded beyond their width.
|| isFlexItemIncludingDeprecated()
// Table Layout controls cell size and can expand beyond width.
|| isTableCell())
return false;
RenderStyle* style = this->style();
return style->width().isFixed()
&& style->minWidth().isFixed()
&& (style->maxWidth().isUndefined() || style->maxWidth().isFixed())
&& style->paddingLeft().isFixed()
&& style->paddingRight().isFixed()
&& style->boxSizing() == CONTENT_BOX;
} }
LayoutUnit RenderBox::fixedOffsetWidth() const LayoutUnit RenderBox::fixedOffsetWidth() const
......
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