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

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

Issue 340903002: Revert "Subpixel precision for clientWidth, offsetWidth, scrollTop et al" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/dom/Element.h » ('j') | 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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 ExceptionState exceptionState(ExceptionState::SetterContext, "scrollLeft", " Element", info.Holder(), info.GetIsolate()); 50 ExceptionState exceptionState(ExceptionState::SetterContext, "scrollLeft", " Element", info.Holder(), info.GetIsolate());
51 Element* impl = V8Element::toNative(info.Holder()); 51 Element* impl = V8Element::toNative(info.Holder());
52 52
53 if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && value->IsObject()) { 53 if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && value->IsObject()) {
54 TONATIVE_VOID(Dictionary, scrollOptionsHorizontal, Dictionary(value, inf o.GetIsolate())); 54 TONATIVE_VOID(Dictionary, scrollOptionsHorizontal, Dictionary(value, inf o.GetIsolate()));
55 impl->setScrollLeft(scrollOptionsHorizontal, exceptionState); 55 impl->setScrollLeft(scrollOptionsHorizontal, exceptionState);
56 exceptionState.throwIfNeeded(); 56 exceptionState.throwIfNeeded();
57 return; 57 return;
58 } 58 }
59 59
60 TONATIVE_VOID_EXCEPTIONSTATE(float, position, toFloat(value, exceptionState) , exceptionState); 60 TONATIVE_VOID_EXCEPTIONSTATE(float, position, toInt32(value, exceptionState) , exceptionState);
61 impl->setScrollLeft(position); 61 impl->setScrollLeft(position);
62 } 62 }
63 63
64 void V8Element::scrollTopAttributeSetterCustom(v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info) 64 void V8Element::scrollTopAttributeSetterCustom(v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<void>& info)
65 { 65 {
66 ExceptionState exceptionState(ExceptionState::SetterContext, "scrollTop", "E lement", info.Holder(), info.GetIsolate()); 66 ExceptionState exceptionState(ExceptionState::SetterContext, "scrollTop", "E lement", info.Holder(), info.GetIsolate());
67 Element* impl = V8Element::toNative(info.Holder()); 67 Element* impl = V8Element::toNative(info.Holder());
68 68
69 if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && value->IsObject()) { 69 if (RuntimeEnabledFeatures::cssomSmoothScrollEnabled() && value->IsObject()) {
70 TONATIVE_VOID(Dictionary, scrollOptionsVertical, Dictionary(value, info. GetIsolate())); 70 TONATIVE_VOID(Dictionary, scrollOptionsVertical, Dictionary(value, info. GetIsolate()));
71 impl->setScrollTop(scrollOptionsVertical, exceptionState); 71 impl->setScrollTop(scrollOptionsVertical, exceptionState);
72 exceptionState.throwIfNeeded(); 72 exceptionState.throwIfNeeded();
73 return; 73 return;
74 } 74 }
75 75
76 TONATIVE_VOID_EXCEPTIONSTATE(float, position, toFloat(value, exceptionState) , exceptionState); 76 TONATIVE_VOID_EXCEPTIONSTATE(float, position, toInt32(value, exceptionState) , exceptionState);
77 impl->setScrollTop(position); 77 impl->setScrollTop(position);
78 } 78 }
79 79
80 //////////////////////////////////////////////////////////////////////////////// 80 ////////////////////////////////////////////////////////////////////////////////
81 // Overload resolution for animate() 81 // Overload resolution for animate()
82 // FIXME: needs support for union types http://crbug.com/240176 82 // FIXME: needs support for union types http://crbug.com/240176
83 //////////////////////////////////////////////////////////////////////////////// 83 ////////////////////////////////////////////////////////////////////////////////
84 84
85 // AnimationPlayer animate(AnimationEffect? effect); 85 // AnimationPlayer animate(AnimationEffect? effect);
86 void animate1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 86 void animate1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 default: 227 default:
228 throwArityTypeError(exceptionState, "[1]", info.Length()); 228 throwArityTypeError(exceptionState, "[1]", info.Length());
229 return; 229 return;
230 break; 230 break;
231 } 231 }
232 exceptionState.throwTypeError("No function was found that matched the signat ure provided."); 232 exceptionState.throwTypeError("No function was found that matched the signat ure provided.");
233 exceptionState.throwIfNeeded(); 233 exceptionState.throwIfNeeded();
234 } 234 }
235 235
236 } // namespace WebCore 236 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698