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

Side by Side Diff: WebCore/inspector/InspectorStyleSheet.cpp

Issue 5575009: Merge 72811 - 2010-11-29 Pavel Feldman <pfeldman@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010, Google Inc. All rights reserved. 2 * Copyright (C) 2010, 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
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 969 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 bool success = inlineStyleSheetText(&text); 980 bool success = inlineStyleSheetText(&text);
981 if (!success) 981 if (!success)
982 success = resourceStyleSheetText(&text); 982 success = resourceStyleSheetText(&text);
983 if (success) 983 if (success)
984 *result = text; 984 *result = text;
985 return success; 985 return success;
986 } 986 }
987 987
988 bool InspectorStyleSheet::resourceStyleSheetText(String* result) const 988 bool InspectorStyleSheet::resourceStyleSheetText(String* result) const
989 { 989 {
990 if (m_origin == "user" || m_origin == "user-agent")
991 return false;
992
990 if (!m_pageStyleSheet || !ownerDocument()) 993 if (!m_pageStyleSheet || !ownerDocument())
991 return false; 994 return false;
992 995
993 return InspectorResourceAgent::resourceContent(ownerDocument()->frame(), m_p ageStyleSheet->finalURL(), result); 996 return InspectorResourceAgent::resourceContent(ownerDocument()->frame(), m_p ageStyleSheet->finalURL(), result);
994 } 997 }
995 998
996 bool InspectorStyleSheet::inlineStyleSheetText(String* result) const 999 bool InspectorStyleSheet::inlineStyleSheetText(String* result) const
997 { 1000 {
998 if (!m_pageStyleSheet) 1001 if (!m_pageStyleSheet)
999 return false; 1002 return false;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 1161
1159 RefPtr<CSSMutableStyleDeclaration> tempDeclaration = CSSMutableStyleDeclarat ion::create(); 1162 RefPtr<CSSMutableStyleDeclaration> tempDeclaration = CSSMutableStyleDeclarat ion::create();
1160 CSSParser p; 1163 CSSParser p;
1161 p.parseDeclaration(tempDeclaration.get(), styleText, result); 1164 p.parseDeclaration(tempDeclaration.get(), styleText, result);
1162 return true; 1165 return true;
1163 } 1166 }
1164 1167
1165 } // namespace WebCore 1168 } // namespace WebCore
1166 1169
1167 #endif // ENABLE(INSPECTOR) 1170 #endif // ENABLE(INSPECTOR)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698