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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXSpinButton.cpp

Issue 2956053005: Keep track of fixed positioning in accessibility tree.
Patch Set: GetSimpleRelativeBounds, add failing test for fixed with transform Created 3 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 // AXSpinButtonPart 95 // AXSpinButtonPart
96 96
97 AXSpinButtonPart::AXSpinButtonPart(AXObjectCacheImpl& ax_object_cache) 97 AXSpinButtonPart::AXSpinButtonPart(AXObjectCacheImpl& ax_object_cache)
98 : AXMockObject(ax_object_cache), is_incrementor_(false) {} 98 : AXMockObject(ax_object_cache), is_incrementor_(false) {}
99 99
100 AXSpinButtonPart* AXSpinButtonPart::Create(AXObjectCacheImpl& ax_object_cache) { 100 AXSpinButtonPart* AXSpinButtonPart::Create(AXObjectCacheImpl& ax_object_cache) {
101 return new AXSpinButtonPart(ax_object_cache); 101 return new AXSpinButtonPart(ax_object_cache);
102 } 102 }
103 103
104 void AXSpinButtonPart::GetRelativeBounds( 104 bool AXSpinButtonPart::GetSimpleRelativeBounds(
105 AXObject** out_container, 105 AXObject** out_container,
106 FloatRect& out_bounds_in_container, 106 FloatRect& out_bounds_in_container) const {
107 SkMatrix44& out_container_transform) const {
108 *out_container = nullptr; 107 *out_container = nullptr;
109 out_bounds_in_container = FloatRect(); 108 out_bounds_in_container = FloatRect();
110 out_container_transform.setIdentity();
111 109
112 if (!ParentObject()) 110 if (!ParentObject())
113 return; 111 return false;
114 112
115 // FIXME: This logic should exist in the layout tree or elsewhere, but there 113 // FIXME: This logic should exist in the layout tree or elsewhere, but there
116 // is no relationship that exists that can be queried. 114 // is no relationship that exists that can be queried.
115 SkMatrix44 container_transform;
116 bool is_fixed_positioned = false;
117 ParentObject()->GetRelativeBounds(out_container, out_bounds_in_container, 117 ParentObject()->GetRelativeBounds(out_container, out_bounds_in_container,
118 out_container_transform); 118 container_transform, is_fixed_positioned);
119 out_bounds_in_container = FloatRect(0, 0, out_bounds_in_container.Width(), 119 out_bounds_in_container = FloatRect(0, 0, out_bounds_in_container.Width(),
120 out_bounds_in_container.Height()); 120 out_bounds_in_container.Height());
121 if (is_incrementor_) { 121 if (is_incrementor_) {
122 out_bounds_in_container.SetHeight(out_bounds_in_container.Height() / 2); 122 out_bounds_in_container.SetHeight(out_bounds_in_container.Height() / 2);
123 } else { 123 } else {
124 out_bounds_in_container.SetY(out_bounds_in_container.Y() + 124 out_bounds_in_container.SetY(out_bounds_in_container.Y() +
125 out_bounds_in_container.Height() / 2); 125 out_bounds_in_container.Height() / 2);
126 out_bounds_in_container.SetHeight(out_bounds_in_container.Height() / 2); 126 out_bounds_in_container.SetHeight(out_bounds_in_container.Height() / 2);
127 } 127 }
128 *out_container = ParentObject(); 128 *out_container = ParentObject();
129 return true;
129 } 130 }
130 131
131 bool AXSpinButtonPart::Press() { 132 bool AXSpinButtonPart::Press() {
132 if (!parent_ || !parent_->IsSpinButton()) 133 if (!parent_ || !parent_->IsSpinButton())
133 return false; 134 return false;
134 135
135 AXSpinButton* spin_button = ToAXSpinButton(ParentObject()); 136 AXSpinButton* spin_button = ToAXSpinButton(ParentObject());
136 if (is_incrementor_) 137 if (is_incrementor_)
137 spin_button->Step(1); 138 spin_button->Step(1);
138 else 139 else
139 spin_button->Step(-1); 140 spin_button->Step(-1);
140 141
141 return true; 142 return true;
142 } 143 }
143 144
144 } // namespace blink 145 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698