| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2015 Google Inc. All rights reserved. | 2 * Copyright (C) 2015 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 int delta_x = 0, | 101 int delta_x = 0, |
| 102 int delta_y = 0) { | 102 int delta_y = 0) { |
| 103 WebGestureEvent event(type, WebInputEvent::kNoModifiers, | 103 WebGestureEvent event(type, WebInputEvent::kNoModifiers, |
| 104 WebInputEvent::kTimeStampForTesting); | 104 WebInputEvent::kTimeStampForTesting); |
| 105 event.source_device = kWebGestureDeviceTouchscreen; | 105 event.source_device = kWebGestureDeviceTouchscreen; |
| 106 event.x = 100; | 106 event.x = 100; |
| 107 event.y = 100; | 107 event.y = 100; |
| 108 if (type == WebInputEvent::kGestureScrollUpdate) { | 108 if (type == WebInputEvent::kGestureScrollUpdate) { |
| 109 event.data.scroll_update.delta_x = delta_x; | 109 event.data.scroll_update.delta_x = delta_x; |
| 110 event.data.scroll_update.delta_y = delta_y; | 110 event.data.scroll_update.delta_y = delta_y; |
| 111 } else if (type == WebInputEvent::kGestureScrollBegin) { |
| 112 event.data.scroll_begin.delta_x_hint = delta_x; |
| 113 event.data.scroll_begin.delta_y_hint = delta_y; |
| 111 } | 114 } |
| 112 return WebCoalescedInputEvent(event); | 115 return WebCoalescedInputEvent(event); |
| 113 } | 116 } |
| 114 | 117 |
| 115 void VerticalScroll(float delta_y) { | 118 void VerticalScroll(float delta_y) { |
| 116 GetWebView()->HandleInputEvent( | 119 GetWebView()->HandleInputEvent( |
| 117 GenerateEvent(WebInputEvent::kGestureScrollBegin)); | 120 GenerateEvent(WebInputEvent::kGestureScrollBegin, 0, delta_y)); |
| 118 GetWebView()->HandleInputEvent( | 121 GetWebView()->HandleInputEvent( |
| 119 GenerateEvent(WebInputEvent::kGestureScrollUpdate, 0, delta_y)); | 122 GenerateEvent(WebInputEvent::kGestureScrollUpdate, 0, delta_y)); |
| 120 GetWebView()->HandleInputEvent( | 123 GetWebView()->HandleInputEvent( |
| 121 GenerateEvent(WebInputEvent::kGestureScrollEnd)); | 124 GenerateEvent(WebInputEvent::kGestureScrollEnd)); |
| 122 } | 125 } |
| 123 | 126 |
| 124 Element* GetElementById(const WebString& id) { | 127 Element* GetElementById(const WebString& id) { |
| 125 return static_cast<Element*>( | 128 return static_cast<Element*>( |
| 126 GetWebView()->MainFrame()->GetDocument().GetElementById(id)); | 129 GetWebView()->MainFrame()->GetDocument().GetElementById(id)); |
| 127 } | 130 } |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 | 1074 |
| 1072 // Make sure we're not adding the browser controls height to the vh units as | 1075 // Make sure we're not adding the browser controls height to the vh units as |
| 1073 // when they're locked to hidden, the ICB fills the entire viewport already. | 1076 // when they're locked to hidden, the ICB fills the entire viewport already. |
| 1074 EXPECT_FLOAT_EQ(200.f, abs_pos->getBoundingClientRect()->height()); | 1077 EXPECT_FLOAT_EQ(200.f, abs_pos->getBoundingClientRect()->height()); |
| 1075 EXPECT_FLOAT_EQ(200.f, fixed_pos->getBoundingClientRect()->height()); | 1078 EXPECT_FLOAT_EQ(200.f, fixed_pos->getBoundingClientRect()->height()); |
| 1076 EXPECT_EQ(400, GetFrame()->View()->ViewportSizeForViewportUnits().Height()); | 1079 EXPECT_EQ(400, GetFrame()->View()->ViewportSizeForViewportUnits().Height()); |
| 1077 } | 1080 } |
| 1078 } | 1081 } |
| 1079 | 1082 |
| 1080 } // namespace blink | 1083 } // namespace blink |
| OLD | NEW |