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

Side by Side Diff: sky/engine/core/css/CSSComputedStyleDeclaration.cpp

Issue 667003003: Remove most of visited link support. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 months 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights reserved.
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
6 * Copyright (C) 2011 Sencha, Inc. All rights reserved. 6 * Copyright (C) 2011 Sencha, Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after
1464 if (!style) 1464 if (!style)
1465 return nullptr; 1465 return nullptr;
1466 1466
1467 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->d irection(), style->writingMode()); 1467 propertyID = CSSProperty::resolveDirectionAwareProperty(propertyID, style->d irection(), style->writingMode());
1468 1468
1469 switch (propertyID) { 1469 switch (propertyID) {
1470 case CSSPropertyInvalid: 1470 case CSSPropertyInvalid:
1471 break; 1471 break;
1472 1472
1473 case CSSPropertyBackgroundColor: 1473 case CSSPropertyBackgroundColor:
1474 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidCo lor(*style, style->backgroundColor()); 1474 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> colorIncludingFallback(CSSPropertyBackgroundColor).rgb()) : currentColorOrValidC olor(*style, style->backgroundColor());
1475 case CSSPropertyBackgroundImage: 1475 case CSSPropertyBackgroundImage:
1476 case CSSPropertyWebkitMaskImage: { 1476 case CSSPropertyWebkitMaskImage: {
1477 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSep arated(); 1477 RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSep arated();
1478 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImag e ? &style->maskLayers() : &style->backgroundLayers(); 1478 const FillLayer* currLayer = propertyID == CSSPropertyWebkitMaskImag e ? &style->maskLayers() : &style->backgroundLayers();
1479 for (; currLayer; currLayer = currLayer->next()) { 1479 for (; currLayer; currLayer = currLayer->next()) {
1480 if (currLayer->image()) 1480 if (currLayer->image())
1481 list->append(currLayer->image()->cssValue()); 1481 list->append(currLayer->image()->cssValue());
1482 else 1482 else
1483 list->append(cssValuePool().createIdentifierValue(CSSValueNo ne)); 1483 list->append(cssValuePool().createIdentifierValue(CSSValueNo ne));
1484 } 1484 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1572 } 1572 }
1573 case CSSPropertyWebkitBorderHorizontalSpacing: 1573 case CSSPropertyWebkitBorderHorizontalSpacing:
1574 return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), *sty le); 1574 return zoomAdjustedPixelValue(style->horizontalBorderSpacing(), *sty le);
1575 case CSSPropertyWebkitBorderVerticalSpacing: 1575 case CSSPropertyWebkitBorderVerticalSpacing:
1576 return zoomAdjustedPixelValue(style->verticalBorderSpacing(), *style ); 1576 return zoomAdjustedPixelValue(style->verticalBorderSpacing(), *style );
1577 case CSSPropertyBorderImageSource: 1577 case CSSPropertyBorderImageSource:
1578 if (style->borderImageSource()) 1578 if (style->borderImageSource())
1579 return style->borderImageSource()->cssValue(); 1579 return style->borderImageSource()->cssValue();
1580 return cssValuePool().createIdentifierValue(CSSValueNone); 1580 return cssValuePool().createIdentifierValue(CSSValueNone);
1581 case CSSPropertyBorderTopColor: 1581 case CSSPropertyBorderTopColor:
1582 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidCol or(*style, style->borderTopColor()); 1582 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> colorIncludingFallback(CSSPropertyBorderTopColor).rgb()) : currentColorOrValidCo lor(*style, style->borderTopColor());
1583 case CSSPropertyBorderRightColor: 1583 case CSSPropertyBorderRightColor:
1584 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderRightColor).rgb()) : currentColorOrValidC olor(*style, style->borderRightColor()); 1584 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> colorIncludingFallback(CSSPropertyBorderRightColor).rgb()) : currentColorOrValid Color(*style, style->borderRightColor());
1585 case CSSPropertyBorderBottomColor: 1585 case CSSPropertyBorderBottomColor:
1586 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderBottomColor).rgb()) : currentColorOrValid Color(*style, style->borderBottomColor()); 1586 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> colorIncludingFallback(CSSPropertyBorderBottomColor).rgb()) : currentColorOrVali dColor(*style, style->borderBottomColor());
1587 case CSSPropertyBorderLeftColor: 1587 case CSSPropertyBorderLeftColor:
1588 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyBorderLeftColor).rgb()) : currentColorOrValidCo lor(*style, style->borderLeftColor()); 1588 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> colorIncludingFallback(CSSPropertyBorderLeftColor).rgb()) : currentColorOrValidC olor(*style, style->borderLeftColor());
1589 case CSSPropertyBorderTopStyle: 1589 case CSSPropertyBorderTopStyle:
1590 return cssValuePool().createValue(style->borderTopStyle()); 1590 return cssValuePool().createValue(style->borderTopStyle());
1591 case CSSPropertyBorderRightStyle: 1591 case CSSPropertyBorderRightStyle:
1592 return cssValuePool().createValue(style->borderRightStyle()); 1592 return cssValuePool().createValue(style->borderRightStyle());
1593 case CSSPropertyBorderBottomStyle: 1593 case CSSPropertyBorderBottomStyle:
1594 return cssValuePool().createValue(style->borderBottomStyle()); 1594 return cssValuePool().createValue(style->borderBottomStyle());
1595 case CSSPropertyBorderLeftStyle: 1595 case CSSPropertyBorderLeftStyle:
1596 return cssValuePool().createValue(style->borderLeftStyle()); 1596 return cssValuePool().createValue(style->borderLeftStyle());
1597 case CSSPropertyBorderTopWidth: 1597 case CSSPropertyBorderTopWidth:
1598 return zoomAdjustedPixelValue(style->borderTopWidth(), *style); 1598 return zoomAdjustedPixelValue(style->borderTopWidth(), *style);
(...skipping 10 matching lines...) Expand all
1609 return cssValuePool().createIdentifierValue(CSSValueSlice); 1609 return cssValuePool().createIdentifierValue(CSSValueSlice);
1610 return cssValuePool().createIdentifierValue(CSSValueClone); 1610 return cssValuePool().createIdentifierValue(CSSValueClone);
1611 case CSSPropertyBoxShadow: 1611 case CSSPropertyBoxShadow:
1612 case CSSPropertyWebkitBoxShadow: 1612 case CSSPropertyWebkitBoxShadow:
1613 return valueForShadowList(style->boxShadow(), *style, true); 1613 return valueForShadowList(style->boxShadow(), *style, true);
1614 case CSSPropertyCaptionSide: 1614 case CSSPropertyCaptionSide:
1615 return cssValuePool().createValue(style->captionSide()); 1615 return cssValuePool().createValue(style->captionSide());
1616 case CSSPropertyClear: 1616 case CSSPropertyClear:
1617 return cssValuePool().createValue(style->clear()); 1617 return cssValuePool().createValue(style->clear());
1618 case CSSPropertyColor: 1618 case CSSPropertyColor:
1619 return cssValuePool().createColorValue(m_allowVisitedStyle ? style-> visitedDependentColor(CSSPropertyColor).rgb() : style->color().rgb()); 1619 return cssValuePool().createColorValue(m_allowVisitedStyle ? style-> colorIncludingFallback(CSSPropertyColor).rgb() : style->color().rgb());
1620 case CSSPropertyWebkitPrintColorAdjust: 1620 case CSSPropertyWebkitPrintColorAdjust:
1621 return cssValuePool().createValue(style->printColorAdjust()); 1621 return cssValuePool().createValue(style->printColorAdjust());
1622 case CSSPropertyTabSize: 1622 case CSSPropertyTabSize:
1623 return cssValuePool().createValue(style->tabSize(), CSSPrimitiveValu e::CSS_NUMBER); 1623 return cssValuePool().createValue(style->tabSize(), CSSPrimitiveValu e::CSS_NUMBER);
1624 case CSSPropertyCursor: { 1624 case CSSPropertyCursor: {
1625 RefPtrWillBeRawPtr<CSSValueList> list = nullptr; 1625 RefPtrWillBeRawPtr<CSSValueList> list = nullptr;
1626 CursorList* cursors = style->cursors(); 1626 CursorList* cursors = style->cursors();
1627 if (cursors && cursors->size() > 0) { 1627 if (cursors && cursors->size() > 0) {
1628 list = CSSValueList::createCommaSeparated(); 1628 list = CSSValueList::createCommaSeparated();
1629 for (unsigned i = 0; i < cursors->size(); ++i) 1629 for (unsigned i = 0; i < cursors->size(); ++i)
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1908 zoomAdjustedPixelValueForLength(style->objectPosition().x(), *style), 1908 zoomAdjustedPixelValueForLength(style->objectPosition().x(), *style),
1909 zoomAdjustedPixelValueForLength(style->objectPosition().y(), *style), 1909 zoomAdjustedPixelValueForLength(style->objectPosition().y(), *style),
1910 Pair::KeepIdenticalValues)); 1910 Pair::KeepIdenticalValues));
1911 case CSSPropertyOpacity: 1911 case CSSPropertyOpacity:
1912 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu e::CSS_NUMBER); 1912 return cssValuePool().createValue(style->opacity(), CSSPrimitiveValu e::CSS_NUMBER);
1913 case CSSPropertyOrphans: 1913 case CSSPropertyOrphans:
1914 if (style->hasAutoOrphans()) 1914 if (style->hasAutoOrphans())
1915 return cssValuePool().createIdentifierValue(CSSValueAuto); 1915 return cssValuePool().createIdentifierValue(CSSValueAuto);
1916 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu e::CSS_NUMBER); 1916 return cssValuePool().createValue(style->orphans(), CSSPrimitiveValu e::CSS_NUMBER);
1917 case CSSPropertyOutlineColor: 1917 case CSSPropertyOutlineColor:
1918 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> visitedDependentColor(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColor (*style, style->outlineColor()); 1918 return m_allowVisitedStyle ? cssValuePool().createColorValue(style-> colorIncludingFallback(CSSPropertyOutlineColor).rgb()) : currentColorOrValidColo r(*style, style->outlineColor());
1919 case CSSPropertyOutlineOffset: 1919 case CSSPropertyOutlineOffset:
1920 return zoomAdjustedPixelValue(style->outlineOffset(), *style); 1920 return zoomAdjustedPixelValue(style->outlineOffset(), *style);
1921 case CSSPropertyOutlineStyle: 1921 case CSSPropertyOutlineStyle:
1922 if (style->outlineStyleIsAuto()) 1922 if (style->outlineStyleIsAuto())
1923 return cssValuePool().createIdentifierValue(CSSValueAuto); 1923 return cssValuePool().createIdentifierValue(CSSValueAuto);
1924 return cssValuePool().createValue(style->outlineStyle()); 1924 return cssValuePool().createValue(style->outlineStyle());
1925 case CSSPropertyOutlineWidth: 1925 case CSSPropertyOutlineWidth:
1926 return zoomAdjustedPixelValue(style->outlineWidth(), *style); 1926 return zoomAdjustedPixelValue(style->outlineWidth(), *style);
1927 case CSSPropertyOverflow: 1927 case CSSPropertyOverflow:
1928 return cssValuePool().createValue(max(style->overflowX(), style->ove rflowY())); 1928 return cssValuePool().createValue(max(style->overflowX(), style->ove rflowY()));
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
2753 return list.release(); 2753 return list.release();
2754 } 2754 }
2755 2755
2756 void CSSComputedStyleDeclaration::trace(Visitor* visitor) 2756 void CSSComputedStyleDeclaration::trace(Visitor* visitor)
2757 { 2757 {
2758 visitor->trace(m_node); 2758 visitor->trace(m_node);
2759 CSSStyleDeclaration::trace(visitor); 2759 CSSStyleDeclaration::trace(visitor);
2760 } 2760 }
2761 2761
2762 } // namespace blink 2762 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/animation/css/CSSPropertyEquality.cpp ('k') | sky/engine/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698