| ... |
... |
@@ -709,8 +709,11 @@ OrientationType ScreenOrientation::DeviceType(CallerType aCallerType) const { |
|
709
|
709
|
if (!bc) {
|
|
710
|
710
|
return nsRFPService::GetDefaultOrientationType();
|
|
711
|
711
|
}
|
|
712
|
|
- CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
|
|
713
|
|
- return nsRFPService::ViewportSizeToOrientationType(size.width, size.height);
|
|
|
712
|
+ if (bc->GetOrientationLock() == hal::ScreenOrientation::None) {
|
|
|
713
|
+ CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
|
|
|
714
|
+ return nsRFPService::ViewportSizeToOrientationType(size.width,
|
|
|
715
|
+ size.height);
|
|
|
716
|
+ }
|
|
714
|
717
|
}
|
|
715
|
718
|
return mType;
|
|
716
|
719
|
}
|
| ... |
... |
@@ -723,8 +726,10 @@ uint16_t ScreenOrientation::DeviceAngle(CallerType aCallerType) const { |
|
723
|
726
|
if (!bc) {
|
|
724
|
727
|
return 0;
|
|
725
|
728
|
}
|
|
726
|
|
- CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
|
|
727
|
|
- return nsRFPService::ViewportSizeToAngle(size.width, size.height);
|
|
|
729
|
+ if (bc->GetOrientationLock() == hal::ScreenOrientation::None) {
|
|
|
730
|
+ CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
|
|
|
731
|
+ return nsRFPService::ViewportSizeToAngle(size.width, size.height);
|
|
|
732
|
+ }
|
|
728
|
733
|
}
|
|
729
|
734
|
return mAngle;
|
|
730
|
735
|
}
|
| ... |
... |
@@ -740,7 +745,8 @@ OrientationType ScreenOrientation::GetType(CallerType aCallerType, |
|
740
|
745
|
|
|
741
|
746
|
OrientationType orientation = bc->GetCurrentOrientationType();
|
|
742
|
747
|
if (nsContentUtils::ShouldResistFingerprinting(
|
|
743
|
|
- aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation)) {
|
|
|
748
|
+ aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation) &&
|
|
|
749
|
+ bc->GetOrientationLock() == hal::ScreenOrientation::None) {
|
|
744
|
750
|
CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
|
|
745
|
751
|
return nsRFPService::ViewportSizeToOrientationType(size.width, size.height);
|
|
746
|
752
|
}
|
| ... |
... |
@@ -758,7 +764,8 @@ uint16_t ScreenOrientation::GetAngle(CallerType aCallerType, |
|
758
|
764
|
|
|
759
|
765
|
uint16_t angle = static_cast<uint16_t>(bc->GetCurrentOrientationAngle());
|
|
760
|
766
|
if (nsContentUtils::ShouldResistFingerprinting(
|
|
761
|
|
- aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation)) {
|
|
|
767
|
+ aCallerType, GetRelevantGlobal(), RFPTarget::ScreenOrientation) &&
|
|
|
768
|
+ bc->GetOrientationLock() == hal::ScreenOrientation::None) {
|
|
762
|
769
|
CSSIntSize size = bc->TopInnerSizeSpoofedForRFP();
|
|
763
|
770
|
return nsRFPService::ViewportSizeToAngle(size.width, size.height);
|
|
764
|
771
|
}
|