Skip to content

Commit

Permalink
Merge pull request #267 from miherlosev/fix_testcafe_i_113
Browse files Browse the repository at this point in the history
fix wrong Browser.isWebKit calculation for Safari
  • Loading branch information
inikulin committed Nov 30, 2015
2 parents 8a3fe5d + e464aaf commit fc03301
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/client/sandbox/shadow-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import INTERNAL_PROPS from '../../processing/dom/internal-properties';
import SandboxBase from './base';
import nativeMethods from './native-methods';
import * as domUtils from '../utils/dom';
import { isWebKit } from '../utils/browser';
import { isWebKit, isSafari } from '../utils/browser';
import { EVENTS } from '../dom-processor';
import { getOffsetPosition } from '../utils/position';
import SHADOW_UI_CLASS_NAME from '../../shadow-ui/class-name';
Expand Down Expand Up @@ -161,7 +161,7 @@ export default class ShadowUI extends SandboxBase {
});

// NOTE: T174435
if (isWebKit) {
if (isWebKit && !isSafari) {
var stylesheetsCopy = null;
var shadowRoot = null;

Expand Down
2 changes: 1 addition & 1 deletion src/client/utils/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export var isFirefox = browser.name === 'firefox' && !isIE11;
export var isOpera = browser.name === 'opera';
export var isOperaWithWebKit = /opr/.test(userAgent);
export var isSafari = isIOS || /safari/.test(userAgent) && !/chrome/.test(userAgent);
export var isWebKit = browser.name === 'webkit' && !isMSEdge && !isSafari;
export var isWebKit = browser.name === 'webkit' && !isMSEdge;
export var hasTouchEvents = !!('ontouchstart' in window);
export var isMacPlatform = /^Mac/.test(navigator.platform);

Expand Down
4 changes: 2 additions & 2 deletions test/client/fixtures/sandbox/shadow-ui-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var shadowUI = hammerhead.sandbox.shadowUI;
var iframeSandbox = hammerhead.sandbox.iframe;
var domUtils = hammerhead.utils.dom;
var nativeMethods = hammerhead.nativeMethods;
var isWebKit = hammerhead.utils.browser.isWebKit;
var browserUtils = hammerhead.utils.browser;


QUnit.testStart(function () {
Expand Down Expand Up @@ -441,7 +441,7 @@ test('querySelectorAll', function () {

module('ui stylesheet');

if (isWebKit) {
if (browserUtils.isWebKit && !browserUtils.isSafari) {
asyncTest('stylesheets are restored after the document is cleaned', function () {
var link1 = document.createElement('link');
var link2 = document.createElement('link');
Expand Down

0 comments on commit fc03301

Please sign in to comment.