Skip to content

Commit 8bda40a

Browse files
committed
Safari 9 Mobile works.
1 parent 8b63f63 commit 8bda40a

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/lib/core/platform/platform.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,4 @@ export class Platform {
3737

3838
// Trident on mobile adds the android platform to the userAgent to trick detections.
3939
ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;
40-
41-
// Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake
42-
// this and just place the Safari keyword in the userAgent. To be more safe about Safari every
43-
// Safari browser should also use Webkit as its layout engine.
44-
SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;
4540
}

src/lib/input/input-container.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import {
2424
} from './input-container-errors';
2525
import {MD_PLACEHOLDER_GLOBAL_OPTIONS} from '../core/placeholder/placeholder-options';
2626

27+
/** Whether the current specs are running inside of Safari 9. */
28+
const IS_SAFARI_9 = /.+AppleWebKit.+Version\/9.+ Safari.+/.test(navigator.userAgent);
2729

2830
describe('MdInputContainer', function () {
2931
beforeEach(async(() => {
@@ -108,7 +110,7 @@ describe('MdInputContainer', function () {
108110

109111
it('should not be treated as empty if type is date',
110112
inject([Platform], (platform: Platform) => {
111-
if (!(platform.TRIDENT || platform.FIREFOX || platform.SAFARI)) {
113+
if (!(platform.TRIDENT || platform.FIREFOX || (IS_SAFARI_9 && !platform.IOS))) {
112114
let fixture = TestBed.createComponent(MdInputContainerDateTestController);
113115
fixture.detectChanges();
114116

@@ -121,7 +123,7 @@ describe('MdInputContainer', function () {
121123
// Firefox and IE don't support type="date" and fallback to type="text".
122124
it('should be treated as empty if type is date on Firefox and IE',
123125
inject([Platform], (platform: Platform) => {
124-
if (platform.TRIDENT || platform.FIREFOX || platform.SAFARI) {
126+
if (platform.TRIDENT || platform.FIREFOX || (IS_SAFARI_9 && !platform.IOS)) {
125127
let fixture = TestBed.createComponent(MdInputContainerDateTestController);
126128
fixture.detectChanges();
127129

0 commit comments

Comments
 (0)