| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 #include "sky/engine/platform/SharedBuffer.h" | 57 #include "sky/engine/platform/SharedBuffer.h" |
| 58 #include "sky/engine/wtf/ArrayBufferView.h" | 58 #include "sky/engine/wtf/ArrayBufferView.h" |
| 59 | 59 |
| 60 namespace blink { | 60 namespace blink { |
| 61 | 61 |
| 62 static PassRefPtr<CSSValue> parseCSSValue(const Document* document, const String
& s, CSSPropertyID propertyID) | 62 static PassRefPtr<CSSValue> parseCSSValue(const Document* document, const String
& s, CSSPropertyID propertyID) |
| 63 { | 63 { |
| 64 if (s.isEmpty()) | 64 if (s.isEmpty()) |
| 65 return nullptr; | 65 return nullptr; |
| 66 RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::creat
e(); | 66 RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::creat
e(); |
| 67 BisonCSSParser::parseValue(parsedStyle.get(), propertyID, s, true, *document
); | 67 BisonCSSParser::parseValue(parsedStyle.get(), propertyID, s, *document); |
| 68 return parsedStyle->getPropertyCSSValue(propertyID); | 68 return parsedStyle->getPropertyCSSValue(propertyID); |
| 69 } | 69 } |
| 70 | 70 |
| 71 PassRefPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicStr
ing& family, const String& source, const Dictionary& descriptors) | 71 PassRefPtr<FontFace> FontFace::create(ExecutionContext* context, const AtomicStr
ing& family, const String& source, const Dictionary& descriptors) |
| 72 { | 72 { |
| 73 RefPtr<FontFace> fontFace = adoptRef(new FontFace(context, family, descripto
rs)); | 73 RefPtr<FontFace> fontFace = adoptRef(new FontFace(context, family, descripto
rs)); |
| 74 | 74 |
| 75 RefPtr<CSSValue> src = parseCSSValue(toDocument(context), source, CSSPropert
ySrc); | 75 RefPtr<CSSValue> src = parseCSSValue(toDocument(context), source, CSSPropert
ySrc); |
| 76 if (!src || !src->isValueList()) | 76 if (!src || !src->isValueList()) |
| 77 fontFace->setError(DOMException::create(SyntaxError, "The source provide
d ('" + source + "') could not be parsed as a value list.")); | 77 fontFace->setError(DOMException::create(SyntaxError, "The source provide
d ('" + source + "') could not be parsed as a value list.")); |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 setError(DOMException::create(SyntaxError, "Invalid font data in ArrayBu
ffer.")); | 545 setError(DOMException::create(SyntaxError, "Invalid font data in ArrayBu
ffer.")); |
| 546 m_cssFontFace->addSource(source.release()); | 546 m_cssFontFace->addSource(source.release()); |
| 547 } | 547 } |
| 548 | 548 |
| 549 bool FontFace::hadBlankText() const | 549 bool FontFace::hadBlankText() const |
| 550 { | 550 { |
| 551 return m_cssFontFace->hadBlankText(); | 551 return m_cssFontFace->hadBlankText(); |
| 552 } | 552 } |
| 553 | 553 |
| 554 } // namespace blink | 554 } // namespace blink |
| OLD | NEW |