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

Side by Side Diff: Source/core/css/CSSStyleSheet.cpp

Issue 28553005: Avoid parsing css text if there are identical inline style blocks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2006, 2007, 2012 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 PassRefPtr<CSSStyleSheet> CSSStyleSheet::create(PassRefPtr<StyleSheetContents> s heet, CSSImportRule* ownerRule) 73 PassRefPtr<CSSStyleSheet> CSSStyleSheet::create(PassRefPtr<StyleSheetContents> s heet, CSSImportRule* ownerRule)
74 { 74 {
75 return adoptRef(new CSSStyleSheet(sheet, ownerRule)); 75 return adoptRef(new CSSStyleSheet(sheet, ownerRule));
76 } 76 }
77 77
78 PassRefPtr<CSSStyleSheet> CSSStyleSheet::create(PassRefPtr<StyleSheetContents> s heet, Node* ownerNode) 78 PassRefPtr<CSSStyleSheet> CSSStyleSheet::create(PassRefPtr<StyleSheetContents> s heet, Node* ownerNode)
79 { 79 {
80 return adoptRef(new CSSStyleSheet(sheet, ownerNode, false, TextPosition::min imumPosition())); 80 return adoptRef(new CSSStyleSheet(sheet, ownerNode, false, TextPosition::min imumPosition()));
81 } 81 }
82 82
83 PassRefPtr<CSSStyleSheet> CSSStyleSheet::createInline(PassRefPtr<StyleSheetConte nts> sheet, Node* ownerNode, const TextPosition& startPosition)
84 {
85 ASSERT(sheet);
86 return adoptRef(new CSSStyleSheet(sheet, ownerNode, true, startPosition));
87 }
88
83 PassRefPtr<CSSStyleSheet> CSSStyleSheet::createInline(Node* ownerNode, const KUR L& baseURL, const TextPosition& startPosition, const String& encoding) 89 PassRefPtr<CSSStyleSheet> CSSStyleSheet::createInline(Node* ownerNode, const KUR L& baseURL, const TextPosition& startPosition, const String& encoding)
84 { 90 {
85 CSSParserContext parserContext(ownerNode->document(), baseURL, encoding); 91 CSSParserContext parserContext(ownerNode->document(), baseURL, encoding);
86 RefPtr<StyleSheetContents> sheet = StyleSheetContents::create(baseURL.string (), parserContext); 92 RefPtr<StyleSheetContents> sheet = StyleSheetContents::create(baseURL.string (), parserContext);
87 return adoptRef(new CSSStyleSheet(sheet.release(), ownerNode, true, startPos ition)); 93 return adoptRef(new CSSStyleSheet(sheet.release(), ownerNode, true, startPos ition));
88 } 94 }
89 95
90 CSSStyleSheet::CSSStyleSheet(PassRefPtr<StyleSheetContents> contents, CSSImportR ule* ownerRule) 96 CSSStyleSheet::CSSStyleSheet(PassRefPtr<StyleSheetContents> contents, CSSImportR ule* ownerRule)
91 : m_contents(contents) 97 : m_contents(contents)
92 , m_isInlineStylesheet(false) 98 , m_isInlineStylesheet(false)
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 root = root->parentStyleSheet(); 412 root = root->parentStyleSheet();
407 return root->ownerNode() ? &root->ownerNode()->document() : 0; 413 return root->ownerNode() ? &root->ownerNode()->document() : 0;
408 } 414 }
409 415
410 void CSSStyleSheet::clearChildRuleCSSOMWrappers() 416 void CSSStyleSheet::clearChildRuleCSSOMWrappers()
411 { 417 {
412 m_childRuleCSSOMWrappers.clear(); 418 m_childRuleCSSOMWrappers.clear();
413 } 419 }
414 420
415 } 421 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698