Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: third_party/WebKit/Source/core/css/FontFaceSet.cpp

Issue 2392343005: Reflow comments in core/css (Closed)
Patch Set: Revert clang-format Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 f = f->next()) { 387 f = f->next()) {
388 CSSSegmentedFontFace* segmentedFontFace = 388 CSSSegmentedFontFace* segmentedFontFace =
389 fontFaceCache->get(font.getFontDescription(), f->family()); 389 fontFaceCache->get(font.getFontDescription(), f->family());
390 if (segmentedFontFace) 390 if (segmentedFontFace)
391 segmentedFontFace->match(text, faces); 391 segmentedFontFace->match(text, faces);
392 } 392 }
393 393
394 LoadFontPromiseResolver* resolver = 394 LoadFontPromiseResolver* resolver =
395 LoadFontPromiseResolver::create(faces, scriptState); 395 LoadFontPromiseResolver::create(faces, scriptState);
396 ScriptPromise promise = resolver->promise(); 396 ScriptPromise promise = resolver->promise();
397 resolver->loadFonts( 397 // After this, resolver->promise() may return null.
398 getExecutionContext()); // After this, resolver->promise() may return nul l. 398 resolver->loadFonts(getExecutionContext());
399 return promise; 399 return promise;
400 } 400 }
401 401
402 bool FontFaceSet::check(const String& fontString, 402 bool FontFaceSet::check(const String& fontString,
403 const String& text, 403 const String& text,
404 ExceptionState& exceptionState) { 404 ExceptionState& exceptionState) {
405 if (!inActiveDocumentContext()) 405 if (!inActiveDocumentContext())
406 return false; 406 return false;
407 407
408 Font font; 408 Font font;
(...skipping 25 matching lines...) Expand all
434 f->family())) 434 f->family()))
435 return true; 435 return true;
436 } 436 }
437 return false; 437 return false;
438 } 438 }
439 439
440 bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font) { 440 bool FontFaceSet::resolveFontStyle(const String& fontString, Font& font) {
441 if (fontString.isEmpty()) 441 if (fontString.isEmpty())
442 return false; 442 return false;
443 443
444 // Interpret fontString in the same way as the 'font' attribute of CanvasRende ringContext2D. 444 // Interpret fontString in the same way as the 'font' attribute of
445 // CanvasRenderingContext2D.
445 MutableStylePropertySet* parsedStyle = 446 MutableStylePropertySet* parsedStyle =
446 MutableStylePropertySet::create(HTMLStandardMode); 447 MutableStylePropertySet::create(HTMLStandardMode);
447 CSSParser::parseValue(parsedStyle, CSSPropertyFont, fontString, true, 0); 448 CSSParser::parseValue(parsedStyle, CSSPropertyFont, fontString, true, 0);
448 if (parsedStyle->isEmpty()) 449 if (parsedStyle->isEmpty())
449 return false; 450 return false;
450 451
451 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont); 452 String fontValue = parsedStyle->getPropertyValue(CSSPropertyFont);
452 if (fontValue == "inherit" || fontValue == "initial") 453 if (fontValue == "inherit" || fontValue == "initial")
453 return false; 454 return false;
454 455
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 visitor->trace(m_failedFonts); 559 visitor->trace(m_failedFonts);
559 visitor->trace(m_nonCSSConnectedFaces); 560 visitor->trace(m_nonCSSConnectedFaces);
560 visitor->trace(m_asyncRunner); 561 visitor->trace(m_asyncRunner);
561 EventTargetWithInlineData::trace(visitor); 562 EventTargetWithInlineData::trace(visitor);
562 Supplement<Document>::trace(visitor); 563 Supplement<Document>::trace(visitor);
563 ActiveDOMObject::trace(visitor); 564 ActiveDOMObject::trace(visitor);
564 FontFace::LoadFontCallback::trace(visitor); 565 FontFace::LoadFontCallback::trace(visitor);
565 } 566 }
566 567
567 } // namespace blink 568 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/FontFaceSet.h ('k') | third_party/WebKit/Source/core/css/FontSize.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698