[fix][Content] readonly atributes since 5.5 25/204125/1
authorDawid Juszczak <d.juszczak@samsung.com>
Fri, 19 Apr 2019 08:52:17 +0000 (10:52 +0200)
committerDawid Juszczak <d.juszczak@samsung.com>
Fri, 19 Apr 2019 11:27:45 +0000 (13:27 +0200)
this change prevents user from modify
content.geolocation attributes

[Verification]
- tested on chrome console

Change-Id: Ia5e887d6029124e8eb3c0830391506632db16813
Signed-off-by: Dawid Juszczak <d.juszczak@samsung.com>
src/content/js/datatypes.js

index 27863f6b3a1071f40e605f503004f109f23fd3ed..a4671382912af3f7d3971079facefc602b362deb 100755 (executable)
@@ -354,7 +354,13 @@ function VideoContent(data) {
     },
     geolocation: {
       get: function() {
-        return geolocation;
+        if (isEarlierThan55) {
+          return geolocation;
+        } else {
+          // for keep geolocation's latitude and longitude readonly
+          // we need to return copy of this object
+          return new tizen.SimpleCoordinates(geolocation.latitude, geolocation.longitude);
+        }
       },
       set: function(v) {
         // since 5.5 this attribute is readonly, it is disallowed to modify it,
@@ -677,7 +683,13 @@ function ImageContent(data) {
     },
     geolocation: {
       get: function() {
-        return geolocation;
+        if (isEarlierThan55) {
+          return geolocation;
+        } else {
+          // for keep geolocation's latitude and longitude readonly
+          // we need to return copy of this object
+          return new tizen.SimpleCoordinates(geolocation.latitude, geolocation.longitude);
+        }
       },
       set: function(v) {
         // since 5.5 this attribute is readonly, it is disallowed to modify it,