mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Automatically enable WebGL 2 for specific domains.
This commit is contained in:
parent
7d1f968d52
commit
e2845a6939
3 changed files with 25 additions and 4 deletions
|
@ -41,7 +41,6 @@ use js::error::throw_type_error;
|
|||
use js::rust::HandleValue;
|
||||
use profile_traits::ipc;
|
||||
use script_layout_interface::{HTMLCanvasData, HTMLCanvasDataSource};
|
||||
use servo_config::pref;
|
||||
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
|
||||
|
||||
const DEFAULT_WIDTH: u32 = 300;
|
||||
|
@ -222,7 +221,8 @@ impl HTMLCanvasElement {
|
|||
cx: JSContext,
|
||||
options: HandleValue,
|
||||
) -> Option<DomRoot<WebGL2RenderingContext>> {
|
||||
if !pref!(dom.webgl2.enabled) {
|
||||
if !WebGL2RenderingContext::is_webgl2_enabled(cx, self.global().reflector().get_jsobject())
|
||||
{
|
||||
return None;
|
||||
}
|
||||
if let Some(ctx) = self.context() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue