| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
| 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
| 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
| 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
| 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
| 10 * | 10 * |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // FIXME: Way too many! | 30 // FIXME: Way too many! |
| 31 #include <limits.h> | 31 #include <limits.h> |
| 32 #include "gen/sky/core/CSSValueKeywords.h" | 32 #include "gen/sky/core/CSSValueKeywords.h" |
| 33 #include "gen/sky/core/StylePropertyShorthand.h" | 33 #include "gen/sky/core/StylePropertyShorthand.h" |
| 34 #include "gen/sky/platform/RuntimeEnabledFeatures.h" | 34 #include "gen/sky/platform/RuntimeEnabledFeatures.h" |
| 35 #include "sky/engine/core/css/CSSAspectRatioValue.h" | 35 #include "sky/engine/core/css/CSSAspectRatioValue.h" |
| 36 #include "sky/engine/core/css/CSSBasicShapes.h" | 36 #include "sky/engine/core/css/CSSBasicShapes.h" |
| 37 #include "sky/engine/core/css/CSSBorderImage.h" | 37 #include "sky/engine/core/css/CSSBorderImage.h" |
| 38 #include "sky/engine/core/css/CSSCrossfadeValue.h" | 38 #include "sky/engine/core/css/CSSCrossfadeValue.h" |
| 39 #include "sky/engine/core/css/CSSCursorImageValue.h" | |
| 40 #include "sky/engine/core/css/CSSFontFaceSrcValue.h" | 39 #include "sky/engine/core/css/CSSFontFaceSrcValue.h" |
| 41 #include "sky/engine/core/css/CSSFontFeatureValue.h" | 40 #include "sky/engine/core/css/CSSFontFeatureValue.h" |
| 42 #include "sky/engine/core/css/CSSFunctionValue.h" | 41 #include "sky/engine/core/css/CSSFunctionValue.h" |
| 43 #include "sky/engine/core/css/CSSGradientValue.h" | 42 #include "sky/engine/core/css/CSSGradientValue.h" |
| 44 #include "sky/engine/core/css/CSSImageSetValue.h" | 43 #include "sky/engine/core/css/CSSImageSetValue.h" |
| 45 #include "sky/engine/core/css/CSSImageValue.h" | 44 #include "sky/engine/core/css/CSSImageValue.h" |
| 46 #include "sky/engine/core/css/CSSInheritedValue.h" | 45 #include "sky/engine/core/css/CSSInheritedValue.h" |
| 47 #include "sky/engine/core/css/CSSInitialValue.h" | 46 #include "sky/engine/core/css/CSSInitialValue.h" |
| 48 #include "sky/engine/core/css/CSSLineBoxContainValue.h" | 47 #include "sky/engine/core/css/CSSLineBoxContainValue.h" |
| 49 #include "sky/engine/core/css/CSSPrimitiveValue.h" | 48 #include "sky/engine/core/css/CSSPrimitiveValue.h" |
| (...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 case CSSPropertyColor: // <color> | inherit | 541 case CSSPropertyColor: // <color> | inherit |
| 543 case CSSPropertyTextDecorationColor: // CSS3 text decoration colors | 542 case CSSPropertyTextDecorationColor: // CSS3 text decoration colors |
| 544 case CSSPropertyWebkitTextEmphasisColor: | 543 case CSSPropertyWebkitTextEmphasisColor: |
| 545 case CSSPropertyWebkitTextFillColor: | 544 case CSSPropertyWebkitTextFillColor: |
| 546 case CSSPropertyWebkitTextStrokeColor: | 545 case CSSPropertyWebkitTextStrokeColor: |
| 547 parsedValue = parseColor(); | 546 parsedValue = parseColor(); |
| 548 if (parsedValue) | 547 if (parsedValue) |
| 549 m_valueList->next(); | 548 m_valueList->next(); |
| 550 break; | 549 break; |
| 551 | 550 |
| 552 case CSSPropertyCursor: { | |
| 553 // Grammar defined by CSS3 UI and modified by CSS4 images: | |
| 554 // [ [<image> [<x> <y>]?,]* | |
| 555 // [ auto | crosshair | default | pointer | progress | move | e-resize |
ne-resize | | |
| 556 // nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize |
ew-resize | | |
| 557 // ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | tex
t | wait | help | | |
| 558 // vertical-text | cell | context-menu | alias | copy | no-drop | not-al
lowed | all-scroll | | |
| 559 // zoom-in | zoom-out | -webkit-grab | -webkit-grabbing | -webkit-zoom-i
n | -webkit-zoom-out ] ] | inherit | |
| 560 RefPtr<CSSValueList> list = nullptr; | |
| 561 while (value) { | |
| 562 RefPtr<CSSValue> image = nullptr; | |
| 563 if (value->unit == CSSPrimitiveValue::CSS_URI) { | |
| 564 String uri = value->string; | |
| 565 if (!uri.isNull()) | |
| 566 image = createCSSImageValueWithReferrer(uri, completeURL(uri
)); | |
| 567 } else if (value->unit == CSSParserValue::Function && equalIgnoringC
ase(value->function->name, "-webkit-image-set(")) { | |
| 568 image = parseImageSet(m_valueList); | |
| 569 if (!image) | |
| 570 break; | |
| 571 } else | |
| 572 break; | |
| 573 | |
| 574 Vector<int> coords; | |
| 575 value = m_valueList->next(); | |
| 576 while (value && validUnit(value, FNumber)) { | |
| 577 coords.append(int(value->fValue)); | |
| 578 value = m_valueList->next(); | |
| 579 } | |
| 580 bool hasHotSpot = false; | |
| 581 IntPoint hotSpot(-1, -1); | |
| 582 int nrcoords = coords.size(); | |
| 583 if (nrcoords > 0 && nrcoords != 2) | |
| 584 return false; | |
| 585 if (nrcoords == 2) { | |
| 586 hasHotSpot = true; | |
| 587 hotSpot = IntPoint(coords[0], coords[1]); | |
| 588 } | |
| 589 | |
| 590 if (!list) | |
| 591 list = CSSValueList::createCommaSeparated(); | |
| 592 | |
| 593 if (image) | |
| 594 list->append(CSSCursorImageValue::create(image, hasHotSpot, hotS
pot)); | |
| 595 | |
| 596 if (!consumeComma(m_valueList)) | |
| 597 return false; | |
| 598 value = m_valueList->current(); | |
| 599 } | |
| 600 if (list) { | |
| 601 if (!value) | |
| 602 return false; | |
| 603 if (inQuirksMode() && value->id == CSSValueHand) // MSIE 5 compatibi
lity :/ | |
| 604 list->append(cssValuePool().createIdentifierValue(CSSValuePointe
r)); | |
| 605 else if ((value->id >= CSSValueAuto && value->id <= CSSValueWebkitZo
omOut) || value->id == CSSValueCopy || value->id == CSSValueNone) | |
| 606 list->append(cssValuePool().createIdentifierValue(value->id)); | |
| 607 m_valueList->next(); | |
| 608 parsedValue = list.release(); | |
| 609 break; | |
| 610 } else if (value) { | |
| 611 id = value->id; | |
| 612 if (inQuirksMode() && value->id == CSSValueHand) { // MSIE 5 compati
bility :/ | |
| 613 id = CSSValuePointer; | |
| 614 validPrimitive = true; | |
| 615 } else if ((value->id >= CSSValueAuto && value->id <= CSSValueWebkit
ZoomOut) || value->id == CSSValueCopy || value->id == CSSValueNone) | |
| 616 validPrimitive = true; | |
| 617 } else { | |
| 618 ASSERT_NOT_REACHED(); | |
| 619 return false; | |
| 620 } | |
| 621 break; | |
| 622 } | |
| 623 | |
| 624 case CSSPropertyBackgroundAttachment: | 551 case CSSPropertyBackgroundAttachment: |
| 625 case CSSPropertyBackgroundClip: | 552 case CSSPropertyBackgroundClip: |
| 626 case CSSPropertyWebkitBackgroundClip: | 553 case CSSPropertyWebkitBackgroundClip: |
| 627 case CSSPropertyWebkitBackgroundComposite: | 554 case CSSPropertyWebkitBackgroundComposite: |
| 628 case CSSPropertyBackgroundImage: | 555 case CSSPropertyBackgroundImage: |
| 629 case CSSPropertyBackgroundOrigin: | 556 case CSSPropertyBackgroundOrigin: |
| 630 case CSSPropertyWebkitBackgroundOrigin: | 557 case CSSPropertyWebkitBackgroundOrigin: |
| 631 case CSSPropertyBackgroundPosition: | 558 case CSSPropertyBackgroundPosition: |
| 632 case CSSPropertyBackgroundPositionX: | 559 case CSSPropertyBackgroundPositionX: |
| 633 case CSSPropertyBackgroundPositionY: | 560 case CSSPropertyBackgroundPositionY: |
| (...skipping 5398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6032 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); | 5959 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); |
| 6033 } | 5960 } |
| 6034 | 5961 |
| 6035 bool CSSPropertyParser::isSystemColor(int id) | 5962 bool CSSPropertyParser::isSystemColor(int id) |
| 6036 { | 5963 { |
| 6037 // FIXME(sky): remove | 5964 // FIXME(sky): remove |
| 6038 return false; | 5965 return false; |
| 6039 } | 5966 } |
| 6040 | 5967 |
| 6041 } // namespace blink | 5968 } // namespace blink |
| OLD | NEW |