diff options
Diffstat (limited to 'Source/WebCore/css')
-rw-r--r-- | Source/WebCore/css/CSSComputedStyleDeclaration.cpp | 23 | ||||
-rw-r--r-- | Source/WebCore/css/CSSGrammar.y.in | 4 | ||||
-rw-r--r-- | Source/WebCore/css/CSSParser.cpp | 8 | ||||
-rw-r--r-- | Source/WebCore/css/CSSPrimitiveValueMappings.h | 27 | ||||
-rw-r--r-- | Source/WebCore/css/CSSProperty.cpp | 1 | ||||
-rw-r--r-- | Source/WebCore/css/CSSPropertyNames.in | 1 | ||||
-rw-r--r-- | Source/WebCore/css/CSSValueKeywords.in | 4 | ||||
-rw-r--r-- | Source/WebCore/css/StyleBuilder.cpp | 1 | ||||
-rw-r--r-- | Source/WebCore/css/StyleResolver.cpp | 31 | ||||
-rw-r--r-- | Source/WebCore/css/themeBlackBerry.css | 9 |
10 files changed, 78 insertions, 31 deletions
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp index 4bc7b084f..b4b19c798 100644 --- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -983,27 +983,24 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::valueForFilter(const RenderObj } #endif -static PassRefPtr<CSSValue> valueForGridTrackBreadth(const Length& trackLength, const RenderStyle* style) +static PassRefPtr<CSSValue> valueForGridTrackBreadth(const GridTrackSize& trackSize, const RenderStyle* style) { - if (trackLength.isPercent()) - return cssValuePool().createValue(trackLength); - if (trackLength.isAuto()) + if (trackSize.length().isPercent()) + return cssValuePool().createValue(trackSize.length()); + if (trackSize.length().isAuto()) return cssValuePool().createIdentifierValue(CSSValueAuto); - return zoomAdjustedPixelValue(trackLength.value(), style); + return zoomAdjustedPixelValue(trackSize.length().value(), style); } -static PassRefPtr<CSSValue> valueForGridTrackList(const Vector<Length>& trackLengths, const RenderStyle* style) +static PassRefPtr<CSSValue> valueForGridTrackList(const Vector<GridTrackSize>& trackSizes, const RenderStyle* style) { - // We should have at least an element! - ASSERT(trackLengths.size()); - // Handle the 'none' case here. - if (trackLengths.size() == 1 && trackLengths[0].isUndefined()) + if (!trackSizes.size()) return cssValuePool().createIdentifierValue(CSSValueNone); RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); - for (size_t i = 0; i < trackLengths.size(); ++i) - list->append(valueForGridTrackBreadth(trackLengths[i], style)); + for (size_t i = 0; i < trackSizes.size(); ++i) + list->append(valueForGridTrackBreadth(trackSizes[i], style)); return list.release(); } @@ -2025,6 +2022,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert return cssValuePool().createValue(style->position()); case CSSPropertyRight: return getPositionOffsetValue(style.get(), CSSPropertyRight, m_node->document()->renderView()); + case CSSPropertyWebkitRubyPosition: + return cssValuePool().createValue(style->rubyPosition()); case CSSPropertyTableLayout: return cssValuePool().createValue(style->tableLayout()); case CSSPropertyTextAlign: diff --git a/Source/WebCore/css/CSSGrammar.y.in b/Source/WebCore/css/CSSGrammar.y.in index 21b016135..f08e48643 100644 --- a/Source/WebCore/css/CSSGrammar.y.in +++ b/Source/WebCore/css/CSSGrammar.y.in @@ -713,11 +713,11 @@ supports_declaration_condition: CSSParser* p = static_cast<CSSParser*>(parser); if ($3 && $6) { p->m_valueList = p->sinkFloatingValueList($6); - int oldParsedProperties = p->m_parsedProperties->size(); + int oldParsedProperties = p->m_parsedProperties.size(); $$ = p->parseValue(static_cast<CSSPropertyID>($3), $7); // We just need to know if the declaration is supported as it is written. Rollback any additions. if ($$) - p->rollbackLastProperties(p->m_parsedProperties->size() - oldParsedProperties); + p->rollbackLastProperties(p->m_parsedProperties.size() - oldParsedProperties); p->m_valueList = nullptr; } p->markPropertyEnd($7, false); diff --git a/Source/WebCore/css/CSSParser.cpp b/Source/WebCore/css/CSSParser.cpp index 43a89e424..4f87fc93d 100644 --- a/Source/WebCore/css/CSSParser.cpp +++ b/Source/WebCore/css/CSSParser.cpp @@ -890,6 +890,12 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int if (valueID == CSSValueLogical || valueID == CSSValueVisual) return true; break; + + case CSSPropertyWebkitRubyPosition: + if (valueID == CSSValueBefore || valueID == CSSValueAfter) + return true; + break; + #if ENABLE(CSS3_TEXT) case CSSPropertyWebkitTextAlignLast: // auto | start | end | left | right | center | justify @@ -1057,6 +1063,7 @@ static inline bool isKeywordPropertyID(CSSPropertyID propertyId) case CSSPropertyWebkitRegionOverflow: #endif case CSSPropertyWebkitRtlOrdering: + case CSSPropertyWebkitRubyPosition: #if ENABLE(CSS3_TEXT) case CSSPropertyWebkitTextAlignLast: #endif // CSS3_TEXT @@ -2873,6 +2880,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important) case CSSPropertyWebkitRegionOverflow: #endif case CSSPropertyWebkitRtlOrdering: + case CSSPropertyWebkitRubyPosition: #if ENABLE(CSS3_TEXT) case CSSPropertyWebkitTextAlignLast: #endif // CSS3_TEXT diff --git a/Source/WebCore/css/CSSPrimitiveValueMappings.h b/Source/WebCore/css/CSSPrimitiveValueMappings.h index db10acadd..f5cedf623 100644 --- a/Source/WebCore/css/CSSPrimitiveValueMappings.h +++ b/Source/WebCore/css/CSSPrimitiveValueMappings.h @@ -2811,6 +2811,33 @@ template<> inline CSSPrimitiveValue::operator TextCombine() const return TextCombineNone; } +template<> inline CSSPrimitiveValue::CSSPrimitiveValue(RubyPosition position) + : CSSValue(PrimitiveClass) +{ + m_primitiveUnitType = CSS_IDENT; + switch (position) { + case RubyPositionBefore: + m_value.ident = CSSValueBefore; + break; + case RubyPositionAfter: + m_value.ident = CSSValueAfter; + break; + } +} + +template<> inline CSSPrimitiveValue::operator RubyPosition() const +{ + switch (m_value.ident) { + case CSSValueBefore: + return RubyPositionBefore; + case CSSValueAfter: + return RubyPositionAfter; + } + + ASSERT_NOT_REACHED(); + return RubyPositionBefore; +} + template<> inline CSSPrimitiveValue::CSSPrimitiveValue(TextEmphasisPosition position) : CSSValue(PrimitiveClass) { diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp index 13d0b19e3..b25120321 100644 --- a/Source/WebCore/css/CSSProperty.cpp +++ b/Source/WebCore/css/CSSProperty.cpp @@ -324,6 +324,7 @@ bool CSSProperty::isInheritedProperty(CSSPropertyID propertyID) #endif case CSSPropertyWebkitPrintColorAdjust: case CSSPropertyWebkitRtlOrdering: + case CSSPropertyWebkitRubyPosition: case CSSPropertyWebkitTextCombine: #if ENABLE(CSS3_TEXT) case CSSPropertyWebkitTextDecorationLine: diff --git a/Source/WebCore/css/CSSPropertyNames.in b/Source/WebCore/css/CSSPropertyNames.in index d958c6b69..50ced6b03 100644 --- a/Source/WebCore/css/CSSPropertyNames.in +++ b/Source/WebCore/css/CSSPropertyNames.in @@ -351,6 +351,7 @@ z-index -webkit-perspective-origin-y -webkit-print-color-adjust -webkit-rtl-ordering +-webkit-ruby-position -webkit-text-combine -epub-text-combine = -webkit-text-combine #if defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT diff --git a/Source/WebCore/css/CSSValueKeywords.in b/Source/WebCore/css/CSSValueKeywords.in index 10ba6eae7..02a414ced 100644 --- a/Source/WebCore/css/CSSValueKeywords.in +++ b/Source/WebCore/css/CSSValueKeywords.in @@ -871,6 +871,10 @@ vertical-rl vertical-lr horizontal-bt +// -webkit-ruby-position +after +before + // -webkit-text-emphasis-position over under diff --git a/Source/WebCore/css/StyleBuilder.cpp b/Source/WebCore/css/StyleBuilder.cpp index ea4766f5b..aa6749389 100644 --- a/Source/WebCore/css/StyleBuilder.cpp +++ b/Source/WebCore/css/StyleBuilder.cpp @@ -2050,6 +2050,7 @@ StyleBuilder::StyleBuilder() setPropertyHandler(CSSPropertyWebkitRegionOverflow, ApplyPropertyDefault<RegionOverflow, &RenderStyle::regionOverflow, RegionOverflow, &RenderStyle::setRegionOverflow, RegionOverflow, &RenderStyle::initialRegionOverflow>::createHandler()); #endif setPropertyHandler(CSSPropertyWebkitRtlOrdering, ApplyPropertyDefault<Order, &RenderStyle::rtlOrdering, Order, &RenderStyle::setRTLOrdering, Order, &RenderStyle::initialRTLOrdering>::createHandler()); + setPropertyHandler(CSSPropertyWebkitRubyPosition, ApplyPropertyDefault<RubyPosition, &RenderStyle::rubyPosition, RubyPosition, &RenderStyle::setRubyPosition, RubyPosition, &RenderStyle::initialRubyPosition>::createHandler()); setPropertyHandler(CSSPropertyWebkitTextCombine, ApplyPropertyDefault<TextCombine, &RenderStyle::textCombine, TextCombine, &RenderStyle::setTextCombine, TextCombine, &RenderStyle::initialTextCombine>::createHandler()); setPropertyHandler(CSSPropertyWebkitTextEmphasisColor, ApplyPropertyColor<NoInheritFromParent, &RenderStyle::textEmphasisColor, &RenderStyle::setTextEmphasisColor, &RenderStyle::setVisitedLinkTextEmphasisColor, &RenderStyle::color>::createHandler()); setPropertyHandler(CSSPropertyWebkitTextEmphasisPosition, ApplyPropertyDefault<TextEmphasisPosition, &RenderStyle::textEmphasisPosition, TextEmphasisPosition, &RenderStyle::setTextEmphasisPosition, TextEmphasisPosition, &RenderStyle::initialTextEmphasisPosition>::createHandler()); diff --git a/Source/WebCore/css/StyleResolver.cpp b/Source/WebCore/css/StyleResolver.cpp index c6d033241..95a975779 100644 --- a/Source/WebCore/css/StyleResolver.cpp +++ b/Source/WebCore/css/StyleResolver.cpp @@ -2659,7 +2659,7 @@ bool StyleResolver::useSVGZoomRules() return m_element && m_element->isSVGElement(); } -static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, StyleResolver* selector, Length& length) +static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, StyleResolver* selector, GridTrackSize& trackSize) { Length workingLength = primitiveValue->convertToLength<FixedIntegerConversion | PercentConversion | ViewportPercentageConversion | AutoConversion>(selector->style(), selector->rootElementStyle(), selector->style()->effectiveZoom()); if (workingLength.isUndefined()) @@ -2668,20 +2668,16 @@ static bool createGridTrackBreadth(CSSPrimitiveValue* primitiveValue, StyleResol if (primitiveValue->isLength()) workingLength.setQuirk(primitiveValue->isQuirkValue()); - length = workingLength; + trackSize.setLength(workingLength); return true; } -static bool createGridTrackList(CSSValue* value, Vector<Length>& lengths, StyleResolver* selector) +static bool createGridTrackList(CSSValue* value, Vector<GridTrackSize>& trackSizes, StyleResolver* selector) { // Handle 'none'. if (value->isPrimitiveValue()) { CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); - if (primitiveValue->getIdent() == CSSValueNone) { - lengths.append(Length(Undefined)); - return true; - } - return false; + return primitiveValue->getIdent() == CSSValueNone; } if (value->isValueList()) { @@ -2690,11 +2686,11 @@ static bool createGridTrackList(CSSValue* value, Vector<Length>& lengths, StyleR if (!currValue->isPrimitiveValue()) return false; - Length length; - if (!createGridTrackBreadth(static_cast<CSSPrimitiveValue*>(currValue), selector, length)) + GridTrackSize trackSize; + if (!createGridTrackBreadth(static_cast<CSSPrimitiveValue*>(currValue), selector, trackSize)) return false; - lengths.append(length); + trackSizes.append(trackSize); } return true; } @@ -3544,17 +3540,17 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value) } #endif case CSSPropertyWebkitGridColumns: { - Vector<Length> lengths; - if (!createGridTrackList(value, lengths, this)) + Vector<GridTrackSize> trackSizes; + if (!createGridTrackList(value, trackSizes, this)) return; - m_style->setGridColumns(lengths); + m_style->setGridColumns(trackSizes); return; } case CSSPropertyWebkitGridRows: { - Vector<Length> lengths; - if (!createGridTrackList(value, lengths, this)) + Vector<GridTrackSize> trackSizes; + if (!createGridTrackList(value, trackSizes, this)) return; - m_style->setGridRows(lengths); + m_style->setGridRows(trackSizes); return; } @@ -3805,6 +3801,7 @@ void StyleResolver::applyProperty(CSSPropertyID id, CSSValue* value) case CSSPropertyWebkitRegionOverflow: #endif case CSSPropertyWebkitRtlOrdering: + case CSSPropertyWebkitRubyPosition: case CSSPropertyWebkitTextCombine: #if ENABLE(CSS3_TEXT) case CSSPropertyWebkitTextDecorationLine: diff --git a/Source/WebCore/css/themeBlackBerry.css b/Source/WebCore/css/themeBlackBerry.css index 8cd2e0e1c..2fcadc0bb 100644 --- a/Source/WebCore/css/themeBlackBerry.css +++ b/Source/WebCore/css/themeBlackBerry.css @@ -20,6 +20,15 @@ textarea { font-family: monospace; } +/* If the select do not have multiple nor size larger than 1 attribute, which are menulist appearance, we wanna change text color when it is actived. */ +input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active, input[type="file"]:active::-webkit-file-upload-button, button:active, select:not([multiple]):not([size]):active, select[size="0"]:active, select[size="1"]:active { + color: #fafafa; +} + +input[type="button"]:active:disabled, input[type="submit"]:active:disabled, input[type="reset"]:active:disabled, input[type="file"]:active:disabled::-webkit-file-upload-button, button:active:disabled, select:not([multiple]):not([size]):active:disabled, select[size="0"]:active:disabled, select[size="1"]:active:disabled { + color: GrayText; +} + select { border-radius: 0; } |