Recent

Author Topic: Bug introduced? mainFrame.DomDocument no longer is a member  (Read 410 times)

MISV

  • Hero Member
  • *****
  • Posts: 704
Bug introduced? mainFrame.DomDocument no longer is a member
« on: September 17, 2020, 02:02:41 pm »
I recently updated Lazarus and  LCL Cocoa and suddenly I am getting compile-time error

Quote
Error: Identifier idents no member "DomDocument"

at line

Code: Pascal  [Select][+][-]
  1. FWebView_Cocoa.mainFrame.DomDocument

It should be there accordingly to documentation

https://developer.apple.com/documentation/webkit/webframe/1494248-domdocument

... Albeit I am of course using 10.15.6 and WebView is deprecated... But I need to use until support for WKWebView is complete (and to be honest I am also not that keen on learning/testing a new browser control)

It also appears my old compilations/executables using Webview continues to work, so I think this is a big introduced in a recent Lazarus release

« Last Edit: September 17, 2020, 02:37:37 pm by MISV »

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1071
  • Former Delphi 1-7, 10.2 User
Re: Bug introduced? mainFrame.DomDocument no longer is a member
« Reply #1 on: September 17, 2020, 02:08:05 pm »
* FPC version?
* Lazarus version?
* Simple demo code?
o Lazarus v2.1.0 r63871, FPC v3.3.1 r47164, macOS 10.14.6, Xcode 11.3.1
o Lazarus v2.1.0 r64160, FPC v3.3.1 Nov 27 21:16:31, macOS 11.0.1 (aarch64), Xcode 12.2
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware VM)
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 20.04 (PD VM)

MISV

  • Hero Member
  • *****
  • Posts: 704
Re: Bug introduced? mainFrame.DomDocument no longer is a member
« Reply #2 on: September 17, 2020, 02:30:18 pm »
Sorry, I figured since this was a compile time error complete demo code was not necessary:

Code: Pascal  [Select][+][-]
  1. var
  2.   TmpDom: DOMDocument;
  3.   FWebView_Cocoa: WebView;
  4. begin
  5.    // init TmpParams before this
  6.    FWebView_Cocoa := WebView( NSView(WebView.alloc).lclInitWithCreateParams(TmpParams) );
  7.    // load webpage URL before this
  8.    TmpDom := FWebView_Cocoa.mainFrame.DOMDocument; // compile time error!
  9.  

That is all the code necessary to duplicate the compile-time problem

Regarding versions Lazarus About window:
- Version 2.1.0
- Date: 2020-09-13
- FPC Version: 3.3.1
- SVN Revision: 63882
- X86-64-darwin-cocoa
« Last Edit: September 17, 2020, 08:33:49 pm by MISV »

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1071
  • Former Delphi 1-7, 10.2 User
Re: Bug introduced? mainFrame.DomDocument no longer is a member
« Reply #3 on: September 18, 2020, 03:45:04 am »
It took me a couple of hours to figure out the last two missing Uses clause items (ok, I'm slow) which, for posterity, were LCLtype and CocoaPrivate.

Anyway, with current FPC + Lazarus trunks, both lclInitWithCreateParams and DOMDocument cannot be found. Using Lazarus trunk and FPC 3.0.4, no problem, it compiles happily.

Time to file a bug report I think.
o Lazarus v2.1.0 r63871, FPC v3.3.1 r47164, macOS 10.14.6, Xcode 11.3.1
o Lazarus v2.1.0 r64160, FPC v3.3.1 Nov 27 21:16:31, macOS 11.0.1 (aarch64), Xcode 12.2
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 amd64 (VMware VM)
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 20.04 (PD VM)

MISV

  • Hero Member
  • *****
  • Posts: 704
Re: Bug introduced? mainFrame.DomDocument no longer is a member
« Reply #4 on: September 18, 2020, 09:24:42 am »
Just reported as compiler issue although I guess the problem may be in source

https://bugs.freepascal.org/view.php?id=37769

Let me know if you think the bug report can be improved

 

TinyPortal © 2005-2018