mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 07:45:30 +00:00
Merge mozilla-central to mozilla-inbound
This commit is contained in:
commit
33e05d0370
@ -78,6 +78,7 @@ dom/media/webspeech/recognition/energy_endpointer.cc
|
||||
dom/media/webspeech/recognition/energy_endpointer.h
|
||||
dom/media/webspeech/recognition/energy_endpointer_params.cc
|
||||
dom/media/webspeech/recognition/energy_endpointer_params.h
|
||||
dom/webauthn/cbor-cpp/.*
|
||||
dom/webauthn/winwebauthn/webauthn.h
|
||||
editor/libeditor/tests/browserscope/lib/richtext/.*
|
||||
editor/libeditor/tests/browserscope/lib/richtext2/.*
|
||||
|
@ -7,11 +7,11 @@
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef CBOR_CPP_CBOR_H
|
||||
@ -20,4 +20,4 @@
|
||||
#include "encoder.h"
|
||||
#include "output_dynamic.h"
|
||||
|
||||
#endif // CBOR_CPP_CBOR_H
|
||||
#endif //CBOR_CPP_CBOR_H
|
||||
|
@ -7,126 +7,144 @@
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "encoder.h"
|
||||
|
||||
using namespace cbor;
|
||||
|
||||
encoder::encoder(output &out) { _out = &out; }
|
||||
|
||||
encoder::~encoder() {}
|
||||
encoder::encoder(output &out) {
|
||||
_out = &out;
|
||||
}
|
||||
|
||||
encoder::~encoder() {
|
||||
|
||||
}
|
||||
|
||||
void encoder::write_type_value(int major_type, unsigned int value) {
|
||||
major_type <<= 5;
|
||||
if (value < 24) {
|
||||
_out->put_byte((unsigned char)(major_type | value));
|
||||
} else if (value < 256) {
|
||||
_out->put_byte((unsigned char)(major_type | 24));
|
||||
_out->put_byte((unsigned char)value);
|
||||
} else if (value < 65536) {
|
||||
_out->put_byte((unsigned char)(major_type | 25));
|
||||
_out->put_byte((unsigned char)(value >> 8));
|
||||
_out->put_byte((unsigned char)value);
|
||||
} else {
|
||||
_out->put_byte((unsigned char)(major_type | 26));
|
||||
_out->put_byte((unsigned char)(value >> 24));
|
||||
_out->put_byte((unsigned char)(value >> 16));
|
||||
_out->put_byte((unsigned char)(value >> 8));
|
||||
_out->put_byte((unsigned char)value);
|
||||
}
|
||||
major_type <<= 5;
|
||||
if(value < 24) {
|
||||
_out->put_byte((unsigned char) (major_type | value));
|
||||
} else if(value < 256) {
|
||||
_out->put_byte((unsigned char) (major_type | 24));
|
||||
_out->put_byte((unsigned char) value);
|
||||
} else if(value < 65536) {
|
||||
_out->put_byte((unsigned char) (major_type | 25));
|
||||
_out->put_byte((unsigned char) (value >> 8));
|
||||
_out->put_byte((unsigned char) value);
|
||||
} else {
|
||||
_out->put_byte((unsigned char) (major_type | 26));
|
||||
_out->put_byte((unsigned char) (value >> 24));
|
||||
_out->put_byte((unsigned char) (value >> 16));
|
||||
_out->put_byte((unsigned char) (value >> 8));
|
||||
_out->put_byte((unsigned char) value);
|
||||
}
|
||||
}
|
||||
|
||||
void encoder::write_type_value(int major_type, unsigned long long value) {
|
||||
major_type <<= 5;
|
||||
if (value < 24ULL) {
|
||||
_out->put_byte((unsigned char)(major_type | value));
|
||||
} else if (value < 256ULL) {
|
||||
_out->put_byte((unsigned char)(major_type | 24));
|
||||
_out->put_byte((unsigned char)value);
|
||||
} else if (value < 65536ULL) {
|
||||
_out->put_byte((unsigned char)(major_type | 25));
|
||||
_out->put_byte((unsigned char)(value >> 8));
|
||||
_out->put_byte((unsigned char)value);
|
||||
} else if (value < 4294967296ULL) {
|
||||
_out->put_byte((unsigned char)(major_type | 26));
|
||||
_out->put_byte((unsigned char)(value >> 24));
|
||||
_out->put_byte((unsigned char)(value >> 16));
|
||||
_out->put_byte((unsigned char)(value >> 8));
|
||||
_out->put_byte((unsigned char)value);
|
||||
} else {
|
||||
_out->put_byte((unsigned char)(major_type | 27));
|
||||
_out->put_byte((unsigned char)(value >> 56));
|
||||
_out->put_byte((unsigned char)(value >> 48));
|
||||
_out->put_byte((unsigned char)(value >> 40));
|
||||
_out->put_byte((unsigned char)(value >> 32));
|
||||
_out->put_byte((unsigned char)(value >> 24));
|
||||
_out->put_byte((unsigned char)(value >> 16));
|
||||
_out->put_byte((unsigned char)(value >> 8));
|
||||
_out->put_byte((unsigned char)value);
|
||||
}
|
||||
major_type <<= 5;
|
||||
if(value < 24ULL) {
|
||||
_out->put_byte((unsigned char) (major_type | value));
|
||||
} else if(value < 256ULL) {
|
||||
_out->put_byte((unsigned char) (major_type | 24));
|
||||
_out->put_byte((unsigned char) value);
|
||||
} else if(value < 65536ULL) {
|
||||
_out->put_byte((unsigned char) (major_type | 25));
|
||||
_out->put_byte((unsigned char) (value >> 8));
|
||||
_out->put_byte((unsigned char) value);
|
||||
} else if(value < 4294967296ULL) {
|
||||
_out->put_byte((unsigned char) (major_type | 26));
|
||||
_out->put_byte((unsigned char) (value >> 24));
|
||||
_out->put_byte((unsigned char) (value >> 16));
|
||||
_out->put_byte((unsigned char) (value >> 8));
|
||||
_out->put_byte((unsigned char) value);
|
||||
} else {
|
||||
_out->put_byte((unsigned char) (major_type | 27));
|
||||
_out->put_byte((unsigned char) (value >> 56));
|
||||
_out->put_byte((unsigned char) (value >> 48));
|
||||
_out->put_byte((unsigned char) (value >> 40));
|
||||
_out->put_byte((unsigned char) (value >> 32));
|
||||
_out->put_byte((unsigned char) (value >> 24));
|
||||
_out->put_byte((unsigned char) (value >> 16));
|
||||
_out->put_byte((unsigned char) (value >> 8));
|
||||
_out->put_byte((unsigned char) value);
|
||||
}
|
||||
}
|
||||
|
||||
void encoder::write_int(unsigned int value) { write_type_value(0, value); }
|
||||
void encoder::write_int(unsigned int value) {
|
||||
write_type_value(0, value);
|
||||
}
|
||||
|
||||
void encoder::write_int(unsigned long long value) {
|
||||
write_type_value(0, value);
|
||||
write_type_value(0, value);
|
||||
}
|
||||
|
||||
void encoder::write_int(long long value) {
|
||||
if (value < 0) {
|
||||
write_type_value(1, (unsigned long long)-(value + 1));
|
||||
} else {
|
||||
write_type_value(0, (unsigned long long)value);
|
||||
}
|
||||
if(value < 0) {
|
||||
write_type_value(1, (unsigned long long) -(value+1));
|
||||
} else {
|
||||
write_type_value(0, (unsigned long long) value);
|
||||
}
|
||||
}
|
||||
|
||||
void encoder::write_int(int value) {
|
||||
if (value < 0) {
|
||||
write_type_value(1, (unsigned int)-(value + 1));
|
||||
} else {
|
||||
write_type_value(0, (unsigned int)value);
|
||||
}
|
||||
if(value < 0) {
|
||||
write_type_value(1, (unsigned int) -(value+1));
|
||||
} else {
|
||||
write_type_value(0, (unsigned int) value);
|
||||
}
|
||||
}
|
||||
|
||||
void encoder::write_bytes(const unsigned char *data, unsigned int size) {
|
||||
write_type_value(2, size);
|
||||
_out->put_bytes(data, size);
|
||||
write_type_value(2, size);
|
||||
_out->put_bytes(data, size);
|
||||
}
|
||||
|
||||
void encoder::write_string(const char *data, unsigned int size) {
|
||||
write_type_value(3, size);
|
||||
_out->put_bytes((const unsigned char *)data, size);
|
||||
write_type_value(3, size);
|
||||
_out->put_bytes((const unsigned char *) data, size);
|
||||
}
|
||||
|
||||
void encoder::write_string(const std::string str) {
|
||||
write_type_value(3, (unsigned int)str.size());
|
||||
_out->put_bytes((const unsigned char *)str.c_str(), (int)str.size());
|
||||
write_type_value(3, (unsigned int) str.size());
|
||||
_out->put_bytes((const unsigned char *) str.c_str(), (int) str.size());
|
||||
}
|
||||
|
||||
void encoder::write_array(int size) { write_type_value(4, (unsigned int)size); }
|
||||
|
||||
void encoder::write_map(int size) { write_type_value(5, (unsigned int)size); }
|
||||
void encoder::write_array(int size) {
|
||||
write_type_value(4, (unsigned int) size);
|
||||
}
|
||||
|
||||
void encoder::write_tag(const unsigned int tag) { write_type_value(6, tag); }
|
||||
void encoder::write_map(int size) {
|
||||
write_type_value(5, (unsigned int) size);
|
||||
}
|
||||
|
||||
void encoder::write_tag(const unsigned int tag) {
|
||||
write_type_value(6, tag);
|
||||
}
|
||||
|
||||
void encoder::write_special(int special) {
|
||||
write_type_value(7, (unsigned int)special);
|
||||
write_type_value(7, (unsigned int) special);
|
||||
}
|
||||
|
||||
void encoder::write_bool(bool value) {
|
||||
if (value == true) {
|
||||
_out->put_byte((unsigned char)0xf5);
|
||||
} else {
|
||||
_out->put_byte((unsigned char)0xf4);
|
||||
}
|
||||
if (value == true) {
|
||||
_out->put_byte((unsigned char) 0xf5);
|
||||
} else {
|
||||
_out->put_byte((unsigned char) 0xf4);
|
||||
}
|
||||
}
|
||||
|
||||
void encoder::write_null() { _out->put_byte((unsigned char)0xf6); }
|
||||
void encoder::write_null() {
|
||||
_out->put_byte((unsigned char) 0xf6);
|
||||
}
|
||||
|
||||
void encoder::write_undefined() { _out->put_byte((unsigned char)0xf7); }
|
||||
void encoder::write_undefined() {
|
||||
_out->put_byte((unsigned char) 0xf7);
|
||||
}
|
@ -7,13 +7,14 @@
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __CborEncoder_H_
|
||||
#define __CborEncoder_H_
|
||||
|
||||
@ -21,48 +22,47 @@
|
||||
#include <string>
|
||||
|
||||
namespace cbor {
|
||||
class encoder {
|
||||
private:
|
||||
output *_out;
|
||||
class encoder {
|
||||
private:
|
||||
output *_out;
|
||||
public:
|
||||
explicit encoder(output &out);
|
||||
|
||||
public:
|
||||
explicit encoder(output &out);
|
||||
~encoder();
|
||||
|
||||
~encoder();
|
||||
void write_bool(bool value);
|
||||
|
||||
void write_bool(bool value);
|
||||
void write_int(int value);
|
||||
|
||||
void write_int(int value);
|
||||
void write_int(long long value);
|
||||
|
||||
void write_int(long long value);
|
||||
void write_int(unsigned int value);
|
||||
|
||||
void write_int(unsigned int value);
|
||||
void write_int(unsigned long long value);
|
||||
|
||||
void write_int(unsigned long long value);
|
||||
void write_bytes(const unsigned char *data, unsigned int size);
|
||||
|
||||
void write_bytes(const unsigned char *data, unsigned int size);
|
||||
void write_string(const char *data, unsigned int size);
|
||||
|
||||
void write_string(const char *data, unsigned int size);
|
||||
void write_string(const std::string str);
|
||||
|
||||
void write_string(const std::string str);
|
||||
void write_array(int size);
|
||||
|
||||
void write_array(int size);
|
||||
void write_map(int size);
|
||||
|
||||
void write_map(int size);
|
||||
void write_tag(const unsigned int tag);
|
||||
|
||||
void write_tag(const unsigned int tag);
|
||||
void write_special(int special);
|
||||
|
||||
void write_special(int special);
|
||||
void write_null();
|
||||
|
||||
void write_null();
|
||||
void write_undefined();
|
||||
|
||||
void write_undefined();
|
||||
private:
|
||||
void write_type_value(int major_type, unsigned int value);
|
||||
|
||||
private:
|
||||
void write_type_value(int major_type, unsigned int value);
|
||||
void write_type_value(int major_type, unsigned long long value);
|
||||
};
|
||||
}
|
||||
|
||||
void write_type_value(int major_type, unsigned long long value);
|
||||
};
|
||||
} // namespace cbor
|
||||
|
||||
#endif //__CborEncoder_H_
|
||||
#endif //__CborEncoder_H_
|
||||
|
@ -7,27 +7,28 @@
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __CborOutput_H_
|
||||
#define __CborOutput_H_
|
||||
|
||||
namespace cbor {
|
||||
class output {
|
||||
public:
|
||||
virtual unsigned char *data() = 0;
|
||||
class output {
|
||||
public:
|
||||
virtual unsigned char *data() = 0;
|
||||
|
||||
virtual unsigned int size() = 0;
|
||||
virtual unsigned int size() = 0;
|
||||
|
||||
virtual void put_byte(unsigned char value) = 0;
|
||||
virtual void put_byte(unsigned char value) = 0;
|
||||
|
||||
virtual void put_bytes(const unsigned char *data, int size) = 0;
|
||||
};
|
||||
} // namespace cbor
|
||||
virtual void put_bytes(const unsigned char *data, int size) = 0;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //__CborOutput_H_
|
||||
#endif //__CborOutput_H_
|
||||
|
@ -7,11 +7,11 @@
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#include "output_dynamic.h"
|
||||
@ -21,40 +21,49 @@
|
||||
|
||||
using namespace cbor;
|
||||
|
||||
|
||||
void output_dynamic::init(unsigned int initalCapacity) {
|
||||
this->_capacity = initalCapacity;
|
||||
this->_buffer = new unsigned char[initalCapacity];
|
||||
this->_offset = 0;
|
||||
this->_capacity = initalCapacity;
|
||||
this->_buffer = new unsigned char[initalCapacity];
|
||||
this->_offset = 0;
|
||||
}
|
||||
|
||||
output_dynamic::output_dynamic() { init(256); }
|
||||
output_dynamic::output_dynamic() {
|
||||
init(256);
|
||||
}
|
||||
|
||||
output_dynamic::output_dynamic(unsigned int inital_capacity) {
|
||||
init(inital_capacity);
|
||||
init(inital_capacity);
|
||||
}
|
||||
|
||||
output_dynamic::~output_dynamic() { delete _buffer; }
|
||||
output_dynamic::~output_dynamic() {
|
||||
delete _buffer;
|
||||
}
|
||||
|
||||
unsigned char *output_dynamic::data() { return _buffer; }
|
||||
unsigned char *output_dynamic::data() {
|
||||
return _buffer;
|
||||
}
|
||||
|
||||
unsigned int output_dynamic::size() { return _offset; }
|
||||
unsigned int output_dynamic::size() {
|
||||
return _offset;
|
||||
}
|
||||
|
||||
void output_dynamic::put_byte(unsigned char value) {
|
||||
if (_offset < _capacity) {
|
||||
_buffer[_offset++] = value;
|
||||
} else {
|
||||
_capacity *= 2;
|
||||
_buffer = (unsigned char *)realloc(_buffer, _capacity);
|
||||
_buffer[_offset++] = value;
|
||||
}
|
||||
if(_offset < _capacity) {
|
||||
_buffer[_offset++] = value;
|
||||
} else {
|
||||
_capacity *= 2;
|
||||
_buffer = (unsigned char *) realloc(_buffer, _capacity);
|
||||
_buffer[_offset++] = value;
|
||||
}
|
||||
}
|
||||
|
||||
void output_dynamic::put_bytes(const unsigned char *data, int size) {
|
||||
while (_offset + size > _capacity) {
|
||||
_capacity *= 2;
|
||||
_buffer = (unsigned char *)realloc(_buffer, _capacity);
|
||||
}
|
||||
while(_offset + size > _capacity) {
|
||||
_capacity *= 2;
|
||||
_buffer = (unsigned char *) realloc(_buffer, _capacity);
|
||||
}
|
||||
|
||||
memcpy(_buffer + _offset, data, size);
|
||||
_offset += size;
|
||||
memcpy(_buffer + _offset, data, size);
|
||||
_offset += size;
|
||||
}
|
||||
|
@ -7,43 +7,45 @@
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied. See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __CborDynamicOutput_H_
|
||||
#define __CborDynamicOutput_H_
|
||||
|
||||
|
||||
#include "output.h"
|
||||
|
||||
namespace cbor {
|
||||
class output_dynamic : public output {
|
||||
private:
|
||||
unsigned char *_buffer;
|
||||
unsigned int _capacity;
|
||||
unsigned int _offset;
|
||||
class output_dynamic : public output {
|
||||
private:
|
||||
unsigned char *_buffer;
|
||||
unsigned int _capacity;
|
||||
unsigned int _offset;
|
||||
public:
|
||||
output_dynamic();
|
||||
|
||||
public:
|
||||
output_dynamic();
|
||||
explicit output_dynamic(unsigned int inital_capacity);
|
||||
|
||||
explicit output_dynamic(unsigned int inital_capacity);
|
||||
~output_dynamic();
|
||||
|
||||
~output_dynamic();
|
||||
virtual unsigned char *data();
|
||||
|
||||
virtual unsigned char *data();
|
||||
virtual unsigned int size();
|
||||
|
||||
virtual unsigned int size();
|
||||
virtual void put_byte(unsigned char value);
|
||||
|
||||
virtual void put_byte(unsigned char value);
|
||||
virtual void put_bytes(const unsigned char *data, int size);
|
||||
|
||||
virtual void put_bytes(const unsigned char *data, int size);
|
||||
private:
|
||||
void init(unsigned int initalCapacity);
|
||||
};
|
||||
}
|
||||
|
||||
private:
|
||||
void init(unsigned int initalCapacity);
|
||||
};
|
||||
} // namespace cbor
|
||||
|
||||
#endif //__CborDynamicOutput_H_
|
||||
|
||||
#endif //__CborDynamicOutput_H_
|
||||
|
@ -30,13 +30,6 @@ const prefs = [
|
||||
// Pinch-zooming currently requires meta viewport support (this requirement
|
||||
// will eventually be removed).
|
||||
["dom.meta-viewport.enabled", true],
|
||||
// Pinch-zooming currently requires container scrolling (this requirement
|
||||
// will eventually be removed).
|
||||
["layout.scroll.root-frame-containers", 1],
|
||||
// Retained displaylists don't work well with container scrolling, so
|
||||
// they too need to be disabled for now.
|
||||
["layout.display-list.retain", false],
|
||||
["layout.display-list.retain.chrome", false],
|
||||
// We use the Visual Viewport API to tell the visual viewport offset.
|
||||
["dom.visualviewport.enabled", true],
|
||||
];
|
||||
|
@ -32,10 +32,6 @@ var prefs = [
|
||||
// Pinch-zooming currently requires meta viewport support (this requirement
|
||||
// will eventually be removed).
|
||||
["dom.meta-viewport.enabled", true],
|
||||
// Retained displaylists don't work well with container scrolling, so
|
||||
// they too need to be disabled for now.
|
||||
["layout.display-list.retain", false],
|
||||
["layout.display-list.retain.chrome", false],
|
||||
];
|
||||
|
||||
// Increase the tap timeouts so the double-tap is still detected in case of
|
||||
|
@ -1376,6 +1376,20 @@ void nsBlockFrame::Reflow(nsPresContext* aPresContext, ReflowOutput& aMetrics,
|
||||
} else {
|
||||
absoluteContainer->MarkSizeDependentFramesDirty();
|
||||
}
|
||||
if (haveInterrupt) {
|
||||
// We're not going to reflow absolute frames; make sure to account for
|
||||
// their existing overflow areas, which is usually a side effect of this
|
||||
// reflow.
|
||||
//
|
||||
// TODO(emilio): nsAbsoluteContainingBlock::Reflow already checks for
|
||||
// interrupt, can we just rely on it and unconditionally take the else
|
||||
// branch below? That's a bit more subtle / risky, since I don't see
|
||||
// what would reflow them in that case if they depended on our size.
|
||||
for (nsIFrame* kid = absoluteContainer->GetChildList().FirstChild(); kid;
|
||||
kid = kid->GetNextSibling()) {
|
||||
ConsiderChildOverflow(aMetrics.mOverflowAreas, kid);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LogicalSize containingBlockSize =
|
||||
CalculateContainingBlockSizeForAbsolutes(parentWM, *reflowInput,
|
||||
|
@ -3893,10 +3893,9 @@ bool ScrollFrameHelper::DecideScrollableLayer(
|
||||
aBuilder->RecomputeCurrentAnimatedGeometryRoot();
|
||||
}
|
||||
|
||||
if (gfxPrefs::LayoutUseContainersForRootFrames() &&
|
||||
mWillBuildScrollableLayer && mIsRoot) {
|
||||
mIsScrollableLayerInRootContainer = true;
|
||||
}
|
||||
mIsScrollableLayerInRootContainer =
|
||||
gfxPrefs::LayoutUseContainersForRootFrames() &&
|
||||
mWillBuildScrollableLayer && mIsRoot;
|
||||
return mWillBuildScrollableLayer;
|
||||
}
|
||||
|
||||
|
@ -132,6 +132,7 @@ skip-if = toolkit == 'android' || headless # Headless:Bug 1405871
|
||||
[test_plugin_position.xhtml]
|
||||
skip-if = e10s
|
||||
[test_scroll_behavior.html]
|
||||
[test_scrollframe_abspos_interrupt.html]
|
||||
[test_selection_expanding.html]
|
||||
support-files = selection_expanding_xbl.xml
|
||||
[test_selection_preventDefault.html]
|
||||
|
60
layout/generic/test/test_scrollframe_abspos_interrupt.html
Normal file
60
layout/generic/test/test_scrollframe_abspos_interrupt.html
Normal file
@ -0,0 +1,60 @@
|
||||
<!doctype html>
|
||||
<title>Test for bug 1526609</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
.scroller {
|
||||
overflow-y: auto;
|
||||
position: relative;
|
||||
width: 500px;
|
||||
height: 300px;
|
||||
}
|
||||
.kid {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
background: linear-gradient(to bottom, red, green);
|
||||
line-height: 100px;
|
||||
}
|
||||
</style>
|
||||
<div class="scroller" id="scroller">
|
||||
<div class="kid"></div>
|
||||
</div>
|
||||
<script>
|
||||
{
|
||||
let text = " foo bar ";
|
||||
|
||||
for (let i = 0; i < 16; ++i)
|
||||
text = text + text;
|
||||
document.querySelector(".kid").innerText = text;
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const scroller = document.querySelector("#scroller");
|
||||
|
||||
is(scroller.scrollTop, 0, "Initial scroll position");
|
||||
ok(scroller.scrollTopMax > 0, "Should be able to scroll down");
|
||||
|
||||
scroller.scrollTop = scroller.scrollTopMax;
|
||||
is(scroller.scrollTop, scroller.scrollTopMax, "Should've scrolled");
|
||||
|
||||
const origWidth = scroller.offsetWidth;
|
||||
const utils = SpecialPowers.DOMWindowUtils;
|
||||
|
||||
// Take control of the refresh driver
|
||||
utils.advanceTimeAndRefresh(0);
|
||||
|
||||
// Force the next reflow to get interrupted
|
||||
utils.forceReflowInterrupt();
|
||||
scroller.style.width = "300px";
|
||||
utils.advanceTimeAndRefresh(0);
|
||||
|
||||
isnot(scroller.scrollTop, 0, "Shouldn't have lost scroll position");
|
||||
isnot(scroller.offsetWidth, origWidth, "Should've had to reflow");
|
||||
|
||||
utils.restoreNormalRefresh();
|
||||
SimpleTest.finish();
|
||||
</script>
|
@ -13,4 +13,4 @@
|
||||
it should not be visible in the initial viewport position(0,0).
|
||||
-->
|
||||
<div style="position:fixed; top:0; right: 0; width:100px; height: 100px; background-color: green"></div>
|
||||
<div style="width: 200%; height: 100%;"></div>
|
||||
<div style="width: 200%; height: 200%;"></div>
|
||||
|
@ -117,3 +117,4 @@ jobs:
|
||||
- win64-node
|
||||
- win64-rust
|
||||
- win64-cbindgen
|
||||
- win64-nasm
|
||||
|
@ -442,8 +442,6 @@ tree > treechildren {
|
||||
|
||||
tree {
|
||||
-moz-box-orient: vertical;
|
||||
min-width: 0px;
|
||||
min-height: 0px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ dom/media/webspeech/recognition/energy_endpointer.cc
|
||||
dom/media/webspeech/recognition/energy_endpointer.h
|
||||
dom/media/webspeech/recognition/energy_endpointer_params.cc
|
||||
dom/media/webspeech/recognition/energy_endpointer_params.h
|
||||
dom/webauthn/cbor-cpp/
|
||||
editor/libeditor/tests/browserscope/lib/richtext/
|
||||
editor/libeditor/tests/browserscope/lib/richtext2/
|
||||
extensions/spellcheck/hunspell/src/
|
||||
|
Loading…
Reference in New Issue
Block a user