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

Side by Side Diff: Source/bindings/v8/custom/V8CSSStyleDeclarationCustom.cpp

Issue 113213002: Rename toWebCoreString*() utility methods to toCoreString*() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Keep "to" prefix Created 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007-2011 Google Inc. All rights reserved. 2 * Copyright (C) 2007-2011 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 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 // Javascript and the actual name of the property are not the same, so 98 // Javascript and the actual name of the property are not the same, so
99 // we have to do the following translation. The translation turns upper 99 // we have to do the following translation. The translation turns upper
100 // case characters into lower case characters and inserts dashes to 100 // case characters into lower case characters and inserts dashes to
101 // separate words. 101 // separate words.
102 // 102 //
103 // Example: 'backgroundPositionY' -> 'background-position-y' 103 // Example: 'backgroundPositionY' -> 'background-position-y'
104 // 104 //
105 // Also, certain prefixes such as 'css-' are stripped. 105 // Also, certain prefixes such as 'css-' are stripped.
106 static CSSPropertyInfo* cssPropertyInfo(v8::Handle<v8::String> v8PropertyName) 106 static CSSPropertyInfo* cssPropertyInfo(v8::Handle<v8::String> v8PropertyName)
107 { 107 {
108 String propertyName = toWebCoreString(v8PropertyName); 108 String propertyName = toCoreString(v8PropertyName);
109 typedef HashMap<String, CSSPropertyInfo*> CSSPropertyInfoMap; 109 typedef HashMap<String, CSSPropertyInfo*> CSSPropertyInfoMap;
110 DEFINE_STATIC_LOCAL(CSSPropertyInfoMap, map, ()); 110 DEFINE_STATIC_LOCAL(CSSPropertyInfoMap, map, ());
111 CSSPropertyInfo* propInfo = map.get(propertyName); 111 CSSPropertyInfo* propInfo = map.get(propertyName);
112 if (!propInfo) { 112 if (!propInfo) {
113 unsigned length = propertyName.length(); 113 unsigned length = propertyName.length();
114 if (!length) 114 if (!length)
115 return 0; 115 return 0;
116 116
117 StringBuilder builder; 117 StringBuilder builder;
118 builder.reserveCapacity(length); 118 builder.reserveCapacity(length);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 ExceptionState exceptionState(ExceptionState::SetterContext, getPropertyName (static_cast<CSSPropertyID>(propInfo->propID)), "CSSStyleDeclaration", info.Hold er(), info.GetIsolate()); 235 ExceptionState exceptionState(ExceptionState::SetterContext, getPropertyName (static_cast<CSSPropertyID>(propInfo->propID)), "CSSStyleDeclaration", info.Hold er(), info.GetIsolate());
236 imp->setPropertyInternal(static_cast<CSSPropertyID>(propInfo->propID), prope rtyValue, false, exceptionState); 236 imp->setPropertyInternal(static_cast<CSSPropertyID>(propInfo->propID), prope rtyValue, false, exceptionState);
237 237
238 if (exceptionState.throwIfNeeded()) 238 if (exceptionState.throwIfNeeded())
239 return; 239 return;
240 240
241 v8SetReturnValue(info, value); 241 v8SetReturnValue(info, value);
242 } 242 }
243 243
244 } // namespace WebCore 244 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/custom/V8BiquadFilterNodeCustom.cpp ('k') | Source/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698