| 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 met: | 5 * modification, are permitted provided that the following conditions are met: |
| 6 * | 6 * |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "core/css/FontFaceSet.h" | 27 #include "core/css/FontFaceSet.h" |
| 28 | 28 |
| 29 #include "RuntimeEnabledFeatures.h" | 29 #include "RuntimeEnabledFeatures.h" |
| 30 #include "bindings/v8/Dictionary.h" | 30 #include "bindings/v8/Dictionary.h" |
| 31 #include "bindings/v8/ScriptPromiseResolver.h" | 31 #include "bindings/v8/ScriptPromiseResolver.h" |
| 32 #include "bindings/v8/ScriptScope.h" | 32 #include "bindings/v8/ScriptScope.h" |
| 33 #include "bindings/v8/ScriptState.h" | 33 #include "bindings/v8/ScriptState.h" |
| 34 #include "core/css/CSSFontFaceLoadEvent.h" | 34 #include "core/css/CSSFontFaceLoadEvent.h" |
| 35 #include "core/css/CSSFontFaceSource.h" | 35 #include "core/css/CSSFontFaceSource.h" |
| 36 #include "core/css/CSSFontSelector.h" | 36 #include "core/css/CSSFontSelector.h" |
| 37 #include "core/css/parser/BisonCSSParser.h" | 37 #include "core/css/parser/CSSParser.h" |
| 38 #include "core/css/CSSSegmentedFontFace.h" | 38 #include "core/css/CSSSegmentedFontFace.h" |
| 39 #include "core/css/StylePropertySet.h" | 39 #include "core/css/StylePropertySet.h" |
| 40 #include "core/css/resolver/StyleResolver.h" | 40 #include "core/css/resolver/StyleResolver.h" |
| 41 #include "core/dom/Document.h" | 41 #include "core/dom/Document.h" |
| 42 #include "core/frame/Frame.h" | 42 #include "core/frame/Frame.h" |
| 43 #include "core/frame/FrameView.h" | 43 #include "core/frame/FrameView.h" |
| 44 #include "public/platform/Platform.h" | 44 #include "public/platform/Platform.h" |
| 45 | 45 |
| 46 namespace WebCore { | 46 namespace WebCore { |
| 47 | 47 |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 return true; | 355 return true; |
| 356 } | 356 } |
| 357 | 357 |
| 358 bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font) | 358 bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font) |
| 359 { | 359 { |
| 360 if (fontString.isEmpty()) | 360 if (fontString.isEmpty()) |
| 361 return false; | 361 return false; |
| 362 | 362 |
| 363 // Interpret fontString in the same way as the 'font' attribute of CanvasRen
deringContext2D. | 363 // Interpret fontString in the same way as the 'font' attribute of CanvasRen
deringContext2D. |
| 364 RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::creat
e(); | 364 RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::creat
e(); |
| 365 BisonCSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, t
rue, HTMLStandardMode, 0); | 365 CSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, true,
HTMLStandardMode, 0); |
| 366 if (parsedStyle->isEmpty()) | 366 if (parsedStyle->isEmpty()) |
| 367 return false; | 367 return false; |
| 368 | 368 |
| 369 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); | 369 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); |
| 370 if (fontValue == "inherit" || fontValue == "initial") | 370 if (fontValue == "inherit" || fontValue == "initial") |
| 371 return false; | 371 return false; |
| 372 | 372 |
| 373 RefPtr<RenderStyle> style = RenderStyle::create(); | 373 RefPtr<RenderStyle> style = RenderStyle::create(); |
| 374 | 374 |
| 375 FontFamily fontFamily; | 375 FontFamily fontFamily; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 } | 426 } |
| 427 | 427 |
| 428 void FontFaceSet::didLayout(Document* document) | 428 void FontFaceSet::didLayout(Document* document) |
| 429 { | 429 { |
| 430 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(docu
ment, supplementName()))) | 430 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(docu
ment, supplementName()))) |
| 431 fonts->didLayout(); | 431 fonts->didLayout(); |
| 432 } | 432 } |
| 433 | 433 |
| 434 | 434 |
| 435 } // namespace WebCore | 435 } // namespace WebCore |
| OLD | NEW |