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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 } | 469 } |
470 return true; | 470 return true; |
471 } | 471 } |
472 | 472 |
473 bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font) | 473 bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font) |
474 { | 474 { |
475 if (fontString.isEmpty()) | 475 if (fontString.isEmpty()) |
476 return false; | 476 return false; |
477 | 477 |
478 // Interpret fontString in the same way as the 'font' attribute of CanvasRen
deringContext2D. | 478 // Interpret fontString in the same way as the 'font' attribute of CanvasRen
deringContext2D. |
479 RefPtr<MutableStylePropertySet> parsedStyle = MutableStylePropertySet::creat
e(); | 479 RefPtrWillBeRawPtr<MutableStylePropertySet> parsedStyle = MutableStyleProper
tySet::create(); |
480 BisonCSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, t
rue, HTMLStandardMode, 0); | 480 BisonCSSParser::parseValue(parsedStyle.get(), CSSPropertyFont, fontString, t
rue, HTMLStandardMode, 0); |
481 if (parsedStyle->isEmpty()) | 481 if (parsedStyle->isEmpty()) |
482 return false; | 482 return false; |
483 | 483 |
484 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); | 484 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); |
485 if (fontValue == "inherit" || fontValue == "initial") | 485 if (fontValue == "inherit" || fontValue == "initial") |
486 return false; | 486 return false; |
487 | 487 |
488 RefPtr<RenderStyle> style = RenderStyle::create(); | 488 RefPtr<RenderStyle> style = RenderStyle::create(); |
489 | 489 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 } | 555 } |
556 | 556 |
557 void FontFaceSet::didLayout(Document& document) | 557 void FontFaceSet::didLayout(Document& document) |
558 { | 558 { |
559 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(docu
ment, supplementName()))) | 559 if (FontFaceSet* fonts = static_cast<FontFaceSet*>(SupplementType::from(docu
ment, supplementName()))) |
560 fonts->didLayout(); | 560 fonts->didLayout(); |
561 } | 561 } |
562 | 562 |
563 | 563 |
564 } // namespace WebCore | 564 } // namespace WebCore |
OLD | NEW |