| 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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 return false; | 487 return false; |
| 488 } | 488 } |
| 489 | 489 |
| 490 bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font) | 490 bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font) |
| 491 { | 491 { |
| 492 if (fontString.isEmpty()) | 492 if (fontString.isEmpty()) |
| 493 return false; | 493 return false; |
| 494 | 494 |
| 495 // Interpret fontString in the same way as the 'font' attribute of CanvasRen
deringContext2D. | 495 // Interpret fontString in the same way as the 'font' attribute of CanvasRen
deringContext2D. |
| 496 RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::creat
e(); | 496 RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::creat
e(); |
| 497 BisonCSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, t
rue, HTMLStandardMode, 0); | 497 BisonCSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, H
TMLStandardMode, 0); |
| 498 if (parsedStyle->isEmpty()) | 498 if (parsedStyle->isEmpty()) |
| 499 return false; | 499 return false; |
| 500 | 500 |
| 501 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); | 501 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); |
| 502 if (fontValue == "inherit" || fontValue == "initial") | 502 if (fontValue == "inherit" || fontValue == "initial") |
| 503 return false; | 503 return false; |
| 504 | 504 |
| 505 RefPtr<RenderStyle> style = RenderStyle::create(); | 505 RefPtr<RenderStyle> style = RenderStyle::create(); |
| 506 | 506 |
| 507 FontFamily fontFamily; | 507 FontFamily fontFamily; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 return fonts.release(); | 572 return fonts.release(); |
| 573 } | 573 } |
| 574 | 574 |
| 575 void FontFaceSet::didLayout(Document& document) | 575 void FontFaceSet::didLayout(Document& document) |
| 576 { | 576 { |
| 577 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(docu
ment, supplementName()))) | 577 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(docu
ment, supplementName()))) |
| 578 fonts->didLayout(); | 578 fonts->didLayout(); |
| 579 } | 579 } |
| 580 | 580 |
| 581 } // namespace blink | 581 } // namespace blink |
| OLD | NEW |